Skip to content

Commit 7b00f1f

Browse files
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@pymodel/pythinker-code': minor
3+
---
4+
5+
Add word-wrap and line-number toggles to every code block and diff block in the web chat.

.changeset/web-message-folding.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@pymodel/pythinker-code': minor
3+
---
4+
5+
Add a Message folding settings section that turns off auto-folded turns and the tool call summary row.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@pymodel/pythinker-code': patch
3+
---
4+
5+
Resize the web panels with the arrow keys, and show the description for a question's free-text answer.

.changeset/web-subagent-panel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@pymodel/pythinker-code': patch
3+
---
4+
5+
Show a subagent's originating prompt above its transcript, centre the transcript, and add a Back to bottom shortcut.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@pymodel/pythinker-code': minor
3+
---
4+
5+
Move a running Bash command or foreground subagent to the background from its row in the web chat.

.changeset/web-ui-fixes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@pymodel/pythinker-code': patch
3+
---
4+
5+
Recover from a crashed view instead of a blank screen, name a cancelled sign-in, keep the composer toolbar readable at very narrow widths, and stop the sidebar settings label from pushing the footer row.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"sourceHash": "e6fc28927badd164b21beb1a6062a6469618d97c34e823eaea23cbbb24594b6d",
3-
"sourceFileCount": 405
2+
"sourceHash": "94836c566a254baa2f20df81ee4f4b6d4b3e864d5b745ae52520e51cdf8edd38",
3+
"sourceFileCount": 407
44
}

apps/pythinker-code/dist-web/assets/CodeBlockNode-BWayTGpE.js renamed to apps/pythinker-code/dist-web/assets/CodeBlockNode-CkWGOoPy.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/DesignSystemView-U5edWnzl.js renamed to apps/pythinker-code/dist-web/assets/DesignSystemView-CawZlySe.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/Tooltip-D-x_6nZf.js renamed to apps/pythinker-code/dist-web/assets/Tooltip-DZgmUg0c.js

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

Comments
 (0)