feat(#89): System Prompt UX — provider grouping, prompt badge, bidirectional navigation#93
Merged
Conversation
…warning Server: - Add `provider` field to versionIndex (anthropic.js, openai.js, restore.js) - Broadcast `toolsHash` via SSE (sse-broadcast.js) - Add `provider` + `sessionCount` to /_api/sysprompt/versions - New /_api/tools-diff endpoint for comparing tool sets between turns - Add `provider` to version_detected SSE event Dashboard (Solution 1): - Prompt badge in timeline showing agent + coreHash + provider dot - Tools-changed warning with cache miss indicator - Expandable tools diff (compare added/removed tools) - Subagent turns show gray badge, not clickable System Prompt page (Solutions 2 & 3): - Agent list grouped by provider (Claude Code / Codex / Other) - Sorted by version count desc within groups - Session count per version with expandable session list - URL deep-link support (?agent=X&hash=Y) Data analysis: sysHash changes 100%/turn (noise), toolsHash 2% (cache nuke), coreHash 0.15% (CC version). Only coreHash displayed as stable identifier. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
P1: lazy-fetch coreHash→agentLabel map from /_api/sysprompt/versions
so prompt badge shows "Orchestrator"/"Explorer" instead of "claude"/"codex".
P2: add agent field to allEntries.push() — badge no longer shows "Unknown".
P5: add cwd field to allEntries.push() — project name no longer shows "?".
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
P3: badge onclick sets ?agent=X&hash=Y URL params before switching
to sysprompt tab, so openSystemPromptPanel resolves the correct
agent and version.
P7: link text changed from "→ prompt" to "View in System Prompt".
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
P4: cross-tab switchTab now uses pushState instead of replaceState,
so Back button returns to the previous tab instead of exiting.
popstate listener restores tab state on Back/Forward.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
P6: renderPromptBadgeHtml was only called in non-focused timeline
(preview mode). Now also renders in focused split-pane mode.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dlScript used escaped double quotes inside onclick="..." which broke the HTML attribute. Switch to single quotes in the inline JS. Co-Authored-By: Claude Opus 4.6 (1M context) <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.
摘要
System Prompt 頁面重新設計 + Dashboard↔System Prompt 的完整雙向導航鏈。
Badge 顯示真正的 agent type(Orchestrator/Explorer),點擊可 deep-link 到對應版本,Back 鍵能正確回來。
Changes
Server (4 files)
provider,agentKey,agentLabelper prompt versiontoolsHashfor tools-changed detection/_api/sysprompt/versions: returnssessionCount,provider,agents[]with provider info/_api/tools-diff: new endpoint — given two toolsHash values, returns added/removed tool namesDashboard (4 files)
● Orchestrator · 63cc1 View in System PromptcoreHash→agentLabellazy-fetched map (notentry.agent)?agent=X&hash=YURL params for deep-linktoolsHashwith previous main turn in same session; fetches diff on expandallEntries: now storesagent,cwdfields (fixes "Unknown" badge and "?" project name)System Prompt tab (1 file)
?agent=X&hash=Yfrom URL to auto-select agent and version_hashAgentMapsync: updates the badge's agent map when versions are fetchedNavigation (2 files)
replaceState(avoids per-turn history pollution)Deliberate simplifications
Agent map lazy fetch:
_hashAgentMapis seeded on firstrenderPromptBadgeHtmlcall. First frame may briefly showentry.agent("claude") before the map loads; subsequent SSE re-renders show the correct label. No prefetch needed — the flash is imperceptible.pushState only on cross-tab: Tab-internal turn/section selection uses
replaceState. This matches Chrome DevTools / VS Code / Grafana behavior — Back should return to the previous view, not step through 47 turns.Inline onclick for deep-link: The badge onclick sets two URL params + calls
switchTab. This is the terminal state — no additional params or conditional branches are expected. Event delegation would add 15 lines of glue for zero behavioral gain.Test plan
test/sysprompt-ux.test.js)CCXRAY_HOME=~/.ccxray --port 5615)Closes #89
🤖 Generated with Claude Code