97140168d8
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
6.1 KiB
6.1 KiB
id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
| id | title | status | wave | depends_on | plan | requirements | acceptance_criteria | system_design | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02-agent-column-presentation | Present compatibility states with translated copy | done | 2 |
|
plan.md |
|
|
|
Task 02: Present compatibility states with translated copy
Summary
Render the agent column and the footer's disabled reason from
agentCompatState. Keep the selector visible whenever a compatible profile
exists, add truthful notes for unavailable and incompatible selections, and add
the copy in every locale.
In scope
AgentColumnintask-create-dialog-form-body.tsxbranches per the presentation table; extract anIncompatibleAgentNotecomponent carryingdata-testid="agent-profile-incompatible-note"and the credentials link, plus an unavailable-selection note.buildFormBodyPropsintask-create-dialog-prop-builders.tsforwardsagentCompatState,selectedAgentProfileName, andeffectiveWorkflowName; extendDialogFormBodyPropsandCreateEditSelectorsProps.task-create-dialog-footer.tsx: addREASON_SELECTED_AGENT_INCOMPATIBLE, addREASON_SELECTED_AGENT_UNAVAILABLE, and resolve both state-specific reasons with the agent name.- Locale keys
agentNotConfiguredOnExecutor,workflowAgentNotConfiguredOnExecutor,selectedAgentNotConfiguredFor,selectedAgentProfileFallback,selectedAgentProfileFallbackInline, andselectedAgentProfileUnavailablein every locale. - Component and footer tests listed under Verification.
Out of scope
- State derivation and the autopick (Task 01).
- Playwright coverage (Task 03).
- The new-session dialog's own empty state.
Acceptance
- In the
selected-incompatiblestate without a workflow lock,CreateEditSelectorsrenders the agent selector and the note, and does not renderagent-profile-empty-state. - In the
selected-incompatiblestate with a workflow lock, the note names the workflow, the agent profile, and the executor profile, links to/settings/executors/<id>, and no selector is rendered. computeDisabledReasonreturnsREASON_SELECTED_AGENT_INCOMPATIBLEforselected-incompatible,REASON_SELECTED_AGENT_UNAVAILABLEforselected-unavailable, andREASON_NO_COMPATIBLE_AGENTfornone-compatible;pnpm run i18n:checkpasses with the new keys.
Verification
Write the failing component test first (selector plus note in the unlocked incompatible state). Confirm it fails before the production change, then run:
# From apps/web:
pnpm exec vitest run components/task-create-dialog-form-body.test.tsx components/task-create-dialog-footer.test.ts components/task-create-dialog-prop-builders.test.ts
pnpm run i18n:check
pnpm run typecheck
pnpm exec eslint --max-warnings 0 components/task-create-dialog-form-body.tsx components/task-create-dialog-footer.tsx components/task-create-dialog-prop-builders.ts components/task-create-dialog-types.ts
Files likely touched
apps/web/components/task-create-dialog-form-body.tsxapps/web/components/task-create-dialog-form-body.test.tsxapps/web/components/task-create-dialog-prop-builders.tsapps/web/components/task-create-dialog-prop-builders.test.tsapps/web/components/task-create-dialog-footer.tsxapps/web/components/task-create-dialog-footer.test.tsapps/web/components/task-create-dialog-types.tsapps/web/src/locales/{en,pt-pt,zh-cn,zh-hk,zh-tw,pseudo}/task.json
Dependencies
Task 01.
Risks
AgentColumnis close to the 100-line function cap. Extract the note and the state switch into small components rather than growing the function.- The i18n ratchet rejects any literal string on a changed line. Route every
new string, including the note's link label, through
t(). - Do not use the Unicode em dash in the new copy; the existing footer key uses an arrow, which the check allows.
Parallelism
sequential
Inputs
- System design section "Presentation" and "Mobile composition".
- Existing
NoCompatibleAgentStatemarkup and theCreateEditSelectorstest. docs/i18n.mdfor the locale workflow.
Results
AgentColumnbranches onagentCompatState; the newIncompatibleAgentNote(agent-profile-incompatible-note) renders under the selector in the unlocked case and replaces it in the workflow-locked case, naming workflow, agent, and executor. The hardcoded "this executor" fallback now resolves throughtask:thisExecutor.DialogFormBodyProps,CreateEditSelectorsProps, andCreateModeSelectorsPropscarryagentCompatState,selectedAgentProfileName, andeffectiveWorkflowName;buildFormBodyPropsresolves the workflow name through the newresolveWorkflowNamehelper.- Footer:
REASON_SELECTED_AGENT_INCOMPATIBLE(task:selectedAgentNotConfiguredFor) for the selected-incompatible state in both start-task and session-default paths;resolveDisabledReasontakes the agent name. - Locale keys
agentNotConfiguredOnExecutor,workflowAgentNotConfiguredOnExecutor,selectedAgentNotConfiguredFor, andselectedAgentProfileFallbackadded to en, pt-pt, zh-cn; zh-hk and zh-tw values taken frompnpm run i18n:zh-hantoutput (the converter also rewrote unrelated keys in 21 files, which were reverted); pseudo regenerated. - RED: 7 tests failed (missing helper, footer key, component states). GREEN:
pnpm exec vitest runon form-body, footer, prop-builders plus the Task 01 files, dialog and setup tests: 7 files, 116 tests passed.pnpm run i18n:check: all checks pass.pnpm run typecheck: clean.pnpm exec eslint --max-warnings 0on the six production files and five test files: clean.
Follow-up verification added the unavailable-selection note, state-specific footer reason, and separate inline fallback copy. All six locale catalogs pass the i18n checks.