[Hermes][Fork UI Recovery][hermes-fork-ui-features-port-v0182][1/n] Restore live context, bulk actions, and fluid drag - #283
Merged
Conversation
Re-authors PR NousResearch#43661 onto current main. Since the original PR, the sidebar session section was extracted into sessions-section.tsx and the row into the primitive chrome (SidebarRowShell/Body/Grab/Lead), so the original section and row edits no longer applied; this rebuilds the feature on the current shape. Native drag-and-drop for sidebar session rows: drag a row body onto Pinned to pin it, drag a pinned row onto Sessions to unpin, and drag within either section to reorder — with a live motion.div FLIP preview that animates the row shuffle before the drop commits. The grab-handle dnd-kit reorder is retained alongside. - inline-refs: the session drag payload carries pinId + pinned, plus a pinned-marker MIME so dragover can filter by pin-state before the payload is readable at drop. - use-session-drop-zone (new): hook + helpers — anchor resolution with a dead-band hysteresis, preview splicing, and pin/unpin/reorder drop handling. - session-row: the row body is the native drag source with a stable data-session-id hit-test anchor, wrapping a motion.div layout="position" visual so rects stay put while the preview animates. - sessions-section / virtual-session-list: thread the drag callbacks and the drop-zone frame (dropActive highlight + handlers) through the extracted section. - index: pinned/sessions drop zones wired to pinSession(id, index) and the flat session-order store; sessionByAnyId, messaging, and recents counts now account for pinned rows the sections no longer render. pinSession(id, index) replaces the original PR's undefined reorderPinnedSession: insertUniqueId already filters an existing pin out before re-inserting at the given index, so one call serves both pin and pin-reorder. Drag interactions can't be exercised headlessly; typecheck, build, lint, and the 21 drop-zone unit tests are green. Drag-to-pin/unpin/reorder and the FLIP animation need manual QA in the running app. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
OmarB97
added a commit
that referenced
this pull request
Jul 20, 2026
…estore live context, bulk actions, and fluid drag (#283) * fix(desktop): restore live session context and bulk archive * feat(desktop): refine sidebar session drag reordering Re-authors PR NousResearch#43661 onto current main. Since the original PR, the sidebar session section was extracted into sessions-section.tsx and the row into the primitive chrome (SidebarRowShell/Body/Grab/Lead), so the original section and row edits no longer applied; this rebuilds the feature on the current shape. Native drag-and-drop for sidebar session rows: drag a row body onto Pinned to pin it, drag a pinned row onto Sessions to unpin, and drag within either section to reorder — with a live motion.div FLIP preview that animates the row shuffle before the drop commits. The grab-handle dnd-kit reorder is retained alongside. - inline-refs: the session drag payload carries pinId + pinned, plus a pinned-marker MIME so dragover can filter by pin-state before the payload is readable at drop. - use-session-drop-zone (new): hook + helpers — anchor resolution with a dead-band hysteresis, preview splicing, and pin/unpin/reorder drop handling. - session-row: the row body is the native drag source with a stable data-session-id hit-test anchor, wrapping a motion.div layout="position" visual so rects stay put while the preview animates. - sessions-section / virtual-session-list: thread the drag callbacks and the drop-zone frame (dropActive highlight + handlers) through the extracted section. - index: pinned/sessions drop zones wired to pinSession(id, index) and the flat session-order store; sessionByAnyId, messaging, and recents counts now account for pinned rows the sections no longer render. pinSession(id, index) replaces the original PR's undefined reorderPinnedSession: insertUniqueId already filters an existing pin out before re-inserting at the given index, so one call serves both pin and pin-reorder. Drag interactions can't be exercised headlessly; typecheck, build, lint, and the 21 drop-zone unit tests are green. Drag-to-pin/unpin/reorder and the FLIP animation need manual QA in the running app. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * style(desktop): satisfy restored feature lint * style(desktop): fix named import order * fix(desktop): restore packaged sidebar drag activation * fix(desktop): restore continuous cross-section session drag * fix(desktop): persist the rendered drag preview * fix(desktop): commit sidebar drag on physical release * fix(desktop): retain context usage between turns * fix(desktop): honor persisted sidebar row order * fix(desktop): ignore the active row during drop collision * fix(desktop): preserve context window on warm resume * fix(desktop): stabilize cross-lane drop anchors * fix(desktop): retain session order through sidebar load * fix(desktop): settle session drops at pointer release * fix(desktop): restore session multi-select and reliable compress * fix(desktop): repair bulk archive and session drag feel * fix(desktop): persist profile session archives --------- Co-authored-by: Omar Baradei <omar@kostudios.io> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The v0.18.2 fork rebase dropped or disconnected several established Hermes Desktop behaviors: live per-session context usage, bulk session operations, reliable
/compress, and natural cross-lane session reordering. Follow-up installed builds restored most of the surface, but bulk archive still crashed because two Python methods shared the same name, while drag previews applied both dnd-kit and Motion transforms to the same rows. That left the installed app with a nonfunctional archive action and a sluggish, visually imprecise drag response.What changed
/compressauto-interrupt and bounded busy retry behavior.How to review
apps/desktop/src/lib/token-usage.ts,apps/desktop/src/app/session/hooks/use-session-state-cache.tsx, and the status-bar hook for the focused-session context contract.apps/desktop/src/app/chat/sidebar/shared-session-dnd.ts,reorderable-list.tsx, andsession-row.tsxtogether; dnd-kit owns only the active row's pointer transform and Motion owns sibling slot transitions.apps/desktop/src/store/sidebar-selection.ts,selection-action-bar.tsx, and the session bulk action modules as one multi-row workflow.hermes_state.py::archive_session_idsand its lineage resolver beside the endpoint and transaction regression tests./compress.Evidence
Archive all: confirmation checked 18 visible sessions, toast reportedArchived 18 sessions, SQLite reportedarchived=1 | count=18, and all rows remained absent after reload.Archived 2 sessions; SQLite showed those two archived and the third still unarchived./Applications/Hermes.app: idle context switched from131.3k/200k [66%]to16k/131.1k [12%], then New session removed the meter on the first rendered frame.file:///Applications/Hermes.app/...page, no blocking dialog, originalmeshboard-operatorprofile restored, and zero console/log entries at the final audit.codesign --verify --deep --strict; the replaced build is retained as a timestamped rollback bundle.Verification
scripts/run_tests.sh tests/test_hermes_state.py -q: 357/357 tests.scripts/run_tests.sh tests/hermes_cli/test_web_server.py -q -k 'archive or bulk': 17/17 selected tests.npm run typecheck --workspace apps/desktop.npm run lint --workspace apps/desktop -- --quiet.python -m py_compile hermes_state.py.10ba19459ebaaba260ee4ae8087b44cbca93dd73and installed successfully.Risks / gaps
~/.hermes/hermes-agent; the installed runtime therefore received the exact testedhermes_state.pypatch as well as the signed Desktop bundle. Existing unrelated local edits inhermes_cli/inventory.pyandtui_gateway/server.pywere preserved.release/native dependency suites; the changed interaction paths have focused source tests plus packaged-app end-to-end proof.Collaborators
Participants:
ko-macko-macProcess:
Task context:
hermes-fork-ui-features-port-v0182hermes-desktop-fork-feature-recovery-20260616Related work:
a1d7990e20through10ba19459eHermes-05d11c0e5f-20260714-203000.app