Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
- Removed the 4-column outer margin that cat mode and TUI body rows
shared, plus the additional 2-column inset on cat-mode table rows.
Content now starts at column 0. The gutter originally mirrored `glow`;
with TUI as the default it cost 4 cols for no remaining visual gain.

## [0.5.0] - 2026-05-21

### Changed
Expand Down
13 changes: 13 additions & 0 deletions docs/LINK_PICKER_DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,16 @@ They are complementary. A realistic plan could be:
2. Revisit **C** later if the inline-hint flow feels worth the rendering complexity.

Either way, the status-bar `take(9)` overlay should be retired once a replacement lands.

---

## Update — 2026-05-22: `MARGIN_WIDTH` gutter no longer exists

The constraint phrased as "must not shift the body layout's column
alignment for heading images (`MARGIN_WIDTH` gutter)" referenced the
4-column outer margin that cat mode and TUI body rows used to share.
That gutter was removed (along with the `MARGIN_WIDTH` constant) now
that TUI is the default mode. The underlying constraint still holds —
label/prefix spans added by any future link picker must not shift the
column where heading images land — but the alignment column is now `0`
(or `30` when ToC is open), not `4` / `34`.
15 changes: 15 additions & 0 deletions docs/TUI_MODE_DEBUG_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,18 @@ Residual items from Rounds 1-3. Test on both Ghostty and iTerm2:
hypotheses tested.
- Keep `make check` green at each round; manual-only behavior fixes
still need snapshot validation that cat mode is unaffected.

---

## Update — 2026-05-22: `MARGIN_WIDTH` is gone

