Files
AgentHub/docs/plans/workspace-redesign/00-rename-lane-to-workspace.md
T
nntrivi2001 a6bd33bcff feat: workspaces own their sessions; desktop parity; sidebar and settings cleanup
Workspace sessions (docs/plans/desktop-parity, phases 1-5 and 7):
- sessions.lane_id: a workspace lists only the sessions its panes held,
  stamped by bindRunSession (first writer wins, nested `claude -p`
  excluded); GET /api/sessions?lane=&archived=
- session row state dot, double-click rename, archive (sessions.archived_at,
  hides only); the activity bar's duplicate Sessions tab removed
- Fork beside Resume (--fork-session, Claude only), Ctrl/Cmd+click a live
  session opens it in a second pane, a diff line's comment is pasted into
  the workspace's last-focused pane (lib/panePaste.ts)

dashboard_runs stability:
- a pane's previous run is archived as <pane>@<started_at> instead of being
  overwritten by INSERT OR REPLACE
- a run is flagged abandoned only once its tmux session is gone, at boot and
  on the run-heal beat (panes outlive a server restart)

UI:
- sidebar: no footer, language or theme block; small collapse button in the
  brand corner; version + update check in the connection details modal, a
  status-bar dot while a release is out; language in Settings -> General
- one Switch component for every switch, the themed Checkbox for every
  checkbox (no native checkboxes)

Also: AI Tools catalog trimmed to 10 built-ins (custom-file prompt modes
tested through fixtures), and the workspace plans under docs/plans/ (the
multi-user server plan lives in the AgentHub-Server repo).
2026-10-02 13:19:50 +07:00

63 lines
4.3 KiB
Markdown

# Phase 0 — Call lanes "workspaces" in the UI and docs
_One PR. No behaviour change, no identifier change. Every test that passed
before passes after; only copy and snapshots differ._
## Goal
The **word** a user reads changes: "Lane" → "Workspace", "Lanes" →
"Workspaces", "Add lane" → "Add workspace", "lane strip" → "workspace list",
and so on — in the dashboard UI (both languages), in the docs, in CLI *help
and output text*, and in the plugin's skill/command prose.
## What does NOT change
Everything that is an identifier stays exactly as it is:
- API paths and payload keys: `/api/lanes`, `{ lanes, counts }`, `lane_id`, …
- WebSocket message types `lane` / `lanes`.
- CLI commands and flags: `agenthub lanes add|up|down|…`, `agenthub stage --lane 3`.
- Env vars: `AGENTHUB_LANE_ID`, `LANES_ROOT`, `LANE_DEAD_SEC`, …
- Error codes (`EBADLANE`, …), tmux session names `agenthub-lane-<id>`.
- SQLite tables/columns (`lanes`, `lane_features`, `lane_stage_events`).
- Source file, component, hook, type and function names (`LaneCard.tsx`,
`LaneChangesPanel`, `useLaneGitFacts`, `listLanes`, `Lane` type, …),
`data-testid` values, localStorage keys, i18n **namespace file name**
`lanes.json` and its **keys**.
Rationale: a rename of identifiers touches ~200 files and every running
install's tmux panes, hooks and bookmarks, for no user-visible gain. The
user-visible gain is the word, so only the word changes.
## Where the word changes
| Surface | Action |
| --- | --- |
| `client/src/i18n/locales/en/*.json`, `…/vi/*.json` | Replace the English word in **values** (not keys): `"Lane"→"Workspace"`, `"lane"→"workspace"`, `"Lanes"→"Workspaces"`, plural/possessive forms. Vietnamese values: "lane"/"làn" → "workspace" (the Vietnamese UI already uses the English loanword "Workspace" in `nav.json`; keep that). Check `lanes.json`, `nav.json`, `settings.json` (`lanesSection.title` = "Workspaces"), `run.json`, `dashboard.json`, `kanban.json`, `errors.json`, `splash.json`. |
| Hardcoded UI strings | `grep -rn -i '\blanes\?\b' client/src --include=*.tsx` — any string literal rendered to the user that escaped i18n is moved into i18n with the new word (do not leave it hardcoded). Code comments and identifiers are left alone. |
| CLI output and help (`bin/agenthub.js`) | Prose in `console.log`/`console.error`/usage strings: "lane" → "workspace" in the sentence, while the command names in those same sentences stay literal: e.g. `no workspace owns <cwd> — create one with: agenthub lanes add --cwd <cwd>`. |
| Docs | `docs/LANES.md`: keep the file name (it is linked from many places and from `CLAUDE.md`), retitle to "Workspaces (lanes)" and open with one paragraph: *"A workspace — called a lane in the API, CLI, database and code — is …"*. Then use "workspace" in prose throughout, keeping every literal command/route/field as is. Same treatment in `README.md`, `docs/API.md`, `docs/CLI.md`, `docs/DATABASE.md`, `docs/HOOKS.md`, `client/README.md`, `server/README.md`, `docs/PLUGINS.md`. |
| `CLAUDE.md` | The "## Lanes" heading becomes "## Workspaces (lanes)"; the first bullet gains the one-sentence glossary above; every rule keeps its literal identifiers. Bump the sync marker. |
| Plugin skills/commands (`skills/*`, `plugins/agenthub/commands/*`) | Prose only. |
| Server-side user-facing text | Error `message` strings that reach the UI (e.g. `"lane not found"`): change the word, keep the `code`. Log lines may stay. |
## Order of work
1. i18n values (en, vi) + any escaped literals → `npm run test:client`, review
the snapshot diff (copy only), regenerate.
2. CLI strings → `npm run test:server` (`lanes-cli.test.js` asserts some
output text; update those assertions).
3. Server error messages → server suite.
4. Docs + `CLAUDE.md` + skills prose.
## Acceptance
- Opening every page of the dashboard in EN and VI shows no "lane" (walk:
Dashboard, Sessions, Workflows, Workspace incl. Add modal / destructive
modals / Changes panel / run form, Settings incl. every tool tab).
- `agenthub lanes` (no args) and `agenthub help` print "workspace" in prose
and `lanes` as the command.
- `git diff --stat` shows no renamed files, no changes to `server/routes/`
paths, `client/src/lib/api.ts` or `client/src/lib/types.ts`.
- Headers check, both suites, snapshots regenerated once.