Commit 7b00f1f
authored
feat(web): code block toggles, move-to-background, subagent panel prompt, and UI fixes (#238)
## Related Issue
No issue. Web design reconciliation, the first step of the plan tracked
in `tasks/todo.md` (design port + subagent routing UI).
## Problem
The web UI was behind the current design baseline on a bounded set of
behaviors: code blocks had no word-wrap or line-number toggles, a
running Bash command or subagent could not be moved to the background
from its row (the gateway already supported `POST
/sessions/{sid}/tasks/{tid}:detach`), the subagent detail panel showed
no originating prompt and had no "back to bottom" shortcut, a crashed
view rendered a blank screen, the composer toolbar overflowed at very
narrow widths, panels could not be resized from the keyboard, and the
question card did not show the free-text option's description that the
protocol already delivers.
## What changed
- Code blocks and diff blocks: word-wrap and line-number toggles
(`aria-pressed`, i18n labels); line numbers are CSS counters inside the
shadow root with a gutter sized from the digit count; selection colours
use new `--color-code-selection*` tokens (light, dark, system-dark).
- Move to background: a detach button on the running Bash row and on the
running Agent card, gated by a `resolveDetachableTask` predicate (a
running, not-yet-background REST task for that tool call); `detachTask`
in the API client and workspace state (lists tasks first when the store
has none yet); `tools.agent.status.*` and `tasks.toBackground` strings.
- Subagent panel: originating prompt bubble with a `6lh` clamp and
expand pill, centred transcript column, "Back to bottom" pill; the
bespoke copy dropdown is gone (the shared turn list owns copying).
- Fixes: `ErrorBoundary` + `AsyncLoadFailed` (retry / try again),
"Sign-in cancelled" title on the cancelled sign-in phase, composer
toolbar valve grows from 2 to 4 stages driven by a real collision probe,
sidebar footer account side truncates instead of pushing the row.
- Message folding settings section (`Auto-fold messages`, `Tool call
summary`) persisted like the other UI settings and applied by the
conversation pane.
- Keyboard-operable `ResizeHandle` (`aria-valuenow`, arrows, Shift for a
larger step); question card "Other" row shows `otherDescription`.
- Not in this PR (architecture rewrites, decided separately):
ProseMirror composer/attachment pills, select-text →
comment/add-to-chat, and the right-panel tab shell. No remote-control
dialog, account footer row, or `cancelled` tool glyph exists here, so
those sub-rows have no counterpart.
- `dist-web` rebuilt from source.
Every row has a test that fails on the previous code:
`markdown-code-block.test.ts`, `task-detach.test.ts`,
`workspace-state.test.ts`, `agent-detail-panel.test.ts`,
`error-boundary.test.ts`, `codex-signin-denied.test.ts`,
`composer-toolbar.test.ts`, `resize-and-question.test.ts`,
`settings-ui.test.ts`, `chat-turn-rendering.test.ts`,
`model-display.test.ts`.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [ ] I have linked a related issue (external PRs: the issue must have a
maintainer's `/approve`).
- [x] I have added tests that prove my feature works.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Customize code blocks with word wrapping and line-number visibility.
- Configure automatic message and activity folding.
- Move running Bash commands and foreground subagents to the background.
- Resize panels using keyboard arrow controls.
- View question descriptions and originating prompts in subagent panels.
- Copy transcripts directly and return to the conversation bottom.
- **Bug Fixes**
- Improved narrow-width toolbar readability and sidebar labels.
- Added recovery options for crashed or failed views.
- Clarified cancelled sign-in status.
- **Accessibility**
- Added keyboard focus support, ARIA sizing information, and clearer
status labels.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent a60a427 commit 7b00f1f
148 files changed
Lines changed: 3732 additions & 1392 deletions
File tree
- .changeset
- apps
- pythinker-code/dist-web
- assets
- pythinker-web
- src
- api
- daemon
- components
- chat
- tool-calls
- settings
- ui
- composables
- client
- i18n/locales/en
- lib
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments