Skip to content

JSON result mode offers filters and row editing whose effects it never shows #2244

Description

@datlechin

Found while reworking the result-mode command routing in #2222. Both halves predate that PR; #2222 deliberately preserved the existing behaviour rather than changing it unannounced, so they are filed here instead.

JSON mode offers two sets of controls whose effect it never shows.

The Filters toggle toggles a panel that does not exist there. ResultsViewMode.showsRowFilters is .data || .json, so the funnel button appears in the status bar in JSON mode. But FilterPanelView renders only inside the case .data: arm of MainEditorContentView.resultsSection (line 661 on main). Clicking the toggle in JSON mode flips filterState.isVisible and draws nothing. The same is true of Cmd+Option+F.

Row editing acts on rows JSON mode does not redraw. Add Row, Duplicate Row, Delete and Paste are enabled in JSON mode, because GridSelectionOwner.resolve(.table, .json) is .dataGrid and the JSON view genuinely shows the data grid's rows and its selection. But ResultsJsonView renders resolvedTableRows(for: tab), the loaded rows, with no pending-change overlay. So Add Row inserts a pending row that does not appear, Paste pastes rows that do not appear, and Delete marks rows that keep rendering unchanged. The Save button lights up and the user cannot see why.

Delete is the interesting one: selecting rows in Data mode, switching to JSON to check the payload, then pressing Cmd+Delete is a real flow, and it works. It just gives no feedback until you switch back.

Two ways to settle it, and it is a product call rather than a code one:

  1. Make the effects visible. JSON mode reads the pending-change overlay the grid already has, and gains the filter panel. Costs the most, keeps every command meaningful.
  2. Make JSON mode read-only. The toggle and the four row commands turn off there, and it becomes an inspection view. Costs the Data-then-JSON-then-Delete flow, and needs a CHANGELOG line because it removes something that works today.

Verified on main at edae33c: showsRowFilters at QueryTab.swift:23, FilterPanelView at MainEditorContentView.swift:661 inside case .data: (line 623), ResultsJsonView construction at line 588 with no change-manager input.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions