Skip to content

feat(sidebar): needs-attention view and sort orders (multi-host PR 5a) - #311

Merged
sambitcreate merged 4 commits into
mainfrom
feat/multi-host-sidebar-organize
Oct 4, 2026
Merged

sambitcreate merged 4 commits into
mainfrom
feat/multi-host-sidebar-organize

Conversation

@sambitcreate

Copy link
Copy Markdown
Owner

Summary

This is the local half of §6 ("Sidebar organization") of the desktop multi-host control plan. The plan for this PR is docs/plans/desktop-multi-host-pr5a-sidebar-organize.md.

The Organize sidebar menu now has three labelled radio groups:

  • View:
    • Workspaces (the existing groups)
    • Recent (the existing time buckets)
    • Needs attention (new). Chats are grouped as Needs approval > Needs input > Working > Unread > Other chats. Within a group, the most recent activity comes first.
  • Sort chats: Last activity (default) or Created. Shown in the Workspaces and Recent views.
  • Sort workspaces: Last activity (default), Created or Manual. Shown in the Workspaces view.

Manual order:

  • You can drag workspace headers to reorder them. The keyboard alternative is Move up / Move down in each workspace's Actions menu.
  • Both are disabled while a search is active, and the move items are disabled at either end of the list.
  • Choosing Manual saves the order currently on screen, so nothing jumps.

Other changes:

  • The projection is a pure, host-agnostic module, renderer/lib/sidebar-organization.ts. Local workspaces and chats reach it through an adapter, renderer/lib/sidebar-workspace-groups.ts. The next PR (5b) adds a remote adapter that feeds the same inputs.
  • Manual order uses host-qualified keys: projectOrderKey(hostId, projectId). The local host is "local".
  • Preferences stay in the existing local key, aiden-agent.sidebar.v1:
    • The legacy organization value is migrated on read, and still written so a downgraded build keeps the user's view.
    • The order list is capped at 500 keys.
    • Only local: keys are pruned against the workspace registry.
  • Chat jump shortcuts (⌘1–9) and previous/next now follow the rows in the order they are shown. Before, Workspaces mode re-sorted the shortcuts by recency.
  • ui.tsx gains DropdownMenuRadioGroup and DropdownMenuRadioItem.

Out of scope (5b): remote rows, the machine filter, the globe marker, cross-machine grouping, and offline/stale state. There is no onboarding change, because this is an organizational preference.

Screens/behaviour notes

  • The menu uses the existing dropdown surface:
    • Each group has a label.
    • The checked option shows a check indicator.
    • The view icons keep their contrast on the highlighted accent row.
    • Groups that don't apply to the current view are hidden.
  • The drop position during a drag is a thin accent line, using the bg-accent and rounded-pill tokens. It is a functional indicator, not a decorative border, and focus rings are unchanged.
  • In Needs attention, each tier that has chats gets its own section. The chat that is open never counts as unread.
  • Chats with missing timestamps sort last. Ties break by name, then by key, so identical names keep a stable order.

Test plan

  • npm run type-check and npm run type-check:e2e
  • eslint on the touched files
  • npm run test:ci-policy. The new test files are registered in test:sidebar and scripts/ci-test-registry.json.
  • npm run test:sidebar: 58 pass. This includes:
    • renderer/lib/sidebar-organization.test.ts:
      • tiers and ties
      • missing timestamps and identical names
      • manual order with stale keys
      • search
      • Recent buckets for both sorts
      • displayed rows
      • move helpers
      • preference migration and bounds
    • renderer/lib/sidebar-workspace-groups.test.ts: the local adapter's admission rules
    • renderer/components/sidebar-organize-menu.test.tsx: the rendered radio semantics, and which groups show in each view
  • renderer/components/chat-sidebar.test.tsx is a legacy source-grep suite. Its organization assertions were removed and replaced by the behavioural tests above. No assertions were added to it.
  • Playwright, tests/e2e/chat-shell-interactions.spec.ts, two new specs:
    • Needs attention section order, driven by a pushed chats:activity-changed snapshot. The view persists across a reload.
    • Manual order changed by Move down and by drag, with the end items disabled. The order persists across a reload.
  • Locally, chat-shell-interactions, draft-agent-chats and chat-message-queue all pass: 42/42.

Flaky test record

None so far.

🤖 Generated with Claude Code

sambitcreate and others added 2 commits October 3, 2026 00:34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extend the Organize sidebar menu with a View group (Workspaces, Recent,
Needs attention), a chat sort (last activity or created) and a workspace
sort (last activity, created or manual). Manual order is keyed by
host-qualified project keys and can be changed by drag or by Move up /
Move down in the workspace actions menu.

The projection lives in a pure, host-agnostic module that later remote
rows can feed. Chat shortcuts now follow the displayed row order.
Preferences stay client-local and migrate the legacy organization field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@very-hermes-bot

very-hermes-bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Hermes Review Bot

Confidence: 5

Engine: agy/gemini-3.8-flash-high
Review mode: full
Head: 96849c26980975a40764a829db5147e7adf95586
Generated: 2026-10-04T00:26:53+00:00
Reviews: 1

Summary

Adds the local sidebar organization foundation for multi-host control, introducing three distinct sidebar views (Workspaces, Recent time buckets, and a Needs attention triage view) alongside configurable chat and workspace sort orders. A pure, generic projection in renderer/lib/sidebar-organization.ts consumes host-agnostic summaries and powers displayed rows, grouping, triage tiering, search filtering, and drag/keyboard manual workspace reordering. Preferences are persisted under aiden-agent.sidebar.v1 with backward-compatible migration and pruning of local workspaces, while keyboard jump shortcuts (⌘1–9) now reliably track visual row order across all views. Maintainers should double-check that switching to manual sort appropriately locks in the current visual workspace order without list jumping.

Confidence Score: 5/5

Fully traced and verified the complete diff across projection logic, local workspace adapters, dropdown radio menus, preference persistence and migrations, and existing/new test suites.

📁 Important Files Changed
  • renderer/lib/sidebar-organization.ts: Pure, host-agnostic projection engine managing view grouping (projects, recent buckets, attention tiers), sorting (last activity, created, manual), drag/keyboard manual ordering helpers, and preference schema validation/migration.
  • renderer/lib/sidebar-workspace-groups.ts: Local workspace and chat adapter transforming Electron workspace registries and chat metadata into generic summaries for organizeSidebar.
  • renderer/components/sidebar-organize-menu.tsx: Radio-group menu components for View, Sort chats, and Sort workspaces with contextual conditional visibility based on the active view.
  • renderer/components/chat-sidebar.tsx: Integrates the organized projection, binds drag-and-drop and Move up/down workspace reordering, connects shortcut assignments to visual rows, and persists user preferences.
  • renderer/components/ui.tsx: Adds accessible DropdownMenuRadioGroup and DropdownMenuRadioItem primitives wrapping Radix UI.
  • renderer/lib/sidebar-organization.test.ts & renderer/components/sidebar-organize-menu.test.tsx: Comprehensive unit tests covering tiers, ties, stale keys, search, display rows, move helpers, preference migration, and DOM menu semantics.
  • tests/e2e/chat-shell-interactions.spec.ts: End-to-end specs validating dynamic Needs Attention triage under pushed activity snapshots and manual reordering via keyboard and drag across app reloads.

Findings

No findings.

📊 Sequence Diagram
sequenceDiagram
    autonumber
    actor User
    participant Menu as SidebarOrganizeMenu
    participant Sidebar as ChatSidebar
    participant Projection as sidebar-organization
    participant Shortcuts as sidebar-chat-shortcuts
    participant Storage as localStorage

    User->>Menu: Select view or sort option
    Menu->>Sidebar: onViewChange / onSortChange
    Sidebar->>Projection: organizeSidebar(projects, chats, search, view, sorts, order)
    Projection-->>Sidebar: SidebarOrganization (projectGroups, chatSections, projectOrder)
    Sidebar->>Projection: displayedSidebarChats(organized, view, displayOptions)
    Projection-->>Sidebar: Displayed chat rows in visual order
    Sidebar->>Shortcuts: createSidebarChatShortcutAssignments(shortcutGroups)
    Shortcuts-->>Sidebar: Register ⌘1–9 bindings to active rows
    Sidebar->>Storage: serializeSidebarPreferences(sanitized)
Loading

Machine-Readable Findings

[]

Last reviewed commit: 96849c269809
Reviews (1) · Comment /hermes review to trigger a new review · /hermes review full for full re-review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The new Created sort changes the target of “Open latest chat,” so that action can open an inactive conversation instead of the workspace’s most recently active one.

Reviewed changes: Reviewed the complete local sidebar organization implementation, its preference migration, navigation integration, and test coverage.

  • Views and ordering: Adds Needs attention tiers, configurable chat/workspace sorts, and a pure host-qualified projection with a local workspace adapter.
  • Manual organization: Adds workspace header drag/drop and keyboard-accessible Move up/down actions, with search and boundary restrictions.
  • Preferences and navigation: Migrates existing sidebar preferences, persists bounded manual order, and makes chat shortcuts follow displayed rows.
  • Menu and coverage: Adds labelled radio menu primitives, behavioral projection/adapter/menu tests, two Electron interaction specs, CI registration, and plan documentation.

Local validation passed: test:sidebar (58 tests), test:ci-policy (47 tests), application type-check, and E2E type-check. Playwright collected both new specs; Electron interactions were not executed locally during this review, and hosted CI was still pending when inspected.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment thread renderer/components/chat-sidebar.tsx Resolved
"Open latest chat" took the first displayed row, so the Created sort sent
it to the newest-created chat instead of the most recently active one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes: Reviewed 54093f7d since the prior review at ab4c76fa, with the full PR diff as context.

  • Decoupled latest-chat selection: Changed “Open latest chat” to select the most recently active conversation independently of the sidebar display sort, without changing row order.
  • Added behavioral coverage: Verified differing creation/activity orders under both chat sorts, an undated conversation, and an empty workspace.

Local validation passed: npm run test:sidebar (59 tests) and npm run type-check. The earlier review thread is resolved. Electron interaction tests were not run locally in this Linux environment; the hosted verify check reports success on the current head.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

…ar-organize

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sambitcreate
sambitcreate merged commit 56955a1 into main Oct 4, 2026
24 checks passed
@sambitcreate
sambitcreate deleted the feat/multi-host-sidebar-organize branch October 4, 2026 20:40
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.

2 participants