4.1 KiB
4.1 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-hide-setting-hook-and-toggle | Hide-setting hook and settings-page toggle | done | 1 | plan.md | ../../specs/agents/requirements/hide-disabled-profiles-nav.md |
Task 01: Hide-setting hook and settings-page toggle
Acceptance
useHideDisabledAgentProfilesInNav()returns{ hideDisabled, setHideDisabled };hideDisableddefaults tofalse, istrueonly whenlocalStorage["kandev:agents:hideDisabledInNav:v1"] === "true", persists viasetHideDisabled, reacts to thekandev:agents:hide-disabled-in-nav-changedcustom event and thestorageevent, degrades tofalseon a read error, and throws on a failed write./settings/agentsrenders a "Hide disabled agent profiles from left panel navigation" row (Switch id="hide-disabled-agent-profiles-in-nav") that reflects the hook value and toggles it immediately (no save bar).- The two new locale keys exist in all four catalogs (
en,pseudo,pt-pt,zh-cn) and passi18n:ratchet/i18n:check.
Verification
cd apps && pnpm --filter @kandev/web test -- \
hooks/domains/settings/use-hide-disabled-agent-profiles-in-nav.test.ts \
app/settings/agents/hide-disabled-agent-profiles-setting.test.tsx
cd apps/web && pnpm run typecheck
cd apps/web && pnpm run i18n:ratchet && pnpm run i18n:check
Files likely touched
apps/web/hooks/domains/settings/use-hide-disabled-agent-profiles-in-nav.ts(new)apps/web/hooks/domains/settings/use-hide-disabled-agent-profiles-in-nav.test.ts(new)apps/web/hooks/domains/integrations/local-storage-mock.test-helpers.ts(reuse as-is)apps/web/app/settings/agents/hide-disabled-agent-profiles-setting.tsx(new)apps/web/app/settings/agents/hide-disabled-agent-profiles-setting.test.tsx(new)apps/web/app/settings/agents/page.tsx(render the new row insideAgentProfilesSection, below the "Agent Profiles" header and above the first profile row)apps/web/src/locales/{en,pseudo,pt-pt,zh-cn}/settings.json(two keys each)
Dependencies
None.
Parallelism
Sequential. Tasks 02 and 03 consume the hook contract this task defines.
Inputs
- Spec:
What,Data model,API surface,Failure modes,Persistence guarantees, and the toggle scenarios. - Plan:
Frontend > 1. Hide-setting hookandFrontend > 2. Settings-page toggle. - Existing patterns:
apps/web/hooks/domains/integrations/use-hide-disabled-integrations-in-nav.ts(+ its test),apps/web/components/integrations/integrations-index-page.tsx(theHideDisabledIntegrationsSettingrow),apps/web/app/settings/agents/profile-list-item.tsx(domain-local component placement),apps/web/hooks/domains/settings/use-profile-enabled-toggle.ts(immediate-save page convention).
Risks
- The page is on the whole-file i18n guard list: the new row's copy must use
t()and the exactsettings:keys above; any literal breaksi18n:ratchet. - The new component file lives under
app/settings/agents/**— the guard list covers it, so keep all user-facing strings int(). Switchcheckedmust come from the hook snapshot, andonCheckedChangemust callsetHideDisabled(next)directly — no local state that can desync from the tree filter in task 02.- No em dash (U+2014) in any copy or locale value.
Output contract
Report the hook behavior, files changed, exact commands and results,
blockers/risks, then mark this task done and update its checkbox in
plan.md.
Completion report
- Hook:
useHideDisabledAgentProfilesInNavmatches the integrations hook shape; storage keykandev:agents:hideDisabledInNav:v1, sync eventkandev:agents:hide-disabled-in-nav-changed; degrades tofalseon read errors, throws on failed writes. - Toggle:
HideDisabledAgentProfilesSettingrendered insideAgentProfilesSectionon/settings/agents, below the "Agent Profiles" header and above the first profile row; immediate-save switch#hide-disabled-agent-profiles-in-nav. - Locales: two keys added to
en,pt-pt,zh-cn;pseudoregenerated. - Focused tests: hook 10/10, toggle 3/3;
i18n:ratchet+i18n:checkclean; typecheck clean. - Blockers: none.