Fix brains-pane review issues and add tests - #597
Merged
Conversation
- Extract encodeRepoRoot/decodeRepoRoot to lib/brain-encoding.ts and use TextEncoder/TextDecoder for non-ASCII path safety - Add try/catch around decodeRepoRoot in BrainsDetailPane for malformed URL resilience - Add limit:100 to objects/lists queries in the "All" collection view - Add unit tests for encodeRepoRoot/decodeRepoRoot (6 cases) - Add E2E test for Automations Brains page (5 cases: navigation, project selection, collection filtering, search, list expansion) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move card components (ObjectCard, ListCard, EventCard, etc.) into brain-cards.tsx so both the sidebar brain tab and the full brains page share the same rendering. Agent IDs now link to /activity/history/:agentId which uses URL params instead of local state for the detail view. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… repoRoot On mobile the collection pills were truncated — replace with a Select dropdown that shows collection names with counts. Desktop keeps the pills. Also fall back to agent cwd when gitContext.repoRoot is missing so the sidebar brain tab works for agents without git context. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Constrain card content to viewport on narrow screens: add overflow-hidden to card containers, truncate long key-value entries instead of allowing horizontal scroll, and hide agent ID labels below the sm breakpoint where they crowd out timestamps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reduce container padding (px-3 → px-1 on mobile) so that combined with the cards' mx-3 the left and right insets are symmetric and match the header's px-4. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…indicator - Add error/empty state to agent history detail for invalid agent IDs - Show History icon on mobile for agent ID links instead of hiding them - Add "showing first 100" banner when All collections view hits the cap Co-Authored-By: Claude Opus 4.6 <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 freeto 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
encodeRepoRoot/decodeRepoRoottolib/brain-encoding.tsusingTextEncoder/TextDecoderfor non-ASCII path safety (previously used rawbtoa/atobwhich breaks on multi-byte chars)try/catcharounddecodeRepoRootinBrainsDetailPane— malformed URL params now redirect to the overview instead of crashinglimit: 100to objects/lists queries in the "All" collection view to prevent unbounded fetchesTests
encodeRepoRoot/decodeRepoRoot(ASCII, non-ASCII, emoji, URL-safety, empty string, malformed input)Test plan
pnpm run check— type checks passpnpm run finalize:web— web build passespnpm vitest run— unit tests pass (6/6)pnpm run test:e2e— E2E suite passes (160/160)🤖 Generated with Claude Code