Skip to content

Implement List and Kanban views with group-by and drag-to-change-value #1921

Closed

Description

@malibio

Summary

Clicking a schema in the side nav opens QueryNodeViewer, which renders three view tabs — List, Table, Kanban. Only Table is implemented. List and Kanban switch the active tab, persist the preference, and then render a "coming soon" placeholder.

This issue implements the two missing views, plus the property picker that Kanban needs to define its columns and to make drag-and-drop meaningful.

Current State

Viewer: packages/desktop-app/src/lib/components/viewers/query-node-viewer.svelte

  • View tabs rendered at lines 217–236
  • handleViewChange (line 193) sets viewComingSoon = view !== 'table' and persists via queryPreferencesService.saveViewConfig(nodeId, view)
  • Placeholder branch at lines 266–268

Implemented view: packages/desktop-app/src/lib/components/query/table-view.svelte + table-row.svelte

Already scaffolded, currently unused:

  • ListViewConfig, KanbanViewConfig in packages/desktop-app/src/lib/types/query.ts:113–131 — KanbanViewConfig.groupBy is already typed as required
  • QueryPreferencesService.saveViewConfig(queryNodeId, view, config?) already merges per-view config into viewConfigs[view], so persisting groupBy needs no service change

Because the preference persists for all three tabs, a user whose last view was Kanban currently reopens straight into the "coming soon" panel.

Scope

1. List view

A simple list of results using the node title, one row per node — the same title resolution TableView's content column already uses: prefer node.title (computed by title_template) over node.content, falling back to Untitled.

  • New component packages/desktop-app/src/lib/components/query/list-view.svelte
  • Clicking a row calls the existing onRowClick(nodeId) handler → opens the node in the other pane (query-node-viewer.svelte:208)
  • Read node data from sharedNodeStore per-row, matching the table-row.svelte pattern, so rows stay reactive to edits made in another pane
  • Paginate at the same PAGE_SIZE = 25 as TableView for consistency

ListViewConfig also types layout: 'compact' | 'comfortable' | 'spacious', showProperties? and groupBy?. Out of scope for this issue — implement the plain title list; leave the extra config fields unused rather than half-wiring them.

2. Kanban view

  • New component packages/desktop-app/src/lib/components/query/kanban-view.svelte
  • Columns are derived from the values of the selected groupBy property
  • Each card shows the node title (same resolution as List)
  • Clicking a card opens the node via onRowClick
  • Nodes whose groupBy value is unset/null group into an "Unassigned" column
  • Cards read from sharedNodeStore so a change made elsewhere moves the card

3. Group-by property picker

Kanban needs a chosen property before it can render columns.

  • A picker in the Kanban view header listing eligible schema fields
  • Selection persists per query node. Today that means saveViewConfig(nodeId, 'kanban', { groupBy }), which needs no service change. Under Separate the default type view from persisted query nodes #1919 view config moves onto the query node itself, so a board travels with its query instead of being stranded per-device in localStorage — build against whichever is in place when this lands; the picker UI and drag behavior are unaffected either way
  • On first switch to Kanban with nothing stored, default to the first eligible field; if the schema has none, render an explanatory empty state instead of columns

Eligible fields — recommendation: type === 'enum' only. Enum fields carry coreValues/userValues (schema-node.ts:74–78), which give both the complete column set and the display labels — table-row.svelte:68–76 already resolves enum values to labels this way. Non-enum fields have unbounded value sets, so columns could only be derived from values that happen to exist in the current result set, and dragging could not offer a valid target set. Proceeding with enum-only unless redirected.

4. Drag to change property value

Dragging a card into another column sets the dragged node's groupBy property to that column's value.

  • Persist through the existing store path: sharedNodeStore.updateNode(nodeId, changes, source) (shared-node-store.svelte.ts:939)
  • Because cards render from sharedNodeStore, the card should move on the store update — no local list mutation
  • Dropping a card back into its own column is a no-op (no write)
  • If the update fails, the card returns to its original column and the error surfaces

Note on write shape: TableView reads a field from three places in order — camelCase top-level (typed core fields like task.dueDate), snake_case top-level, then node.properties[field] (table-row.svelte:44–52). The write must target whichever of those the field actually lives in; a core typed field and a user-defined schema field are not written the same way. Worth confirming against a core type (task.status) and a user-defined schema during implementation.

Acceptance Criteria

  • List view renders one row per result using the node title, clicking a row opens the node
  • List view rows update reactively when a node is edited in another pane
  • Kanban view renders one column per value of the selected group-by property
  • Cards show the node title; clicking a card opens the node
  • Nodes with no value for the group-by property appear in an "Unassigned" column
  • Group-by picker lists eligible schema fields and persists the selection per query node
  • Reopening a query restores both the last view and its stored group-by
  • A schema with no eligible group-by field shows an explanatory empty state, not broken columns
  • Dragging a card to another column updates that node's property value and persists it
  • The moved card reflects its new column after the store update
  • Dropping a card into its own column performs no write
  • A failed update returns the card to its original column and surfaces the error
  • The "coming soon" placeholder and the viewComingSoon state are deleted
  • Keyboard-accessible alternative to drag for moving a card between columns

Out of Scope

  • ListViewConfig layout density, showProperties, and list grouping
  • Reordering cards within a Kanban column (no ordering field exists for it)
  • Kanban cardLayout: 'compact' | 'detailed' — render a single card layout
  • Column-level actions (collapse, hide, rename, add enum value from the board)

Notes

Activity

  1. mstomar125 commented on Aug 6, 2026

    @mstomar125
    Contributor

    Frontend baseline: 182 files / 4326 tests passing. Implementing List + Kanban views: two new view components (list-view, kanban-view), an enum group-by picker, drag-to-change-value (with keyboard alternative), and removing the coming-soon placeholder. Group/eligibility/write-shape logic extracted into a unit-tested helper.

  2. mstomar125 commented on Aug 6, 2026

    @mstomar125
    Contributor

    Resolved in #1984 (merged, main 95d4105b).

    List and Kanban views are now implemented in QueryNodeViewer:

    • List — one row per result showing the node title, reactive to cross-pane edits, paginated at 25, click opens the node.
    • Kanban — columns from a selected enum field's values (+ an "Unassigned" bucket), cards read from the store and move reactively; move a card by drag or the per-card keyboard "Move to" select; same-column drop is a no-op; a rejected persist rolls the card back via the store. Group-by picker (enum fields), persists per query node and restores on reopen; explanatory empty state when the schema has no enum field.
    • The viewComingSoon placeholder is gone.

    All 13 acceptance criteria met. Grouping/write-shape logic is in a unit-tested helper (kanban-grouping.ts, 16 tests). Pragmatic-code-review: REQUEST CHANGES → both 🟡 correctness items resolved → APPROVE on re-review. Two scale/test hardening items (large-board pagination/virtualization, browser DnD tests) tracked as follow-up #1985.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions