feat: make headless terminal size configurable - #2829
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe server now supports configurable headless terminal dimensions. Defaults are 120 columns by 40 rows. Configuration validation, live reloads, runtime sizing, documentation, and integration tests cover the behavior. ChangesHeadless terminal sizing
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to The change makes detached terminal dimensions configurable while preserving attached-client and existing detached sizing behavior; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Config
participant AppState
participant HeadlessServer
participant PanePTY
Config->>AppState: Load headless_cols and headless_rows
AppState->>HeadlessServer: Provide headless_size
HeadlessServer->>PanePTY: Apply effective_size without a client
Config->>AppState: Reload server dimensions
AppState->>HeadlessServer: Refresh headless_size
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThe PR adds configurable headless terminal dimensions and applies them during startup, reload, and last-client detachment while preserving existing PTY sizes.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; both previously reported headless-sizing issues are addressed by initialization-time fallback sizing and fallback view recomputation after the last client detaches.
|
| Filename | Overview |
|---|---|
| src/server/headless.rs | Tracks configured headless and effective dimensions, synchronizes fallback geometry on reload and detachment, and preserves existing PTY sizes. |
| src/app/state.rs | Stores the configured fallback and uses it when estimating pane dimensions before a computed view exists. |
| src/app/mod.rs | Initializes and reloads application headless dimensions with invalid-section handling. |
| src/config.rs | Defines defaults and rejects zero-valued headless dimensions. |
| src/config/io.rs | Registers and live-loads the new server configuration section. |
| src/config/model.rs | Adds the typed server configuration model, defaults, and parsing tests. |
| tests/detach_reattach.rs | Adds real-PTY coverage for configured initial sizing and fallback sizing after detachment while checking preservation of existing panes. |
Sequence Diagram
sequenceDiagram
participant Config
participant App
participant Server as HeadlessServer
participant View
participant PTY
Config->>App: load headless_cols × headless_rows
App->>Server: initialize headless_size
alt no client attached
Server->>View: compute fallback geometry
View->>PTY: seed new panes at fallback size
else client attached
Server->>View: use client geometry
View->>PTY: resize shared runtime
end
Server->>View: last client detaches
View->>View: recompute fallback layout
Note over View,PTY: Existing PTYs retain attached size
View->>PTY: new panes use fallback geometry
Reviews (4): Last reviewed commit: "feat: make headless terminal size config..." | Re-trigger Greptile
f765603 to
20cf796
Compare
20cf796 to
f533492
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fc41ed59-d8ab-484e-b5ff-148adb7bb8a5
📒 Files selected for processing (2)
src/server/headless.rstests/detach_reattach.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- src/server/headless.rs
f533492 to
f8125c4
Compare
Summary
server.headless_colsandserver.headless_rowssettingsRefs #2828.
Validation
just checkjust bench-render-scale