Skip to content

fix(web): escape formatting at composer boundaries - #295

Merged
lastobelus merged 1 commit into
lastcode/mainfrom
lastcode/composer-mark-boundaries
Oct 6, 2026
Merged

lastobelus merged 1 commit into
lastcode/mainfrom
lastcode/composer-mark-boundaries

Conversation

@lastobelus

@lastobelus lastobelus commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Moving the caret away from formatted text and back to its end makes subsequent typing inherit that formatting. For example, **b** followed by line-start/line-end navigation and plain becomes **b plain**. The earlier fix in #251 reset typing marks only after paste; moving the caret discarded that reset.

Replace the paste-specific helper with a small rich composer extension. Caret placement, paste, cut, and history restoration follow the text to the right, or type plain at a line end. Normal typing and explicit formatting shortcuts retain inclusive marks. The upstream diff touches the shared composer only to import and register the extension; the LastCode change belongs to upstream-bugfixes and records the superseded paste-only fix.

Validation: 106 focused tests pass in both the LastCode branch and the clean upstream branch, plus targeted lint. An isolated real-client pass verifies cursor placement, focused paste, paste-to-focus, and sustained Cmd+I typing. This applies to the shared web/desktop rich composer; the native mobile editor and provider/server paths are unchanged.

Upstream contribution: pingdotgg#13518.

Before: **b plain** after placing the caret at line start and line end.

Before

After: **b** plain using the same caret placements.

After

Short before/after recording. The baseline disables only the new plugin; the recording uses editor selection commands for caret placement. Native Meta-arrow dispatch in the preview tool did not reliably move the caret.

Implemented by GPT-6.1-Sol (xhigh) through Codex in T3 Code, with design input from GPT-6-Astra High and Claude Opus 5.5 High.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T03:42:34.024672Z ada9e07 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 17c3245f7a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus force-pushed the lastcode/composer-mark-boundaries branch from 17c3245 to f7154d2 Compare October 6, 2026 03:34
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

Replace the paste-only typing mark reset with a standalone rich composer extension. Placing the caret follows the text on its right or types plain at a line end; paste, cut, and history restoration use the same rule. Normal edits and explicit formatting continue using inclusive marks.

Carry-Group: upstream-bugfixes
Carry-Upstream: pingdotgg#13518 (head cc1d991)
Carry-Supersedes: #251 (paste-only typing mark reset)
Carry-Observation: Clipboard cut follows the same boundary rule as paste; real drops select their inserted content and use the later caret-placement rule. Caret movement clears ProseMirror stored marks and reintroduces implicit formatting. Keep inclusive schemas for sustained formatting shortcuts; isolate the boundary policy in an extension to reduce shared composer carry conflicts.
@lastobelus
lastobelus force-pushed the lastcode/composer-mark-boundaries branch from f7154d2 to ada9e07 Compare October 6, 2026 03:37
@lastobelus

Copy link
Copy Markdown
Owner Author

Local review completed for ada9e07db9cd97ef63e4ecd483cd1e00b95cd153:

  • GPT-6-Astra High, three implementation rounds: first clean; second found a cut test that did not exercise the fix; third clean after correction.
  • Claude Opus 5.5 High, one implementation review: added cut handling and removed a redundant drop branch/test. Both findings addressed.
  • The cut regression now models Tiptap's deleteRange transaction. Disabling the cut trigger makes it fail with **b plain**; restoring the trigger yields **b** plain.
  • 106 focused tests pass in both the LastCode and clean upstream branches, plus targeted lint. The extension and tests are identical between branches. The isolated real client also confirms paste, caret placement, sustained Cmd+I typing, and cut continuation.

The real-client recording uses editor caret-placement commands because the preview tool's native Meta-arrow dispatch did not reliably move the caret. GitHub CI and a fresh Codex review remain required on this final head before the LastCode merge.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: f7154d25e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: ada9e07db9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit effb851 into lastcode/main Oct 6, 2026
17 checks passed
@lastobelus
lastobelus deleted the lastcode/composer-mark-boundaries branch October 6, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant