Introduction¶
When handling long conversations or performing multi-branch debugging in DeepSeek Harness, the scroll positioning and branch relationships in the main chat window can often feel scattered. This plugin provides two panels — “Session History” and “Branch View” — in the right sidebar, allowing you to browse the current session’s turn list, jump to any position, filter user messages, and view the branch tree across all sessions, all without altering the main window.
What It Is¶
- Purpose: A DSH right-sidebar plugin for viewing the current session’s chat history and branch relationships.
- Maintainer: pokereva.
- Category: Client-side.
- Version: 1.0.13 (MIT License).
- Problem Solved: Eliminates the need to repeatedly scroll through long conversations and lose context; in multi-branch scenarios, provides an intuitive view of session forking relationships, with support for jumping, filtering, pinning, drag-to-reorder, and archived session display.
Installation & Activation¶
Add it via the official plugin install command:
dsh plugin add github:pokereva/dsh-session-history-ui
After installation, go to the right sidebar of any session (the sidebar button in the top-right corner) and switch to the “Session History” tab to start using it.
History¶
The “History” panel lists the current session’s user messages and AI reply summaries by turn.
- Jump to Position: Click any entry, and the main chat window will scroll to the corresponding position with the user prompt for that turn pinned to the top (16px from the top edge). If the turn hasn’t been loaded yet, it will first call
session.loadThrough(seq)to page through the history to the target turn, then scroll into position. After positioning, the user prompt bubble will flash with a soft blue glow for 0.5 seconds to indicate “you’re here.” - Current Turn Highlight: Whichever turn the main chat window is scrolled to, the corresponding entry in the history list will display a 2px blue border and a light blue background, so you always know which part of the conversation you’re viewing.
- Ctrl+F Search: Press
Ctrl+F(or⌘Fon macOS) to open the “Session History” in the right sidebar and bring up a search bar. It supports three scopes: All, AI Replies, and User Messages. Matched text is highlighted in the list, and each time you cycle to the next match, the main chat window also scrolls to that turn. - Filter User Messages: There’s a filter input box above the history list. By default, it filters out continuation messages like “continue” or “continue task” after task interruptions. It supports multiple conditions (separated by commas or line breaks) and wildcards:
?(matches a single character) and*(matches any characters). Filtering only matches user messages — records won’t be hidden just because an AI reply happens to match a condition. Filter conditions are stored inlocalStorageunder the keydsh.session-history.filters.v1. Below the input box, a small hint reads “Filter user messages, separate with English commas, x entries filtered” along with a wildcard description. Two checkboxes are also provided: “Filter Duplicates” and “Filter Scheduled Tasks.” - History Defaults to Latest: When you open “History,” the list scrolls to the bottom (the latest turn) by default. If you manually scroll up, it won’t yank you back down; once you scroll back to the bottom, it automatically resumes following new entries.
- Turn Context Menu: Right-click any turn in “History” to open a turn action menu: Branch before this turn, Branch at this turn, Copy (entire turn / user prompt / AI reply), Hide this turn. After a branch operation creates a new session, it automatically switches to it; a notification is shown on failure. Menu items reflect availability based on the current turn: the first turn can’t “Branch before this,” and Copy/Hide are disabled when there’s no text.
- Filter Duplicates: When checked, turns with an identical user prompt are deduplicated — only the last occurrence is kept (comparison ignores leading/trailing whitespace and collapses consecutive whitespace). Earlier duplicate turns are hidden, and the “x entries filtered” counter includes these duplicates. The checkbox state is stored in
localStorageunderdsh.session-history.dedupe.v1. - Filter Scheduled Tasks: When checked, automated turns injected with
source.kind = scheduleare hidden. State is stored inlocalStorageunderdsh.session-history.hideScheduled.v1. - Automated Task Markers: The plugin reads the event window for each turn, identifies non-human-injected turns, and replaces “(No text)” in the list with “Automated Task HH:mm” (the time is taken from the local timestamp of the first event in that turn).
- Auto-switch When Current Session Is Archived: The plugin remembers the order of recently opened sessions. If the currently open session gets archived (DSH clears the main view, leaving a blank page), the plugin automatically opens the most recent session that still exists and isn’t archived, showing a notification: “Current session archived. Switched to previous session automatically.”
Branch View¶
The “Branch View” panel displays all current sessions (excluding sub-agent sessions) as a “branch tree.”
- Branch Tree Display: Regular sessions are roots, and sessions created via “Branch in New Conversation” appear as child nodes, rendered with tree-structure connectors like
├─/└─/│, annotated with “branched from …”. Click any session to switch to it directly. - Context Menu: Right-clicking a session opens the same session context menu as the session list (rename, fork, copy Session ID, archive, etc., including menu items contributed by other plugins).
- Archived Sessions: At the bottom of the branch tree there’s a horizontal divider line with a “Show archived sessions” checkbox. When checked, archived sessions are listed below the line in most-recently-updated order, with greyed-out titles and an “Archived” badge. Left-clicking an archived session does nothing; right-click an archived row and select “Unarchive,” then the plugin automatically opens that session after the unarchive completes, showing a “Unarchived and opened session” notification. The checkbox state is stored in
localStorageunderdsh.session-history.showArchived.v1. - Current Session Highlight & Positioning: The current session in “Branch View” gets the same 2px blue border as the current turn in “History.” When it scrolls out of the visible area, a floating pill labeled “↑ Current Session” or “↓ Current Session” appears above or below the list. Clicking it scrolls the current session back to center and re-measures its position.
- Panel-level Pinning: Right-click a session in “Branch View” and select “Pin Session” — this only pins the session within this panel (pinned sessions appear at the top of the list with a “Pinned” badge) and does not affect pinning in the left workspace list. Select “Unpin” to restore. Pinned records are stored in
localStorageunderdsh.session-history.pinned.v1. - Drag to Reorder: Sessions in “Branch View” can be reordered by dragging. The order is stored in
localStorageunderdsh.session-history.order.v1. Pinned sessions are always fixed at the top and cannot be dragged relative to non-pinned sessions. While dragging over a row, a blue line appears at the top or bottom edge of that row (similar to the left workspace), indicating the insertion point where the item will be placed on release. - Running / Completed Indicators: Sessions that are thinking or generating output display the same spinning indicator (a rotating ring + a breathing arc). Sessions where AI output has completed but hasn’t been viewed yet show a green dot with the title displayed in yellow.
- Automatic Branch Recording: When you click “Branch in New Conversation” in any session (main or branch), the plugin records the parent-child relationship (
childId,parentId, fork pointatSeq, timestamp). Records are stored inlocalStorageunderdsh.session-history.branches.v1. - Deletion Sync: When a session is deleted, it disappears from the “Branch View” list. The corresponding branch record is also automatically cleaned up once the session list is ready.
- Historical Branch Inference: For branches created before this plugin was installed, DSH’s standard fork does not persist the parent session, so there’s no directly reusable record. The plugin makes two best-effort restoration attempts: it first uses
parentSessionIdif the Host is still returning it; otherwise, if the session title matches DSH’s branch naming pattern<parent title> (n), it attaches it under the existing session with the parent title. Inferred relationships are marked “(Inferred)” and may fail to resolve if the title was changed or the parent session was deleted.
Typical Usage¶
- Open the right sidebar of any session (the sidebar button in the top-right corner), find the “Session History” entry in the tools tab, and click to open it.
- At the top of the panel there are two buttons: History / Branch View, used to switch between the two views.
- Use “Branch in New Conversation” on an AI message in the chat window, then open “Branch View” to see the new branch.
Implementation Notes (Brief)¶
- Pure client-side plugin:
index.jsis an empty Host-side module (export function apply() {}); all logic lives inclient.js. - Registers a right sidebar tab via
ctx.sidebarRightTabs.register+ctx.slots.register({ name: 'sidebar.right.pane.tab' }). - History data comes from the Host’s
turnOutlineprojection (provided by@deepseek-ai/dsh-session-turn-outline). - Branch relationships are recorded by wrapping
ctx.sessions.forkon the client side; since DSH’s standard fork doesn’t persist parent session info, this is the only layer where it can be captured. - The tree connectors in the branch tree are generated during a depth-first traversal in
buildBranchRows. Each node pushes whether it has a “next sibling” onto a stack; child nodes use this to build their│prefix, then close with├─or└─. - Left-clicks on archived sessions are ignored. Right-clicking an archived row in this panel leaves a “pending open intent.” The plugin subscribes to
ctx.workspaces.list, and once the session disappears fromarchivedSessionIds, it opens the session and shows a success notification. - Archived sessions use a separate
buildArchivedRowsfunction, which only picks up non-sub-agent sessions inarchivedSessionIds(fromctx.workspaces.list) that have a real title, sorted byupdatedAtdescending, laid out flat below the branch tree. Archived rows do not participate in pinning, dragging, or branch tree parent-child relationships. - Drag-to-reorder uses the HTML5 Drag & Drop API. On drop, the current display order is written back to
dsh.session-history.order.v1. The blue insertion line during drag is drawn using::before/::afterpseudo-elements. - Running / completed status comes from
ctx.uiSession.sessionStatus(completionUnread/running). The completed dot uses the theme variable--dsw-alias-state-success-primary. The running spinner is implemented by the plugin itself using SVG + CSS keyframes, colored with--dsw-alias-label-tertiary, and rotation is stopped underprefers-reduced-motion. - The “previous session” fallback subscribes to
ctx.sessions.list, maintaining a stack of the last 20 main-view sessions. When the main-view session is archived and the main view is cleared, the most recent session in the stack that still exists and isn’t archived is opened. - Auto-scroll-to-bottom in History uses a ref to track whether the view is “stuck to bottom” (within 24px of the bottom edge). After the projected turn count, filter conditions, or session changes, if still stuck to bottom,
scrollTopis set toscrollHeight. Once the user scrolls up, auto-follow stops. - Current turn highlighting listens to
scrollevents at the document capture phase, throttled withrequestAnimationFrame, and picks the turn at the top of the viewport by matching[data-chat-turn]rows. - Jump-to-position doesn’t call Chat’s internal navigation directly. Instead, it calculates the user prompt row’s position, applies a 16px top offset, and bypasses Chat’s “follow bottom” re-anchoring mechanism.
Use Cases & Notes¶
- Who It’s For: DSH users who need to frequently jump around in long conversations, view branch relationships, filter duplicates or automated turns.
- Note: The plugin runs with the current DSH process’s permissions. It’s recommended to review the source code and license (MIT) before installing.
- Ecosystem Context: DSH’s philosophy is “everything is a plugin.” The community directory (SkillHub) is an independent site with no official affiliation with DeepSeek or High-Flyer.
Conclusion¶
This plugin centralizes scattered conversation turns and branch relationships through the “Session History” and “Branch View” panels in the right sidebar, supporting jumping, filtering, pinning, drag-to-reorder, and archive management — ideal for scenarios requiring fine-grained control over conversation flow and branch structure.
- Directory Page: https://www.skillhub.cn/plugins/pokereva/dsh-session-history-ui
- GitHub: https://github.com/pokereva/dsh-session-history-ui