Skip to content

Revert "Improve desktop GUI UX and observation history workflows" - #56

Closed
Dumdart wants to merge 1 commit into
masterfrom
revert-55-enhance-gui-ux
Closed

Revert "Improve desktop GUI UX and observation history workflows"#56
Dumdart wants to merge 1 commit into
masterfrom
revert-55-enhance-gui-ux

Conversation

@Dumdart

@Dumdart Dumdart commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Reverts #55

@Dumdart Dumdart closed this Sep 9, 2026
@Dumdart
Dumdart deleted the revert-55-enhance-gui-ux branch September 9, 2026 15:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85939a9820

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 225 to 227
def render_query(self, query: SnapshotQuery) -> None:
if query == self._rendered_query and self.has_unsaved_edits:
return
self._rendered_query = query
self._topic_filter.setText(query.topic_filter)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve snapshot query drafts during live refreshes

When the user is editing the snapshot filter, age, or limits while MQTT messages are arriving, _observe_messages() refreshes the snapshot, topics_changed invokes MainWindow._render_tree(), and that method calls render_query() with the last applied query. These unconditional assignments overwrite every unsaved field, so on an active broker the form can reset before the user clicks Apply or Reconnect & observe; retain the dirty-state guard instead of replacing an in-progress draft.

AGENTS.md reference: AGENTS.md:L30-L33

Useful? React with 👍 / 👎.

Comment on lines 202 to 203
def render(self) -> None:
context = (
self._view_model.active_broker_profile.id,
self._view_model.topic if self._target_kind == "topic" else "",
)
if self.has_unsaved_edits and self._draft_context == context:
return
if self._target_kind == "topic":

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep expectation edits across health refreshes

When editing an existing expectation on a broker receiving messages, the scheduled health evaluation emits health_changed, which calls this render() and reloads the selected persisted expectation via _load(). Because the dirty-draft check was removed, any name, condition, action, or description typed since selection is silently replaced roughly 750 ms after a live update; skip reloading when the current broker/topic context is unchanged and the form is dirty.

AGENTS.md reference: AGENTS.md:L30-L33

Useful? React with 👍 / 👎.

Comment on lines +145 to +147
if has_topics and not has_cached_values:
self._empty_state.setVisible(False)
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not label stored snapshot values as unobserved

After startup or reconnection, when the snapshot contains only persisted values, the caller passes both has_cached_values=True and has_topics=True. This condition does not hide the empty-state panel, and the connected/unfiltered path falls through to “No values observed yet” with a Reconnect & observe action even though the tree is populated with stored observations. Handle the cached-only case explicitly (or hide the empty state) so the UI does not contradict the displayed data.

Useful? React with 👍 / 👎.

Comment on lines 137 to +138
self.error.clear()
busy = self._view_model.is_busy("history-settings")
self.save.setEnabled(self._loaded and not busy)
self.save.setText("Applying…" if busy else "Apply history settings")
self.broker.setEnabled(not busy)
if self._view_model.history_settings_broker == self.broker.currentData():
if self._view_model.history_settings_error:
self.error.setText(self._view_model.history_settings_error)
self.save.setEnabled(self._loaded)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Lock history settings while an apply is running

While save_history_settings() is awaiting its worker-thread calls, this validation path leaves Apply enabled and no longer disables the broker selector. A second click consequently starts a task that fails with “operation is already in progress”; more seriously, switching to broker B during broker A's save can start a B load that is then invalidated by A's post-save load_history_settings(A), leaving the selector on B with no loaded settings until a manual reload. Consult the history-settings busy state and disable both controls for the duration of the operation.

AGENTS.md reference: AGENTS.md:L30-L33

Useful? React with 👍 / 👎.

Comment on lines 781 to 784
def topic_paths(self) -> list[str]:
subscriptions = self.subscriptions
observed_topics = tuple(item.topic for item in self._observer_snapshot.topics)
observed_topics = tuple(item.topic for item in self._snapshot.topics)
return list(collect_visible_topic_paths(subscriptions, observed_topics))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the observer tree independent of snapshot result bounds

When a subscription has more observed topics than the active snapshot result limit, or the snapshot topic filter excludes some matching topics, deriving observed_topics from _snapshot.topics removes those still-retained observations from the observer tree and from selected_wildcard_filter_summary. With the default limit this makes the 101st matching topic disappear and prevents users from selecting it even though its latest value remains available; build the navigation tree from an unfiltered observer snapshot and reserve the bounded snapshot for snapshot counts and inspection.

Useful? React with 👍 / 👎.

Comment on lines 1323 to +1325
def showEvent(self, event: QShowEvent) -> None:
super().showEvent(event)
if not self._initial_focus_set:
self._initial_focus_set = True
if self._inspector_stack.currentWidget() is self._topic_details:
self._topic_details.focus_payload()
else:
self._observer_tree.focus_search()
self._topic_details.focus_payload()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid stealing focus on every window show event

A QShowEvent is delivered again when the window is restored or shown after being hidden, not only during initial startup. Calling focus_payload() unconditionally therefore moves keyboard focus away from whichever control the user was using—such as topic search or an editor—and it also targets a hidden payload widget when the snapshot inspector is current. Limit initial-focus setup to the first show and choose a visible control for the active inspector.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant