Sidebar projects and conversations

Complete sidebar contract

The reference screenshots specify pin/unpin, editing the display name and icon, custom sections, revealing folders, creating a persistent worktree, archiving project chats, and removing a project. The edit dialog supports source folders. OpenProgram also provides opening project settings and starting a new project conversation. Removing a project hides its navigation entry while retaining registry metadata, session ownership, files and conversation content. The Projects page restores hidden entries; reopening the folder also restores it. The default home project cannot be removed.

Project ordering is independent from conversation ordering. Recent activity sorts by the newest timestamp of any conversation in the project; oldest activity and alphabetical ordering are also available. Pinned projects appear in a separate top-level Pinned list above Projects. Both lists use the same section-header typography and indentation, have independent collapse state, and contain each project once. Custom sections remain manageable peer lists; an empty Pinned list is omitted. The Projects header remains available for filtering even when empty. Dragging selects manual order and retains all hidden projects. Conversation sorting has explicit ascending and descending directions. Preferences survive reload and synchronize between windows.

Sidebar visibility

The sidebar displays only projects with visible, non-archived conversations, including pinned projects. Empty projects and projects whose conversations are all archived are omitted. Project registration, project selection, management, archived content and stored ordering remain intact. Archiving the last conversation hides its project; restoring a conversation makes it eligible again.

Implementation plan

  1. Activity-based project order, conversation sort direction, and persistent project pins; preserve dragging.
  2. Project context menu and editable metadata, icons, sections and source folders using validated registry mutations.
  3. Folder reveal, persistent worktree creation, archive-all and non-destructive removal; integrate project opening.
  4. Complete entry-point tests, specification and quality review, build, background deployment and requirement-by-requirement audit.

Completion requires all four items. An implemented ordering option alone does not satisfy the full sidebar objective.

Project headers support pointer-based drag and drop. The dragged project group follows the pointer vertically. Neighboring groups shift smoothly to preview the resulting order, using the same Motion spring as Favorite Programs (stiffness 600, damping 40). There is no insertion line or separate project-name preview. Reduced motion removes the spring transition. Sessions move with their project. Alt+ArrowUp and Alt+ArrowDown provide keyboard ordering.

Dragging Project B upward shifts Project A downward; releasing saves the new order.

Current behavior and choices

The registry owns membership. The projectGroups join preserves registry ownership while applying the selected project sort and pins. Conversation sorting remains independent. Favorite Programs supplies the drag interaction reference: the dragged row moves continuously and neighboring rows shift to make room. Pointer capture, a six-pixel movement threshold, and explicit release/cancel handling require no dependency; project dragging also changes its section and pinned placement to match the destination. Session ownership never changes.

Project metadata and sections

The registry stores the display name, a plain-text icon or emoji, a description, and additional source folders. Updates validate supported fields, lengths and absolute existing directories, then replace the registry atomically under its lock. Editing metadata never changes the main folder or session membership. Main-folder relocation remains the existing project-settings operation. Additional source folders become defaults when a chat has no explicit folder configuration; a deliberately empty per-chat list stays empty. Project updates notify all connected windows. Custom sections and project placement are local view preferences; removing a section returns its projects to the default section.

Project rows expose the same menu through right-click and the ellipsis button, with keyboard navigation provided by the shared menu component. Project settings and the sidebar share one metadata editor. Save failures retain form input and show the error. Empty projects are omitted from the sidebar; empty custom sections remain manageable.

Project operations

Folder reveal uses the existing platform file-manager action. Permanent worktrees start from the source HEAD on a new user-named branch and an absolute destination outside the actual source Git checkout. Git validates the branch and destination. A repeat request recognizes the exact existing worktree and registers it instead of creating another one. The source checkout and uncommitted files stay unchanged. Archive-all persists each chat before broadcasting its update and reports failures with the completed IDs. Removal only sets a hidden registry flag; hidden ownership remains intact and history remains accessible through date/flat grouping. Project filters use registry IDs so display-name edits do not break filtering.

Project pin control

