GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(web): copied inline code keeps meaningful edge spaces by StiensWout · Pull Request #36712 · pingdotgg/t3code Conversation
Contributor
Copying rendered inline code with meaningful spaces on both edges loses those spaces when the copied Markdown is parsed again. Pad those code spans according to CommonMark, preserving the existing backtick and all-space behavior. Small fast-lane fix: a private serializer rule and its existing parser/serializer contract tests. No rendering change. The shared copy path covers rendered user and assistant Markdown in web and desktop; native mobile has no equivalent DOM selection serializer. No provider, RPC, authorization, connection-mode, or lifecycle changes. Found by the clipboard bughunt (GPT 6.1 Sol), independently confirmed on main by Claude Opus 5.5, and reproduced again on main Validation:
Council review
No blockers. Opus suggested a mixed space/backtick test row as a nit; left out after trim because it repeats the same padding path. An unconfirmed empty-CODE selection edge is outside this fix. No separate proof audit in the fast lane. Third-party paste targets and the OS clipboard were not tested. Created with GPT 6.1 Sol (lead and review), Claude Opus 5.5 (independent verifier, builder, trim and review), and Grok 4.7 (evidence), in T3 Code through the Codex, Claude and Grok harnesses. Closes #36711
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsCo-authored-by: Claude Opus 5.5 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: GPT 6.1 Sol <[email protected]> Co-authored-by: Grok 4.7 <[email protected]>
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Inline-code padding and round-trip tests apps/web/src/markdown-clipboard.ts, apps/web/src/markdown-clipboard.test.ts |
wrapInlineCode adds padding for values with meaningful leading and trailing spaces. Tests cover serialization and parsing for values with edge spaces, backticks, and spaces only. |
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers: juliusmarminge, tsapa44
6942eCopying rendered inline code that has meaningful leading and trailing spaces now keeps those spaces when the Markdown is pasted and parsed again. Rendering is unchanged and the change is limited to the clipboard serializer. No merge-blocking risk is evident.
Explanation
The title names the fix and the affected area (copied inline code, meaningful edge spaces, web package), which matches the changeset: wrapInlineCode now pads code spans with edge spaces so the parsed value keeps its spaces. It is a conventional commit title in plain language, and it is specific enough for a teammate scanning history.
Explanation
The description covers the problem (copied inline code loses meaningful edge spaces on re-parse), the change (padding per CommonMark, existing backtick and all-space behavior kept), scope (small fix, linked issue #36711, no provider or RPC changes), and verification (focused test run, scenario proof, browser panel check, check:changed). It follows the template's section intent. Minor gaps: the Scope section does not explicitly describe the bug-report link beyond the closing line, and the Verification section lists results without a screenshot. The template's UI screenshot rule does not apply because the change has no rendering change.
Explanation
Issue #36711 requires that copied inline code with meaningful edge spaces keeps its parsed value when the copied Markdown is parsed again. The reviewed diff of apps/web/src/markdown-clipboard.ts adds spaceEdges, which is true when the code starts and ends with a space and contains a non-space character. The pad then becomes one space on each side, so a value of " value " serializes as " value ". CommonMark strips one edge space from each side of such content, so the parsed value is " value ". The existing backtick-edge padding is unchanged. All-space content gets no new padding, so the all-space behavior is preserved. The added parameterized tests in apps/web/src/markdown-clipboard.test.ts cover backtick edges, surrounding spaces, and spaces only through serialize-parse round trips. The author reports the paired-space round trip fails on base and passes at head. I did not inspect the test file directly, so test results rest on the PR summary and the author's validation report. No unmet coding requirement is identified.
Explanation
The whole-PR changes are limited to two files. apps/web/src/markdown-clipboard.ts changes only the pad computation in wrapInlineCode, with a comment. apps/web/src/markdown-clipboard.test.ts adds 18 lines of tests for the same serializer contract. The code fence construction is unchanged. The PR description reports no rendering, provider, RPC, authorization, connection-mode, or lifecycle changes. Every change connects directly to issue #36711, so no out-of-scope change is identified.
4cf8169d-7e02-4dbd-bafa-454c4602e135apps/web/src/markdown-clipboard.test.tsapps/web/src/markdown-clipboard.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
EvidenceReal web app, Chromium, 1280×800, light theme, fresh synthetic data and replay provider on both commits. Send Use
Scenario source · Runner configuration with clipboard grants
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…36712) Co-authored-by: Grok 4.7 <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit 666631e)
…ltas (#453) * feat(native): port #444 Part B Sidebar, Thread & Transcript parity deltas Port all remaining Sidebar, Thread View, and Transcript parity deltas from upstream `4121b30..80cf4f7` and flip `TV-LINEAGE` and `TR-WORK` to `done` in `apps/native/parity/LEDGER.md`. Sidebar (`SB-ROW`, `SB-SECTIONS`, `SB-MENU`, `SB-UNDO`, `SB-SEARCH`, `SB-GROUPING`): - Regenerating title glimmer (`pingdotgg#29383`) - Settle-undo position restore via `plan_undo_for_thread` + `UnsettleRestore`/`ReorderActive` (`pingdotgg#33248`) - Clear opened failed badge in sidebar rows and collapsed folder dots (`pingdotgg#28616`) - Suppress `Done` badge for stopped/interrupted/cancelled runs (`pingdotgg#37475`) - 1h snooze clock-minute rounding (`pingdotgg#36785`) - Opening a delegated task selects its listed parent ancestor (`pingdotgg#37500`) - Side-chat children included in worktree deletion check (`pingdotgg#36800`) - Failed message search error state in sidebar search and command palette (`pingdotgg#38155`) - Jump-hint modifier recheck after hold delay (`pingdotgg#38545`) - Command palette `Failed` status pill prioritized over background `Waiting` (`pingdotgg#38968`) Thread & Transcript (`TV-HISTORY`, `TV-LINEAGE`, `TV-FOLLOW`, `TR-WORK`, `TR-MARKDOWN`, `TR-CITE`, `TR-MCPAPP`): - Subagent history model preservation via `merge_older_subagents` (`pingdotgg#38724`) and hide Resume when `supportsNativeResume` is false without an unsent continuation source (`pingdotgg#39229`) - Cancel active smooth scroll in `keep_end` so finished-while-away threads open at end (`pingdotgg#38963`) - MCP PR/CI work-log rows & summaries (`pingdotgg#26751`, `pingdotgg#26752`) and Windows `pwsh`/`powershell`/`cmd` launcher unwrapping (`pingdotgg#38946`) - Leading-space user markdown preservation (`pingdotgg#38079`), RTL `<details>` and template cards (`pingdotgg#36876`, `pingdotgg#36922`), `Cite` on `send_to_user` rows (`pingdotgg#36858`), home/host paths out of workspace folder (`pingdotgg#39146`), and code/list/email copy serialization fixes (`pingdotgg#36712`, `pingdotgg#36830`, `pingdotgg#36867`, `pingdotgg#36915`, `pingdotgg#37284`, `pingdotgg#39150`) - MCP app content-block filtering for stripped images (`pingdotgg#31338`), teardown generation race test (`pingdotgg#30387`), and pre-query/fragment download filename derivation (`pingdotgg#30712`) * fix(native): address PR #453 review findings Address all 3 review findings from `@d1-reviewer` (`pingdotgg#847`): 1. Remove unwired DOM-HTML Markdown re-serialization helpers (`wrap_inline_code`, `serialize_markdown_anchor`, `escape_markdown_prose`, `ListCopyItem`, `serialize_list_slice`) from `crates/core/src/markdown/clipboard.rs` and update `TR-MARKDOWN` in `apps/native/parity/LEDGER.md` accurately. 2. Add `restore_preserved_leading_whitespace` and wire `user_markdown_view` with a `Copy` (`Cmd+C`) action interceptor (`crates/app/src/transcript/markdown.rs`, `messages.rs`) so user-message Copy and Cite restore ASCII spaces/tabs while preserving literal user-typed NBSPs (`pingdotgg#38079`), verified by GPUI test `user_markdown_copy_restores_leading_spaces_and_preserves_literal_nbsp`. 3. Fetch omitted family side chats via `fetch_family_side_chats` alongside `ORCHESTRATION_GET_WORKTREE_THREAD_IDS` in `delete_thread_then` (`crates/app/src/sidebar/controller.rs`, `pingdotgg#36800`) before calling `has_other_worktree_occupants`, verified by GPUI test `worktree_cleanup_prompt_excludes_omitted_family_side_chats` (and fixed `late_teardown_does_not_close_replacement_host` under `--features snapshot` in `transcript/mcp_app.rs`).
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[Bug]: Copied inline code loses meaningful edge spaces
There was an error while loading. Please reload this page.