Fix trajectory viewer showing wrong trajectory name in header#160
Merged
khaliqgant merged 5 commits intomainfrom Jan 12, 2026
Merged
Fix trajectory viewer showing wrong trajectory name in header#160khaliqgant merged 5 commits intomainfrom
khaliqgant merged 5 commits intomainfrom
Conversation
When clicking on a trajectory in the history list, the header was showing the currently active trajectory's name instead of the selected trajectory's name. This made it appear as if the wrong trajectory was opened. Fix: Look up the selected trajectory's title from the history array and use it in the header. Falls back to active trajectory task name or "Trajectories" for the list view. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 My Senior Dev — Analysis Complete👤 For @khaliqgant📁 Expert in View your contributor analytics → 📊 11 files reviewed • 1 high risk • 1 need attention 🚨 High Risk:
🚀 Open Interactive Review →The full interface unlocks features not available in GitHub:
💬 Chat here: 📖 View all 12 personas & slash commandsYou can interact with me by mentioning In PR comments or on any line of code:
Slash commands:
AI Personas (mention to get their perspective):
For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews. |
1. Initial fetch effect now only runs once on mount instead of on every refresh change. This prevents racing with the selection change effect. 2. Set loading state immediately when selecting a trajectory to avoid flash of empty state before the fetch effect runs. These fixes address: - Double-click requirement to open a trajectory - Potential race conditions between multiple effects 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The react-hooks/exhaustive-deps rule is not configured in this project's eslint setup. Changed to include refresh in deps array with hasInitializedRef guard to ensure single execution. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- context-compaction.ts: prefix unused punctuationChars with _ - context-compaction.test.ts: remove unused CompactionConfig import - server.ts: remove unused SendPayload import - enhanced-features.ts: remove unused CompiledPatterns import - consensus.ts: prefix unused totalWeight with _ - consensus.test.ts: remove unused ConsensusConfig import, prefix unused p1 with _ - agent-signing.ts: remove unused KeyObject import, prefix unused keyId with _ - agent-signing.test.ts: remove unused AgentKeyPair import 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The previous fix renamed totalWeight to _totalWeight in destructuring, but the type definition still used totalWeight. Simply omit it from destructuring since it's not used in the function body. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <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.
Summary
Root Cause
The
agentNameprop was always set totrajectoryStatus?.task, which is the currently active trajectory's task, not the selected trajectory's title.Fix
Added a
useMemoto look up the selected trajectory's title from thetrajectoryHistoryarray, and use that in the header when a trajectory is selected.Test plan
🤖 Generated with Claude Code