Skip to content

gut(ui): strip residual skills* handlers/state/CSS from agents view #2539

@alexey-pelykh

Description

@alexey-pelykh

Summary

After #2521 narrowed the AgentsPanel type union to drop "skills" and stripped the top-level agentSkills* state fields, additional skills-related residue remains in the UI: a nested skills* state block on the host interface, a consumed skillsLabel helper, and a render site that displays the label. The skills subsystem is fully gutted per CLAUDE.md § Fork Context, and none of this residue is behind any user-reachable control after #2520 removed the Tools tab.

Evidence

Residual state fields (host interface)

ui/src/ui/app-view-state.ts carries four skills* fields inside a nested block:

185:    skillsLoading: boolean;
186:    skillsError: string | null;
187:    skillsFilter: string;
190:    skillsBusyKey: string | null;

These are distinct from the top-level agentSkills* fields that #2521 already removed.

Consumer chain

ui/src/ui/views/agents-utils.ts:142:  skillsLabel: string;
ui/src/ui/views/agents-utils.ts:174:    skillsLabel: skillFilter ? `${skillCount} selected` : "all skills",
ui/src/ui/views/agents-panels-status-files.ts:44:          <div>${context.skillsLabel}</div>

The skillsLabel is computed in agents-utils.ts and rendered in agents-panels-status-files.ts:44. With no skills subsystem to label, both are dead.

Reader check

$ rg -n 'skillsLoading|skillsError|skillsFilter|skillsBusyKey' ui/src/ui/app.ts ui/src/ui/app-view-state.ts
ui/src/ui/app-view-state.ts:185: skillsLoading: boolean;
ui/src/ui/app-view-state.ts:186: skillsError: string | null;
ui/src/ui/app-view-state.ts:187: skillsFilter: string;
ui/src/ui/app-view-state.ts:190: skillsBusyKey: string | null;

Declared on the interface but not observed as @state fields on RemoteClawApp or assigned anywhere — matches the pattern that #2521 cleaned up for agentSkills*.

Why this is safe

Read-only orphans with no writer. Removing unread fields is a type-narrowing operation — tsgo will surface any missed consumer. Smoke tests (app.smoke.test.ts, app.computed-style.test.ts) assert required host-interface fields; narrowing the interface removes those assertions automatically.

Changes

  1. Host interface (ui/src/ui/app-view-state.ts:185-190): delete the four skills* fields from the nested block. Re-verify that no @state decorator on RemoteClawApp declares any of them (expected: zero).
  2. Helper (ui/src/ui/views/agents-utils.ts:142): remove skillsLabel from the context type; at line 174, remove the computation. If skillFilter / skillCount inputs become unused after this, remove those too (likely orphaned upstream).
  3. Render site (ui/src/ui/views/agents-panels-status-files.ts:44): delete the <div>${context.skillsLabel}</div> render line. If the surrounding block becomes empty, simplify.
  4. Any remaining orphans: the gut(ui): strip residual skills state + types + i18n #2521 subprocess claimed "~13 CSS rules" residue in the agents view. On current main, rg -n 'skill' ui/src/styles.css returns zero — so either gut(ui): strip residual skills state + types + i18n #2521's sweep already consumed those rules, or they live in a CSS file not in styles.css. During implementation, re-sweep ui/src/**/*.css and any colocated component styles.
  5. Handlers: the gut(ui): strip residual skills state + types + i18n #2521 subprocess mentioned "6 handlers" — rg 'onSkills|loadSkills|skillsStatus' ui/src/ui/ currently returns zero. If implementation discovers any hidden handlers (e.g., via different naming like handleSkill*), remove them; if none exist, note "zero additional handlers found" in the PR.

AC

  • grep -rn 'skillsLoading\|skillsError\|skillsFilter\|skillsBusyKey' ui/src/ returns zero hits
  • grep -rn 'skillsLabel' ui/src/ returns zero hits
  • No @state decorators on RemoteClawApp reference skills*
  • pnpm check green (format + tsgo + oxlint + CSS class drift audit)
  • pnpm test green
  • pnpm test:ui:smoke green

Context

Follow-up to #2521 (gut(ui): strip residual skills state + types + i18n, merged as #2536 / commit 80d311d25a). The #2521 subprocess flagged "adjacent dead weight (6 handlers + 6 skills* state fields + ~13 CSS rules) — candidates for a successor gut wave" as out-of-scope.

Surfaced during batch 20260424-6b79. The counts in #2521's subprocess report were as-of-pre-merge; current-main re-verification (above) found 4 state fields + 3 consumer hits + 0 handlers + 0 CSS rules — scope is narrower than claimed but still real.

Metadata

Metadata

Assignees

Labels

gutRemoving dead upstream subsystems

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions