# feat\(web\): enable rich text composer by default · PR \#12160 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/12160)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: tiptap-composer-rich-text-setting

Target branch: main

Head commit: d6d6b70857619877a51ef9371e7a5e17c1d08bbd

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/12160)

[Commits](https://git.cafe/pingdotgg/t3code/pull/12160/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/12160/diffs?format=markdown)

## Description

---

The composer used separate editing engines, and switching modes could change drafts or editing behavior. This uses Tiptap for both modes, with rich text enabled by default for inline formatting and task checkboxes. Users can opt out in Settings → General → Rich text composer; explicit saved opt-outs remain off.

Plain mode keeps markdown literal. Rich mode preserves chip sources, task spacing, nesting, clipboard selections, undo, and caret positions while rendering formatting. Task splits use native editor operations so formatting survives. Rich mode canonicalizes equivalent delimiters (`__` to `**`, `_` to `*`, `[X]` to `[x]`).

The takeover removes unused mapping and serialization helpers, shares serialization with marker decorations, and bounds inline parsing depth. Fixes cover nested/overlapping marks, marks spanning chips, paste boundaries, citation timing, selection copying, task splitting, whitespace, IME guards, and chip HTML serialization.

Validation:
- Default-on follow-up: 201 document/settings tests, web/contracts typechecks, and scoped lint passed on Blacksmith. Browser verified missing preference → on, explicit off surviving reload, and reset → on.
- Blacksmith: all eight focused composer/settings test files passed; parser/document/list run passed 83 tests, followed by 70 document tests after the final code-span whitespace fix, including boundary-whitespace and coordinate cases.
- Web and contracts typechecks passed; scoped editor/parser/document lint and unused-export checks passed.
- Real web client connected remotely to an isolated server and Codex: plain and rich prompts sent successfully, including a typed/toggled task checkbox.
- Browser checks covered switching modes with the same draft, nested tasks, file-chip paste/copy, undo, bold task splitting, partial task copy, marked trailing whitespace, native chip clipboard HTML, restoring the caret while the terminal owns focus, and punctuation wrapping with chip protection, and citation comment insertion/save through the app callback.
- Desktop-sized dark mode and 390px light responsive web inspected. Native Electron/mobile clients and other providers were not exercised.

Before switching the setting on, with the same draft:

![plain composer with literal markers and file chip](https://uploads-production-47e4.up.railway.app/files/1085548d-cd53-4819-a32f-2e953ce5576d/browser-screenshot-t3-m64-tailda84d5-ts-net-mu4tlwls-0802d4aa.png)

After switching on, with the same draft selected:

![rich composer with nested task checkboxes and selected file chip](https://uploads-production-47e4.up.railway.app/files/33382488-a07a-48e1-b429-7ce427bbf95c/browser-screenshot-t3-m64-tailda84d5-ts-net-mu4tmms1-48d429a0.png)

Typing a task, toggling it, sending it, and receiving the real Codex response:

![typed checkbox toggled and sent to codex](https://uploads-production-47e4.up.railway.app/files/6b2a53ac-fdef-4170-8feb-5083c138fd02/pr12160-provider.gif)

Switching modes without losing the draft:

![plain draft preserved when rich text is enabled](https://uploads-production-47e4.up.railway.app/files/63fe32c2-bcd8-4921-bf72-3bd791b7f34c/pr12160-setting.gif)

Opting out and restoring the enabled default:

![rich text opt-out and reset to enabled default](https://uploads-production-47e4.up.railway.app/files/65663d15-cee3-4524-861e-a8e832fe53c3/pr12160-default.gif)

The setting description fits on one line at 1280px and 390px. Scoped Blacksmith lint passed (existing warnings only).

![rich text setting description before shortening](https://uploads-production-47e4.up.railway.app/files/096cbd3b-f611-4d9b-895a-dfa4ab44da6c/browser-screenshot-t3-m64-tailda84d5-ts-net-mu4vvdza-d3aaa9c3.png)

![rich text setting description on one line](https://uploads-production-47e4.up.railway.app/files/fde333c3-0bae-4544-9e8d-487d1ab63d8f/browser-screenshot-t3-m64-tailda84d5-ts-net-mu4vx7zk-8e6761ac.png)

Both independent final reviewers approve `d6d6b70857619877a51ef9371e7a5e17c1d08bbd`.

Takeover and verification: `gpt-6-astra` in Codex, on behalf of Maria.