This log references `MARGIN_WIDTH` in the H3 bug analysis ("No
`MARGIN_WIDTH` prefix on TUI body RLines", "column aligns with image
column (`MARGIN_WIDTH = 4`)"). That constant — along with the 4-space
outer margin that mirrored `glow` — has been removed now that TUI is the
default mode. Body rows in both cat and TUI start at column 0; heading
images are placed at column 0 (or column 30 when the ToC panel is open).

The H3 fix described in the original log is unaffected in spirit: heading
images still need to be placed at the same column where the text would
have rendered. The number is just `0`/`30` now instead of `4`/`34`.
27 changes: 27 additions & 0 deletions docs/TUI_MODE_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3299,3 +3299,30 @@ git commit -m "chore: bump version to 0.4.0"
- **Placeholders:** No TBD/TODO in code. Where a task body mentions "refined in Phase N", the referenced task implements it.
- **Type consistency:** `Style` fields (`fg/bg/bold/italic/underline/strikethrough/dim`) introduced in Task 1.1 are used consistently through `cat.rs` (Task 1.8) and `viewport.rs`/`search.rs`. `HeadingImage` moved to `render.rs` in Task 1.1 and re-referenced in `tui/kitty.rs` (Task 3.2) via path `crate::render::HeadingImage`. Kitty protocol APIs in Task 3.1 (`transmit/place/delete_placement/delete_all_for_client`) are the ones called by `ImageLifecycle` in Task 3.2.
- **Known manual gates:** Task 1.9 requires human audit of snapshot diffs; Task 8.1 is the Ghostty/iTerm2 QA pass. Both are called out explicitly.

---

## Update — 2026-05-22: Outer margin removed

The original plan reserved a 4-column outer margin (`MARGIN` = `" "`,
`MARGIN_WIDTH` = `4`) on every cat-mode line and on every TUI body row,
mirroring `glow`'s gutter. With TUI now the default mode (post-v0.5.0), the
gutter cost a fixed 4 columns of horizontal real estate for no remaining
visual win, so it has been removed entirely.

What changed vs. the snippets in this plan:

- `src/style.rs` — `MARGIN` and `MARGIN_WIDTH` constants deleted.
- `src/cat.rs` — every `{MARGIN}` prefix dropped from `write_line` /
`emit_code_block` / `write_paragraph`; `prefix_visual_width` drops the
`MARGIN_WIDTH` term (only quote bars contribute); `wrap_and_write` no
longer subtracts margin from `term_width`.
- `src/tui/mod.rs` — the per-row leading-space span is gone; the heading
image `col_offset` collapses to `0` when ToC is closed and `30` when it
is open.
- `src/tui/viewport.rs` — `wrap_all` no longer reserves 4 cols.

Snapshot fixtures under `fixtures/expected/*.ansi` were regenerated. The
visible diff is exactly: leading `" "` removed from each rendered line,
and wrap points shift later (because each line now has 4 more usable
columns). All `make check` gates remain green.
44 changes: 22 additions & 22 deletions fixtures/expected/emoji-test.ansi
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<IMG>
<IMG>

<IMG>
<IMG>

这是一份专门用于验证标题图片渲染的测试文档。
这是一份专门用于验证标题图片渲染的测试文档。

<IMG>
<IMG>

• 单个 emoji: 😀 😎 ✨ 🚀
• 中英混排: Hello 世界 🌍
• 符号混排: ✅ Done · ⚠ Warning · ❌ Failed
• 常见 emoji 变体: ☀️ ❤️ ⭐️
• 单个 emoji: 😀 😎 ✨ 🚀
• 中英混排: Hello 世界 🌍
• 符号混排: ✅ Done · ⚠ Warning · ❌ Failed
• 常见 emoji 变体: ☀️ ❤️ ⭐️

<IMG>
<IMG>

正文仍然由终端自身字体渲染,所以这里主要用来对比标题和正文的表现差异。
正文仍然由终端自身字体渲染,所以这里主要用来对比标题和正文的表现差异。

│ 引用块里也放几个字符:💡 🛠 📦
│ 引用块里也放几个字符:💡 🛠 📦

<IMG>
<IMG>

Case  │ Example
────────────────── ┼ ───────────────────
Single emoji  │ 😀
Mixed text  │ 修正版 ✨ version 2
Symbol-like  │ ✅ ⚠ ❌
Variation selector │ ☀️ ❤️
Case  │ Example
────────────────── ┼ ───────────────────
Single emoji  │ 😀
Mixed text  │ 修正版 ✨ version 2
Symbol-like  │ ✅ ⚠ ❌
Variation selector │ ☀️ ❤️

<IMG>
<IMG>

这一行用于观察复杂 ZWJ emoji 的边界表现:👨‍👩‍👧‍👦 👩🏽‍💻 🧑‍🚀
这一行用于观察复杂 ZWJ emoji 的边界表现:👨‍👩‍👧‍👦 👩🏽‍💻 🧑‍🚀

<IMG>
<IMG>

如果修复生效,H1-H3 里的大部分单 emoji 和常见符号不应再显示成缺字框。
如果修复生效,H1-H3 里的大部分单 emoji 和常见符号不应再显示成缺字框。
90 changes: 45 additions & 45 deletions fixtures/expected/full-syntax-zh.ansi
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
<IMG>
<IMG>

<IMG>
<IMG>

<IMG>
<IMG>

<IMG>
<IMG>

这是六级标题 h6
这是六级标题 h6

<IMG>
<IMG>

这段文字将显示为斜体
这也是斜体
这段文字将显示为斜体
这也是斜体

这段文字将显示为粗体
这也是粗体
这段文字将显示为粗体
这也是粗体

你 可以 组合使用它们
你 可以 组合使用它们

<IMG>
<IMG>

<IMG>
<IMG>

• 项目 1
• 项目 2
• 项目 2a
• 项目 2b
• 项目 3a
• 项目 3b
• 项目 1
• 项目 2
• 项目 2a
• 项目 2b
• 项目 3a
• 项目 3b

<IMG>
<IMG>

1. 项目 1
2. 项目 2
3. 项目 3
1. 项目 3a
2. 项目 3b
1. 项目 1
2. 项目 2
3. 项目 3
1. 项目 3a
2. 项目 3b

<IMG>
<IMG>

[🖼 这是替代文本。](/image/Markdown-mark.svg)
[🖼 这是替代文本。](/image/Markdown-mark.svg)

<IMG>
<IMG>

你可能正在使用 Markdown 实时预览 (https://markdownlivepreview.com/)。
你可能正在使用 Markdown 实时预览 (https://markdownlivepreview.com/)。

<IMG>
<IMG>

│ Markdown 是一种轻量级标记语言,使用纯文本格式语法,由 John Gruber 和
│ Aaron Swartz 于 2004 年创建。
│ │ Markdown 常用于编写 readme
│ │ 文件、在线论坛中的消息格式化,以及使用纯文本编辑器创建富文本。
│ Markdown 是一种轻量级标记语言,使用纯文本格式语法,由 John Gruber 和 Aaron
│ Swartz 于 2004 年创建。
│ │ Markdown 常用于编写 readme
│ │ 文件、在线论坛中的消息格式化,以及使用纯文本编辑器创建富文本。

<IMG>
<IMG>

左对齐列 │ 居中对齐列
──────── ┼ ──────────
左侧 foo │ 右侧 foo
左侧 bar │ 右侧 bar
左侧 baz │ 右侧 baz
左对齐列 │ 居中对齐列
──────── ┼ ──────────
左侧 foo │ 右侧 foo
左侧 bar │ 右侧 bar
左侧 baz │ 右侧 baz

<IMG>
<IMG>

 let message = '你好,世界'; 
 alert(message); 
 let message = '你好,世界'; 
 alert(message); 

<IMG>
<IMG>

这个网站使用了  markedjs/marked 。
这个网站使用了  markedjs/marked 。
92 changes: 46 additions & 46 deletions fixtures/expected/full-syntax.ansi
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
<IMG>
<IMG>

<IMG>
<IMG>

<IMG>
<IMG>

<IMG>
<IMG>

This is a Heading h6
This is a Heading h6

<IMG>
<IMG>

This text will be italic
This will also be italic
This text will be italic
This will also be italic

This text will be bold
This will also be bold
This text will be bold
This will also be bold

You can combine them
You can combine them

<IMG>
<IMG>

<IMG>
<IMG>

• Item 1
• Item 2
• Item 2a
• Item 2b
• Item 3a
• Item 3b
• Item 1
• Item 2
• Item 2a
• Item 2b
• Item 3a
• Item 3b

<IMG>
<IMG>

1. Item 1
2. Item 2
3. Item 3
1. Item 3a
2. Item 3b
1. Item 1
2. Item 2
3. Item 3
1. Item 3a
2. Item 3b

<IMG>
<IMG>

[🖼 This is an alt text.](/image/Markdown-mark.svg)
[🖼 This is an alt text.](/image/Markdown-mark.svg)

<IMG>
<IMG>

You may be using Markdown Live Preview (https://markdownlivepreview.com/).
You may be using Markdown Live Preview (https://markdownlivepreview.com/).

<IMG>
<IMG>

│ Markdown is a lightweight markup language with plain-text-formatting
│ syntax, created in 2004 by John Gruber with Aaron Swartz.
│ │ Markdown is often used to format readme files, for writing messages
│ │ in online discussion forums, and to create rich text using a plain
│ │ text editor.
│ Markdown is a lightweight markup language with plain-text-formatting syntax,
│ created in 2004 by John Gruber with Aaron Swartz.
│ │ Markdown is often used to format readme files, for writing messages in
│ │ online discussion forums, and to create rich text using a plain text
│ │ editor.

<IMG>
<IMG>

Left columns │ Right columns
──────────── ┼ ─────────────
left foo  │ right foo
left bar  │ right bar
left baz  │ right baz
Left columns │ Right columns
──────────── ┼ ─────────────
left foo  │ right foo
left bar  │ right bar
left baz  │ right baz

<IMG>
<IMG>

 let message = 'Hello world'; 
 alert(message); 
 let message = 'Hello world'; 
 alert(message); 

<IMG>
<IMG>

This web site is using  markedjs/marked .
This web site is using  markedjs/marked .
Loading
Loading