Repository navigation
Commit 804fbf5
committed
feat(plugin): a layout rule's rowGap sees the message the row draws
Every transcript row is a box with marginTop={gap()}, drawn whatever its
slot renders. A plugin that replaces session.message.user and draws nothing
for a message (Prime hides a prompt the runner has not taken, showing it
above the composer instead) still left that row's gap: a blank row per
hidden message. The rule saw only the row's kind, not which message it is.
Why the fork: (1) the plugin API gives the rule no row identity, and a slot
cannot remove its wrapper's margin; (2) there is no built-in to disable,
since the gap is the host's row wrapper; drawing the gap inside the slot
instead moves the row's top onto the blank line, so a jump to the message
lands on the blank row. (3) is this: one optional field on the rule's input,
generic and upstreamable. It moves out once OpenCode's layout rule names the
row's message, or skips the gap of a row that draws nothing.1 parent 226b844 commit 804fbf5
4 files changed
Lines changed: 48 additions & 2 deletions
File tree
- packages
- plugin/src/tui
- tui
- src/routes/session
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
551 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
552 | 561 | | |
553 | 562 | | |
554 | 563 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1735 | 1735 | | |
1736 | 1736 | | |
1737 | 1737 | | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
1738 | 1745 | | |
1739 | 1746 | | |
1740 | 1747 | | |
| |||
1748 | 1755 | | |
1749 | 1756 | | |
1750 | 1757 | | |
| 1758 | + | |
1751 | 1759 | | |
1752 | 1760 | | |
1753 | 1761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
159 | 173 | | |
160 | 174 | | |
161 | 175 | | |
| |||
0 commit comments