# \[Bug\]: Tab in a composer numbered list keeps the number and does not nest the item in the sent Markdown · Issue \#17124 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/issues/17124)

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

Visibility: public

State: backlog

Priority: 0

## Description

[Discussion and activity](https://git.cafe/pingdotgg/t3code/issues/17124)

---

### Before submitting

- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.

### Area

apps/web

### Steps to reproduce

1. In the composer, type `1. first`.
2. Press **Shift+Enter**. The composer continues the list with `2. ` (correct).
3. Press **Tab** to nest the new item.
4. Type `nested` and send the message.

### Expected behavior

Tab nests the item as a sub-item and starts a nested numbered list, i.e. the draft becomes

```md
1. first
   1. nested
```

which renders as a nested list (`a.` in the chat, via `ol ol { list-style-type: lower-alpha }`), and the agent receives a nested list.

There should also be a way back out of the nesting: Shift+Enter on an empty nested item should move it up one level and continue the parent's numbering (`2.`), as it already does in the rich-text composer.

### Actual behavior

Tab only prepends two spaces and keeps the number, so the draft becomes

```md
1. first
  2. nested
```

- The item keeps `2.` instead of starting a nested list.
- Two spaces is not nesting under `1. ` in CommonMark: a child must reach the parent's content column (3 spaces for `1. `, 4 for `10. `). The sent Markdown is therefore a flat two-item list. Checked with `mdast-util-from-markdown`: `"1. foo\n  2. bar"` parses as one list with 2 items, `"1. foo\n   1. bar"` as a nested list. The rich-text composer draws it nested, but the agent and the sent message see a flat list.
- In the plain (non rich-text) composer, Shift+Enter on an empty nested item removes the marker and leaves the whole list instead of moving up one level.
- Shift+Tab does nothing to the list. It toggles plan mode, or moves focus to the previous element when plan mode is unavailable (e.g. "start without a project").

Bullet lists are unaffected by the indent width (`- ` has a content column of 2).

Cause: `listIndentForTab` in `apps/web/src/composer-list-continuation.ts` always inserts `"  "` at the line start and never touches the marker; both composer modes route Tab through it.

### Impact

Minor bug or occasional failure

### Version or commit

main @ 30cc78897

### Environment

macOS 26 (Darwin 25.6.0), Node 24.15.0, web client via `vp run dev`; reproduced in both the rich-text and the plain composer.

### Workaround

Indent manually with 3 spaces and type `1.` yourself.

### Proposed fix

I have a fix with focused tests on my fork, and I'm happy to open a PR once you agree with the direction:
https://github.com/pingdotgg/t3code/compare/main...michal-billtech:t3code:fix/composer-nested-ordered-list

- **Tab** nests the item at the content column of the item above, numbering a nested ordered list from `1.` or continuing an existing sublist. With nothing to nest under it keeps today's two-space indent.
- **Shift+Enter** on an empty nested item moves it up one level and continues the parent's numbering in both composer modes (top-level empty items still leave the list).
- **Shift+Tab** on a nested list item moves it back out, so Tab is reversible from the keyboard. Elsewhere Shift+Tab keeps toggling plan mode.

The Shift+Tab part changes an existing shortcut (plan mode toggle) on nested list lines, so I'd like your call on it. Without it, Shift+Enter on an empty nested item still provides the way out, and I can drop it from the PR.

