4.7 KiB
4.7 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | ||
|---|---|---|---|---|---|---|---|---|
| 03-status-bar-item | Active-editor status-bar item | completed | 3 |
|
plan.md | ../../specs/platform/requirements/lsp-file-intelligence.md |
Task 03: Active-Editor Status-Bar Item
Acceptance
- On a fine-pointer layout with the application bar enabled and
status_barsaved,builtin:lspreplaces the toolbar trigger and summarizes only the active supported Monaco file's LSP. - Clicking the item opens the same details and lifecycle actions; it participates in existing opaque status-item ordering.
- Loading, static/binary, diff, non-file, and unsupported active panels hide the item, while feature-disabled and coarse-pointer layouts retain the toolbar without rewriting the preference or starting a phone LSP lease.
TDD sequence
- Add failing focused tests for built-in identity/order and active-file summary visibility.
- Add the status item and reusable status trigger/details with the smallest active-editor subscription.
- Add toolbar fallback tests and refactor shared presentation without duplicating lifecycle logic.
Verification
cd apps && pnpm --filter @kandev/web test -- --run components/app-status-bar components/editors lib/lsp/lsp-status-placement.test.ts hooks/use-lsp.test.tsx
cd apps/web && pnpm run typecheck
cd apps/web && pnpm exec eslint components/app-status-bar components/editors hooks/use-lsp.ts lib/lsp
Files likely touched
apps/web/components/app-status-bar/app-status-bar-order.tsapps/web/components/app-status-bar/app-status-items.tsxapps/web/components/app-status-bar/lsp-status-item.tsxapps/web/components/app-status-bar/app-status-bar.test.tsxapps/web/components/app-status-bar/app-status-drawer.test.tsxapps/web/components/editors/lsp-status-button.tsxapps/web/components/editors/monaco/monaco-editor-toolbar.tsxapps/web/lib/lsp/lsp-progress-view.tsapps/web/lib/lsp/lsp-status-placement.tsapps/web/hooks/use-lsp.tsapps/web/lib/state/dockview-store.tsonly if the existing active file identity is insufficient
Dependencies
Tasks 01 and 02.
Parallelism
Sequential. The item consumes both the presentation and persistent placement contracts.
Inputs
- Spec active-file and responsive fallback scenarios.
ConnectionStatusItemandStatusSurfaceMetricsas built-in item patterns.- Existing
activeFilePath/activeFileRepoDockview tracking.
Output contract
Record RED/GREEN evidence, lease/active-editor ownership, responsive behavior, files changed, exact commands, and update this task plus plan.md.
Result
- RED: focused tests failed on the missing
builtin:lspidentity, active-file resolver, compact summary, status item, toolbar suppression, and status-only lifecycle subscriber. - GREEN: 21 focused app-status/editor test files pass 87 tests; the full web typecheck and focused ESLint pass without warnings.
builtin:lspis an opaque, reorderable right-side item derived only from the active session and supported active Monaco file. Unsupported and non-file panels remove it.- The item subscribes to the existing
(session, language)connection without acquiring another lease. Start, Stop, and Retry use a shared request generation consumed by mounted editor leases. - Fine-pointer
status_barplacement suppresses the Monaco toolbar trigger. Feature-disabled and coarse-pointer conditions resolve back to the toolbar without changing the saved preference. - The phone application-status drawer does not construct the LSP item or call the status hook, so it cannot start an invisible lease.
- Review follow-up: the item now also requires an active
file-editorpanel with a loaded text buffer. A supported extension rendered byStaticFilePanelcan no longer expose Start/Retry without a mounted MonacouseLsplease. - RED/GREEN follow-up: the resolver failed the new mounted-editor contract; 34 focused status/store tests now cover loading, Monaco text, binary/static, diff, unsupported, CodeMirror, and responsive drawer boundaries.
- Codex restore follow-up: a session-restored tab placeholder now remains LSP-ineligible until its fetched content receives an explicit text classification. The integration regression failed while the placeholder's missing
isBinaryvalue was treated as text, then passed when status ownership requiredisBinary === false. - CI follow-up: text-file responses omit the false-valued
is_binaryJSON field. The WebSocket file-content boundary now normalizes loaded text tofalsewhile restored placeholders remain unclassified; focused unit/integration tests pass 23 tests, web typecheck and focused ESLint pass, and the production-build Playwright status-placement scenario passes.