Repository navigation
Separate the default type view from persisted query nodes (closes #1919) - #1986
Conversation
QueryNodeViewer now serves two shapes from one component, branching on the
node it is handed rather than the tab's decorative nodeType flag:
- schema node → DEFAULT type view: all nodes of the type, unfiltered, nothing
persisted. The first divergence — a filter edit, a view/group-by change, or a
title rename — MATERIALIZES a real nodeType:'query' node (targetType inherited
from the schema, generatedBy:'user') and re-routes the tab to it (via the
existing onNodeIdChange → updateTabContent → {#key} remount), so subsequent
edits persist.
- query node → SAVED query: reads the stored QueryDefinition + view config off
the node and executes the filters. queryNodes only filters by nodeType, so the
definition (filters → sort → limit) is executed client-side in the new
query-node-model helpers.
Also:
- Stop writing query definitions onto schema nodes; drop the schema-node read.
- Titles follow the BaseNodeViewer pattern: "Default" for the type view,
"Untitled Query" for a fresh materialized query, both editable in place; the
tab title reflects the query node's content.
- View config (last view + Kanban group-by) now lives on the query node's
properties.viewConfig instead of localStorage. KanbanView takes groupBy +
onGroupByChange (viewer-owned) instead of QueryPreferencesService, which is
deleted along with its type and test (its only consumer was this path).
- Disable the /query slash command (queryNodePlugin keeps its node, viewer, and
reference registrations) — it produced definition-less, non-rendering nodes.
Side-nav nesting of saved queries under their type is left as a follow-up
(TODO in navigation-sidebar). query-node-model has 25 unit tests. No backend
changes (QueryNodeBehavior stores arbitrary properties).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Addresses the pragmatic-code-review findings on #1919: - 🟡 F1: saved/default fetch now passes an explicit limit (FETCH_LIMIT=1000) instead of relying on the daemon's 100-node default, so client-side filtering runs over a realistic candidate set; when the set is capped, a visible caveat says so rather than silently under-returning. - 🟡 F2: parent/children relationship filters can't be evaluated from a single node, so a saved query with them now shows a visible caveat that results may be broader than the definition, instead of silently widening. New `unevaluableFilters` helper (+3 unit tests). - 🟡 F3: materialize re-routes the tab even if the post-create getNode momentarily returns null — the node exists, so we avoid an orphan + a duplicate on the next divergence. - 🟡 F4: Escape during a title edit sets a cancel guard so the input's blur-triggered commit no longer renames/materializes with the discarded draft. - 🟢 F7: empty state now reads "No results match this query." on a saved query vs "No nodes of this type yet." on the default view. Left as noted minors (store surfaces them / low-impact): rapid saved-view toggles racing on one version (F5, store OCC handles), a dropped second divergence keeping its in-memory view (F6), and no-op Edit→Save still materializing (F8). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pragmatic code review — RE-REVIEW — issue #1919 "Separate the default type view from persisted query nodes"Review Type: Re-Review · Previously reviewed: Previous Review Summary
Per-finding verdict✅ F1 — Saved/default fetch capped at 100 → silent under-return — Resolved (scoped, made honest)
✅ F2 — parent/children filters silently widen — Resolved (visible caveat, pass-through preserved)
✅ F3 — createNode ok but getNode null → orphan + duplicate — Resolved
✅ F4 — Escape during title edit still commits/materializes — Resolved (robust)
✅ F7 — Empty-state copy — Resolved
⏸ F5 / F6 / F8 — Consciously deferred (acceptable)The commit message explicitly records these as left minors: F5 (rapid saved-view toggles racing one version — store OCC surfaces it), F6 (dropped 2nd divergence keeps its in-memory view), F8 (no-op Edit→Save still materializes). All three were 🟢 polish and don't gate the feature. Deferral is documented and reasonable. New issues introduced by the deltaNone blocking. Observations:
Recommendation: APPROVEAll four blocking findings (F1–F4) from the initial REQUEST CHANGES are resolved correctly and adversarially verified; F7 is fixed; F5/F6/F8 are documented deferrals of 🟢 polish. The two residual minors (exact-boundary |
mstomar125
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): APPROVE (posted as comment — GitHub blocks self-approval). Findings above.
|
Status: ready, holding for a live smoke test before merge. Gate-green, reviewed twice (adversarial REQUEST CHANGES → all 4 🟡 fixed → re-review APPROVE), 28 model unit tests,
Not merging until that pass is done. Branch/worktree preserved. |
Summary
QueryNodeViewernow serves two shapes from one component, branching on the loaded node (not the tab's decorativenodeTypeflag):nodeType:'query'node (targetType inherited from the schema,generatedBy:'user') and re-routes the tab to it via the existingonNodeIdChange → updateTabContent → {#key}remount, so subsequent edits persist.QueryDefinition+ view config off the node and executes the filters.queryNodesonly filters bynodeType, so filter → sort → limit run client-side in the newquery-node-modelhelpers.Plus: stop writing query defs onto schema nodes; in-place editable titles ("Default" / "Untitled Query") with the tab title reflecting the query name; view config (last view + Kanban group-by) moved off
localStorageontoproperties.viewConfig(QueryPreferencesServicedeleted — this was its only consumer);/queryslash command disabled (plugin keeps node/viewer/reference).No backend changes —
QueryNodeBehaviorstores arbitrary properties.Review findings — all addressed
An adversarial pragmatic-code-review (posted on #1919) returned REQUEST CHANGES with 4 real 🟡s, all fixed in the follow-up commit:
FETCH_LIMIT=1000(was relying on the daemon's 100 default), and shows a visible caveat when the set is capped, so filtering no longer silently under-returns.parent/childrenrelationship filters can't be evaluated from a single node → a visible caveat ("results may be broader than the saved query") instead of silently widening. NewunevaluableFiltershelper (+3 tests).getNodemomentarily returns null (avoids an orphan + a duplicate on the next divergence).Implemented + reviewed headless; not run in a live app. The reviewer recommends a manual smoke test before merge: materialize-from-view-change, Escape-during-rename, and a saved query over a >100-instance type. Side-nav nesting of saved queries is a deliberate follow-up (TODO in navigation-sidebar).
Testing
query-node-model28 unit tests; full frontend suite 184 files / 4349 tests green;quality:fixclean (0/0); full pre-push gate (test:all + cargo build + Tauri-seam e2e) green.🤖 Generated with Claude Code