Pin and unpin are available in the project context menu, opened by right-click or the options button. Project rows do not show a separate pin button. The context-menu pin control uses the shared PinIcon from animated-icons, with the same controlled AnimatedNavIconHandle interface as other sidebar icons. The menu item drives animation on hover and keyboard focus, then returns it to rest on leave or blur. The icon uses the official Lucide Pin glyph because the pqoqubbw/icons catalog has no Pin component, following the existing MonitorIcon fallback. It reuses the shared FolderOpenIcon animation; no SVG path or per-caller rotation is authored. The new-chat and options controls share one project-action class: 20px square targets, 5px corners, zero padding, centered 14px icons and the same neutral hover background. The two controls form one compact group with a 2px internal gap, while the existing spacing between the project name, action group and collapse chevron remains unchanged. Their bounds and icon centers stay aligned while the menu is open. Explicit pixel dimensions avoid differences caused by the application’s 14px root font size. The standard 2px icon stroke and neutral color remain consistent. Reduced-motion users receive a static icon. Labels, pressed state, pin/unpin behavior, list placement and persistence remain unchanged.

Sidebar context menus

Desktop project and conversation menus use Electron Menu.popup, which provides native macOS presentation. Menu coordinates come from the invocation point in CSS pixels, converted using the renderer zoom factor; keyboard invocation uses the focused control. The Web fallback uses the same invocation point with viewport collision handling. Existing actions and confirmations are retained. The native bridge accepts bounded plain menu descriptions from the owning shell frame and returns only a selected action ID after dismissal. Cancellation, renderer navigation, unmounting and window destruction close the owned request and clear transient feedback. Native menu failures fall back to the Web menu. The implementation follows Electron Menu documentation; it does not copy a screenshot as a custom macOS skin.

Conversation menu feedback

Opening a conversation menu from its options button or by right-click keeps the conversation row and options button on their existing neutral hover backgrounds while the menu is open, including when the pointer moves into the menu. Closing the menu clears this temporary feedback; a selected conversation retains its normal selected background. Project options already retain their menu-open background. No glow, extra shadow, or new selection state is added.

Project row feedback

Project headers use the neutral hover background only while the pointer is over the row or its context menu is open. Clicking, keyboard activation, draft creation, and conversation changes do not persist project-row selection. Closing the menu clears its temporary background when the pointer is outside the row. Collapse, project membership, drag behavior, and keyboard focus remain unchanged.

Project settings interaction finish

The project settings editor uses the application Input and Textarea primitives. Its focused field has a thin accent border and a soft outer glow; the accent follows the active theme. The dialog has a restrained accent edge, and icon choices show a persistent selected state. The project options trigger stays visible while its menu or editor is open, without a separate glow; the whole project row retains its background only while the menu is open. Menu hover and keyboard focus share the same feedback. The editor header previews the selected icon; folder paths wrap without displacing removal controls. Opening and interaction transitions settle quickly, and reduced-motion mode disables added transitions.

Use the existing system font and theme tokens: dark surfaces #191918 and #252523, bright text #f0efea, muted text from the theme, and the configured accent. Light themes use their existing white surfaces and dark text. Content is left-aligned, labels are 13px, fields use the shared 10px corner scale, and the editor fits narrow screens with a scrollable body. Verification covers the real project menu entry, computed focus and selected styles, light/dark and reduced-motion rendering, cancellation, and unchanged save payloads. Global dialog content and overlays sit above the narrow-screen sidebars so project settings and its folder picker remain visible. This shared stacking correction preserves existing dialog interactions. Unrelated forms retain their current visual treatment.

Moved folders

Projects retain identity through a portable marker in the working folder. Bounded discovery and explicit Locate preserve session ownership. See Project location design for the current contract and acceptance status.

State and boundaries

A project ID array in the existing recents view preference stores the order locally. Unknown IDs are ignored; new projects follow the existing fallback sort. Hidden projects retain their order when another project moves. Storage events synchronize windows. Invalid persisted arrays fall back to the default order. Storage failures keep the visible order for the current window and announce that persistence failed.

Acceptance

Through the Projects sidebar, dragging upward or downward changes order only on drop. Escape or a drop outside the list leaves order unchanged. Reload retains order. Collapse, new-session buttons, membership and filters retain their behavior. Keyboard moves keep focus and announce the result.

Implementation status

Pointer drag ordering has passed focused tests and independent reviews. The complete sidebar contract is implemented. Activity ordering, conversation direction and pins pass focused tests and both independent reviews; the context menu, metadata and source-folder editor and sections pass both independent reviews. Worktree creation, folder reveal, archive-all, reversible project removal and registry-ID filtering pass specification and quality reviews. The integrated Web unit gate and affected project backend checks pass. Project settings focus, active menu states, icon selection, light and dark themes, reduced motion and narrow-screen layout pass rendered acceptance. TypeScript, accessibility, project picker, date buckets, WS action routing and documentation links pass. Foreground UI acceptance is excluded by the user's instruction; background event and integration checks provide the permitted verification evidence.