Skip to content

Fix brains-pane review issues and add tests - #597

Merged
selfcontained merged 6 commits into
mainfrom
agt_28905b42b976/brains-fixes
May 23, 2026
Merged

Fix brains-pane review issues and add tests#597
selfcontained merged 6 commits into
mainfrom
agt_28905b42b976/brains-fixes

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Extract encodeRepoRoot/decodeRepoRoot to lib/brain-encoding.ts using TextEncoder/TextDecoder for non-ASCII path safety (previously used raw btoa/atob which breaks on multi-byte chars)
  • Add try/catch around decodeRepoRoot in BrainsDetailPane — malformed URL params now redirect to the overview instead of crashing
  • Add limit: 100 to objects/lists queries in the "All" collection view to prevent unbounded fetches

Tests

  • 6 unit tests for encodeRepoRoot/decodeRepoRoot (ASCII, non-ASCII, emoji, URL-safety, empty string, malformed input)
  • 5 E2E tests for the Automations Brains page (tab navigation, project selection, collection filtering, search, list expansion)

Test plan

  • pnpm run check — type checks pass
  • pnpm run finalize:web — web build passes
  • pnpm vitest run — unit tests pass (6/6)
  • pnpm run test:e2e — E2E suite passes (160/160)
  • Visual validation with seeded data in dev server

🤖 Generated with Claude Code

selfcontainedand others added 6 commits May 21, 2026 23:50
- 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>
@selfcontained
selfcontained merged commit d012dca into mainMay 23, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_28905b42b976/brains-fixes branch May 23, 2026 00:59
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@selfcontained