Skip to content

fix: bound the prompt bar by wrapped rows and name the monthly cost default once - #470

Merged
github-actions[bot] merged 3 commits into
developfrom
bugfix/plugin-authoring-review
Oct 24, 2026
Merged

github-actions[bot] merged 3 commits into
developfrom
bugfix/plugin-authoring-review

Conversation

@a1exk-dev

Copy link
Copy Markdown
Owner

What changed

The prompt panel's ┃ bar is now as long as the prompt can be once wrapped, not one row per character. The monthly cost default is named once, and the check ties the manifest to it.

Refs: #450, #451, #453, #454

Summary

Prompt panel bar (#453), in ctui/hooks/skin/user.tsx. columns comes from the UserMessage render's viewport:

 userMessage(el, text, right, columns?)
-  bar = '┃' × (chars + 3)
+  if no columns: bar = '┃' × (chars + 3)                  // unchanged
+  cells = max(1, floor(max(1, columns − 5 − right) / 4))
+  rows  = Σ lines max(1, ceil(line / cells)) + 3
+  bar   = '┃' × min(rows, chars + 3)                      // never longer than before

Monthly cost default (#454):

 ctui/hooks/
+├── monthly-default.ts   # MONTHLY_DEFAULT = 100, nothing else
 ├── config.ts            # reader fallback → MONTHLY_DEFAULT
 ctui/plugins/limits/     # view fallback → MONTHLY_DEFAULT
 scripts/check.ts         # + plugin.json default must equal MONTHLY_DEFAULT

Evidence

  • Before: the bar for a 20,000-character paste is 20,003 rows, at any width. The 100 default is written in four places, and nothing checks that they agree.
    After: node scripts/check.ts exits 0. New tests in tests/rewrites.test.tsx:
    • a long prompt's bar is bounded by its wrapped rows, not its characters
    • with no viewport, the bar is one row per character plus three, as before
    • a prompt of many short lines counts each line as its own row
    • the bar is never longer than one row per character plus three, at any width
    • while docked, the prompt's bar is bounded against the panel's narrower width
  • Drift check: with plugin.json's default set to 150 and the constant left alone, the check fails with the limits_cost_monthly default in plugin.json and MONTHLY_DEFAULT in ctui/hooks/monthly-default.ts differ: [150] vs [100].

Merge Danger

Door: two-way

The bar's new length is never longer than the old one, and still reaches the panel's bottom row. A short prompt's bar shrinks, for example from 9 rows to 4, but the panel is only 3 rows tall, so the look doesn't change. The default value, its floor and its title are unchanged.

Blast Radius: prompt-panel

Reports

Live checks

N/A

Evals

N/A

The settings reader's fallback, the Limits view's fallback and the reader
test read MONTHLY_DEFAULT from its own leaf module, and node scripts/check.ts
fails when the manifest's declared default and the constant differ.

Refs: #454
Given the render's viewport, the bar is the prompt's wrapped row count against a quarter of the panel's inner width, clamped to one row per character plus three. With no viewport it keeps the character-count length.

Refs: #453
…odule

Name the quarter-row factor in the prompt panel's bar as FILL beside
CHROME, make CHROME's comment add up to its 5 cells, and state the
one-row-per-character bound once. Rename ctui/hooks/monthly.ts to
monthly-default.ts so it no longer reads like month.ts, and drop the
clamp test's widths no terminal session sends.

Refs: #453
Refs: #454
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