Skip to content

fix(desktop): restore pinned drag-reorder (regressed by server-side pins #186) - #189

Merged
Kyzcreig merged 1 commit into
mainfrom
wt/pin-reorder-restore
Jul 3, 2026
Merged

Kyzcreig merged 1 commit into
mainfrom
wt/pin-reorder-restore

Conversation

@Kyzcreig

@Kyzcreig Kyzcreig commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Ace reported pinned sessions can no longer be dragged to reorder after the pin-sync update. Root cause: PR #186 made $pinnedSessionIds a read-only computed atom and dropped setPinnedSessionOrder + the sidebar reorderPinned wiring (hardcoded sortable={false}).

Fix: local $sidebarPinnedOrderIds order atom (mirrors the existing $sidebarSessionOrderIds pattern) layered over the server-synced pin SET via orderByIds. Pin membership syncs across devices (unchanged); visual drag-order is per-device local — reordering on the MacBook won't reshuffle the Studio. Keyed by durable lineage-root pin ids so order survives compression. +test (order independent of pin set). typecheck+eslint+4 layout tests green. Reviewed by Apollo.

The server-side pin PR (#186) made $pinnedSessionIds a read-only computed
atom, which dropped setPinnedSessionOrder + the sidebar's reorderPinned
handler and hardcoded sortable={false} on the pinned list — losing
drag-to-reorder. Restore it with a local $sidebarPinnedOrderIds order atom
(mirrors $sidebarSessionOrderIds) layered over the server-synced pin SET via
orderByIds: pin membership syncs across devices, visual order stays per-device.
Keyed by durable lineage-root pin ids so order survives compression.
@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown

Greptile Summary

This PR restores local drag ordering for pinned sidebar sessions. The main changes are:

  • Adds a persistent local pinned-order store.
  • Layers pinned visual order over the server-synced pin set.
  • Re-enables sortable pinned sessions in the sidebar.
  • Adds a store test for pinned order independence.

Confidence Score: 4/5

The pinned reorder logic looks sound, but the tracked dependency symlinks need to be removed before merging.

  • The sidebar changes follow the existing local-order pattern.
  • The new symlinks point at an author-local absolute path.
  • Fresh checkouts on other machines can start with broken dependency directories.

node_modules, apps/desktop/node_modules, apps/shared/node_modules

Important Files Changed

Filename Overview
apps/desktop/src/app/chat/sidebar/index.tsx Wires local pinned order into pinned session rendering and drag reorder.
apps/desktop/src/store/layout.ts Adds the persistent local pinned-order atom and guarded setter.
apps/desktop/src/store/layout.test.ts Adds coverage for pinned visual order being separate from the synced pin set.
node_modules Adds an absolute symlink to an author-local dependency directory.
apps/desktop/node_modules Adds an absolute symlink inside the desktop workspace package.
apps/shared/node_modules Adds an absolute symlink inside the shared workspace package.

Reviews (1): Last reviewed commit: "fix(desktop): restore pinned drag-reorde..." | Re-trigger Greptile

Comment thread node_modules
@@ -0,0 +1 @@
/Users/alexgierczyk/.hermes/hermes-agent/node_modules No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Absolute Dependency Symlink

This adds a tracked node_modules symlink to /Users/alexgierczyk/.hermes/hermes-agent/node_modules. On a fresh checkout outside that machine, the workspace starts with a broken dependency path, so npm workspace install/build tooling can fail or replace the tracked entry and leave the checkout dirty.

Comment thread apps/desktop/node_modules
@@ -0,0 +1 @@
/Users/alexgierczyk/.hermes/hermes-agent/apps/desktop/node_modules No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Workspace Dependency Symlink

This adds a tracked apps/desktop/node_modules symlink to an absolute path under /Users/alexgierczyk/.hermes/.... On other machines that target is missing, so desktop package scripts that resolve local dependencies can hit a broken workspace dependency directory before install or packaging runs.

Comment thread apps/shared/node_modules
@@ -0,0 +1 @@
/Users/alexgierczyk/.hermes/hermes-agent/apps/shared/node_modules No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Shared Package Symlink

This adds a tracked apps/shared/node_modules symlink to an author-local absolute path. Because apps/desktop depends on @hermes/shared through the workspace, fresh clones can see a broken dependency directory inside the shared package during workspace install or build resolution.

@Kyzcreig
Kyzcreig merged commit 0331692 into main Jul 3, 2026
38 checks passed
@Kyzcreig
Kyzcreig deleted the wt/pin-reorder-restore branch July 3, 2026 23:39
Kyzcreig added a commit that referenced this pull request Jul 10, 2026
PR #189 committed three node_modules SYMLINKS (mode 120000, pointing at
absolute paths on the author's machine). .gitignore already excludes
node_modules/ but tracked files override the ignore. Any CI job that runs
npm ci on a checkout containing them fails ENOTDIR ('npm warn reify
Removing non-directory .../node_modules' then mkdir fails) — first hit by
this PR because it's the first desktop-touching change since #189.

Untrack all three; local installs recreate real directories.
Kyzcreig added a commit that referenced this pull request Jul 10, 2026
…p search (#257)

* feat(search): rank session-title matches above content hits in desktop search

Titles are human-assigned intent (/title on any messaging platform, the
desktop rename action), but session search had no title lane at all:

- Server: /api/sessions/search only matched session IDs + FTS message
  content, so a session titled on Discord that scrolled out of the
  sidebar's loaded window was unfindable by its title from the desktop
  app (unless the words also appeared in message text).
- Client: the sidebar filter matched title/id/preview/cwd equally with
  no ranking — a title hit didn't float above incidental content hits.

Changes:
- hermes_state.SessionDB.search_sessions_by_title(): case-insensitive
  LIKE substring over assigned titles, exact > prefix > substring
  ranking, recency tiebreak, sidebar visibility contract (subagent runs
  and compression children hidden), LIKE wildcards escaped. Plain scan
  by design — sessions is a small table, no FTS index warranted.
- /api/sessions/search: title lane runs after ID matches, before FTS
  content matches; shares the lineage-root dedup keyspace so a title
  hit and a content hit on the same conversation collapse to one
  result. Result payload now carries  for title-lane hits.
- Desktop: SessionSearchResult.title threaded through
  searchResultToSession; sidebar merge ranks title-matching sessions
  first via rankTitleMatchesFirst (stable within groups).

Tests: 6 new SessionDB title-search tests, endpoint title-vs-content
ranking + dedup test, eventloop-affinity fake updated (11 sites), 4 new
vitest cases. Full runs green: 663 pytest, 9 vitest, tsc clean.

* fix(repo): remove accidentally-committed node_modules symlinks

PR #189 committed three node_modules SYMLINKS (mode 120000, pointing at
absolute paths on the author's machine). .gitignore already excludes
node_modules/ but tracked files override the ignore. Any CI job that runs
npm ci on a checkout containing them fails ENOTDIR ('npm warn reify
Removing non-directory .../node_modules' then mkdir fails) — first hit by
this PR because it's the first desktop-touching change since #189.

Untrack all three; local installs recreate real directories.

---------

Co-authored-by: Kyzcreig <9063726+Kyzcreig@users.noreply.github.com>
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.

1 participant