Skip to content

feat(ghostty): import adjust-cell-height and dual-value window paddings - #7125

Merged
Jinwoo-H merged 3 commits into
stablyai:mainfrom
huhuhulululu:feat/ghostty-import-cell-height-dual-padding
Jul 4, 2026
Merged

Jinwoo-H merged 3 commits into
stablyai:mainfrom
huhuhulululu:feat/ghostty-import-cell-height-dual-padding

Conversation

@huhuhulululu

Copy link
Copy Markdown
Contributor

Summary

Two common Ghostty config forms currently land in unsupportedKeys during import:

  • adjust-cell-height percentages (e.g. adjust-cell-height = 35%) — this is the standard Ghostty way to set line spacing, and it has a direct Orca equivalent. Percentages now map to terminalLineHeight (35% → 1.35), rounded to two decimals. Values that would fall outside the settings UI's [1, 3] clamp are rejected, and pixel forms (e.g. adjust-cell-height = 2) stay unsupported because they depend on the rendered cell height, which the importer can't know.
  • Dual-value window paddings (window-padding-y = 10,8, Ghostty's top,bottom / left,right syntax) — previously the strict-integer parse failed on the comma and the whole key was dropped. Pairs now import as the rounded average, preserving the total padding along the axis. Single values behave exactly as before, and each half is validated against the existing [0, 512] range.

parseStrictInt moves to a new numeric-config-values.ts alongside the pair parser to keep mapper.ts under the max-lines budget (per AGENTS.md, no lint disables).

Test plan

  • 11 new cases in mapper-extended.test.ts: percentage mapping + rounding, pixel/negative/over-ceiling rejection, dual-value averaging (incl. whitespace), invalid half / out-of-range half / >2 values rejection
  • vitest run src/main/ghostty/ — 123/123 pass
  • oxlint and tsgo --noEmit -p config/tsconfig.node.json clean
  • Verified against a real-world Ghostty config using adjust-cell-height = 35% and window-padding-y = 10,8 (both previously reported unsupported)

Two Ghostty config forms previously landed in unsupportedKeys:

- adjust-cell-height percentages (e.g. "35%") now map to
  terminalLineHeight (1.35), the direct xterm equivalent. Pixel values
  are still rejected because they depend on the rendered cell height.
- window-padding-x/y "top,bottom" / "left,right" pairs now import as
  the rounded average, preserving the total padding along the axis.

parseStrictInt moves to numeric-config-values.ts alongside the new
pair parser to keep mapper.ts under the max-lines budget.
@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0a1b3c07-f1f8-4ad0-ab58-40d947cb5ef9

📥 Commits

Reviewing files that changed from the base of the PR and between c9a11fd and 675aa7d.

📒 Files selected for processing (2)
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/renderer/src/components/settings/AccountsPane.tsx
✅ Files skipped from review due to trivial changes (2)
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/renderer/src/components/settings/AccountsPane.tsx

📝 Walkthrough

Walkthrough

Changes

This change adds shared Ghostty numeric parsing helpers, updates mapper logic for window padding and cell height values, and adds coverage for those mappings. It also adds a settings label for terminalLineHeight, updates the import modal test to expect the displayed “Line Height” name, and adjusts AccountsPane copy to use a sentence-cased runtime label in several localized strings.

Sequence Diagram(s)

Not applicable.

Related PRs: None specified.

Suggested labels: area: ghostty, tests, ui

Suggested reviewers: None specified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and testing, but it omits required Screenshots, AI Review Report, Security Audit, and Notes sections from the template. Add the missing template sections: Screenshots (or 'No visual change'), AI Review Report, Security Audit, and Notes, and ensure each required item is filled in.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the Ghostty import support added for line-height percentages and dual-value window paddings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/ghostty/mapper-extended.test.ts (1)

112-141: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding inclusive-boundary tests for adjust-cell-height.

Coverage tests 33%/35% (mid-range) and 250% (over-ceiling), but not the exact boundary values (e.g. 200% → terminalLineHeight: 3, or 0% → 1) that confirm the clamp is inclusive per the settings UI range [1, 3].

✅ Suggested additional boundary tests
   it('rejects a percentage above the 3x line-height ceiling', () => {
     const result = mapGhosttyToOrca({ 'adjust-cell-height': '250%' })
     expect(result.diff).toEqual({})
     expect(result.unsupportedKeys).toEqual(['adjust-cell-height'])
   })
+
+  it('accepts the inclusive 3x line-height ceiling', () => {
+    const result = mapGhosttyToOrca({ 'adjust-cell-height': '200%' })
+    expect(result.diff).toEqual({ terminalLineHeight: 3 })
+    expect(result.unsupportedKeys).toEqual([])
+  })
+
+  it('accepts the inclusive 1x line-height floor', () => {
+    const result = mapGhosttyToOrca({ 'adjust-cell-height': '0%' })
+    expect(result.diff).toEqual({ terminalLineHeight: 1 })
+    expect(result.unsupportedKeys).toEqual([])
+  })

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0fbed734-971c-480a-907e-3d518119be2f

📥 Commits

Reviewing files that changed from the base of the PR and between dbf8086 and 1461013.

📒 Files selected for processing (3)
  • src/main/ghostty/mapper-extended.test.ts
  • src/main/ghostty/mapper.ts
  • src/main/ghostty/numeric-config-values.ts

@Jinwoo-H Jinwoo-H left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I verified the Ghostty import flow end to end and added a small follow-up commit for numeric edge cases and UI labeling.

  • Preserves fractional averages for dual-value padding, e.g. 1,2 -> 1.5.
  • Checks adjust-cell-height against Orca's [1, 3] range before rounding.
  • Covers decimal rounding boundaries like 0.5%, 1.5%, and 101.5%.
  • Labels imported line height as Line Height in the modal.

Validated with typecheck, focused Ghostty/settings tests, touched-file lint, and Electron.

@Jinwoo-H
Jinwoo-H merged commit 2607ff1 into stablyai:main Jul 4, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…gs (stablyai#7125)

* feat(ghostty): import adjust-cell-height and dual-value window paddings

Two Ghostty config forms previously landed in unsupportedKeys:

- adjust-cell-height percentages (e.g. "35%") now map to
  terminalLineHeight (1.35), the direct xterm equivalent. Pixel values
  are still rejected because they depend on the rendered cell height.
- window-padding-x/y "top,bottom" / "left,right" pairs now import as
  the rounded average, preserving the total padding along the axis.

parseStrictInt moves to numeric-config-values.ts alongside the new
pair parser to keep mapper.ts under the max-lines budget.

* fix(ghostty): tighten import edge cases

Co-authored-by: Orca <[email protected]>

* fix(settings): sentence-case account runtime copy

Co-authored-by: Orca <[email protected]>

---------

Co-authored-by: Jinwoo-H <[email protected]>
Co-authored-by: Orca <[email protected]>
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.

2 participants