feat(web): add independent session header Agent icon toggle - #1704
feat(web): add independent session header Agent icon toggle#1704techotaku39 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Findings
-
[Major] Existing
agent: falsepreferences are migrated to icon-on - before this change, that setting hid both Agent text and its icon. Stored values from current users do not containagentIcon, so the newtruefallback silently restores the icon in session headers and share previews. Evidence:web/src/hooks/useSessionHeaderMetadata.ts:21.Suggested fix:
if (typeof record.agentIcon !== 'boolean' && typeof record.agent === 'boolean') { record.agentIcon = record.agent }
Also cover
parseSessionHeaderMetadata(JSON.stringify({ agent: false }))and assert that both Agent fields remain disabled.
Summary
- Review mode: initial
- One Major persisted-preference migration regression found in the full latest diff.
Testing
- Not run (automation; PR code was not executed). GitHub CI had passed typecheck and selected E2E tests at review time; the full test job was still running, and the CLI integration job was failing with logs unavailable until workflow completion.
HAPI Bot
| export const DEFAULT_SESSION_HEADER_METADATA: SessionHeaderMetadataPreferences = { | ||
| showLabels: true, | ||
| agent: true, | ||
| agentIcon: true, |
There was a problem hiding this comment.
[MAJOR] Preserve the previous Agent visibility choice during migration
Before this key existed, agent: false hid both the text and icon. Existing localStorage records therefore contain agent: false but no agentIcon; the generic fallback now resolves the missing key to true, so those users unexpectedly get an icon in both the session header and shared images.
Suggested fix:
const record = parsed as Record<string, unknown>
if (typeof record.agentIcon !== 'boolean' && typeof record.agent === 'boolean') {
record.agentIcon = record.agent
}Then add a regression assertion:
expect(
parseSessionHeaderMetadata(JSON.stringify({ agent: false }))
).toMatchObject({ agent: false, agentIcon: false })There was a problem hiding this comment.
Findings
- None.
Summary
Review mode: follow-up after new commits
- The prior Major preference-migration issue is resolved by deriving a missing
agentIconvalue from the storedagentvalue. - No new findings above the 80% confidence threshold in the full latest diff.
- Residual risk: CI validation is incomplete at review time; the main test job is still running, and the failed integration job log is unavailable until the workflow completes.
Testing
- Not run (automation; PR code was not executed).
HAPI Bot
Summary
Agent icondisplay preference.Agentpreference for controlling Agent type text.Problem / Motivation
The session header previously used one
Agentpreference to control both the Agent type text and its icon. Users could not display the icon without also displaying the Agent type.Validation
bun typecheck— passed across CLI, Web, Hub, and Relay.bun run test:web -- src/components/SessionHeader.test.tsx src/components/AgentFlavorIcon.test.tsx src/lib/shareTurnMetadata.test.ts src/routes/settings/index.test.tsx— 55/55 passed.Invoke-HapiTaskPlaywright.ps1 -Name investigate-session-header-agent-icon -Suite Root terminal-wrap-fidelity.spec.ts— 2/2 passed.Invoke-HapiTaskPlaywright.ps1 -Name investigate-session-header-agent-icon -Suite Root share-turn.spec.ts— 14/14 passed.bun run build— passed.Related Issues
None
AI Disclosure
AI-assisted implementation using OpenAI Codex (GPT-5.6).