Skip to content

Fix GNU flat-button box colors and cover tab-line startup - #584

Merged
eval-exec merged 1 commit into
mainfrom
fix/issue-583-tab-line-flat-button
Oct 22, 2026
Merged

eval-exec merged 1 commit into
mainfrom
fix/issue-583-tab-line-flat-button

Conversation

@eval-exec

Copy link
Copy Markdown
Owner

Colorless :box '(:style flat-button) boxes used the foreground instead of the face background. GNU's face attribute contract gives plain boxes and flat buttons different default colors, even though both use the same drawing kind.

Keep BoxStyle::Simple and BoxStyle::Flat distinct through parsing and dump storage, and choose their default colors after face colors are realized. Use exhaustive enum matches, share box realization across default/named/anonymous faces, and preserve a preceding style when a repeated :style is nil. Bump the face-section schema to 4 so old ambiguous dumps are rejected.

The missing-tab symptom already renders correctly on the current base. Add regressions for enabling global tab lines through an actual startup init, visiting a new file, and split windows. GUI checks assert tab placement below frame chrome, resolved border colors, and actual GPU pixels.

Validation on the final development build, with default features plus video and regenerated Lisp bytecode/pdump:

  • Core unit tests: 53 passed.
  • Layout tests: 47 distinct tests passed.
  • Live GNU Emacs 31.1 oracle tests: 2 passed.
  • TUI comparisons against GNU: 3 passed.
  • GUI regression: passed on X11 and Wayland; border pixels changed from incorrect red to expected green.
  • Formatting and diff checks passed.

Both the original border-color regression and trailing-nil regression failed before their fixes. The bootstrap unit's stale-bytecode guard passed after a full bytecode rebuild, with the guard retained.

Fixes #583.

Keep plain boxes and flat-button distinct until face realization so omitted colors use foreground and background respectively. Preserve the distinction in pdump and retain preceding styles when a repeated :style is nil. Add startup tab-line regressions and verify rendered box colors through unit, live oracle, TUI, and X11/Wayland GPU tests.
Copilot AI balanced review requested due to automatic review settings October 22, 2026 15:16
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 602a066c-e195-4c95-afa6-6fd5d87fd1e5
📥 Commits

Reviewing files that changed from the base of the PR and between 6407e03 and 955f569.

📒 Files selected for processing: 13
  • crates/neomacs-gui-tests/fixtures/issue-583-tab-line/init.el
  • crates/neomacs-gui-tests/tests/window_chrome.rs
  • crates/neomacs-layout-engine/src/neovm_bridge.rs
  • crates/neomacs-layout-engine/src/neovm_bridge/tests/neovm_bridge_test.rs
  • crates/neomacs-tui-tests/tests/windows_tabs.rs
  • crates/neovm-core/src/emacs_core/display/xfaces/mod.rs
  • crates/neovm-core/src/emacs_core/runtime/pdump/convert.rs
  • crates/neovm-core/src/emacs_core/runtime/pdump/face_image.rs
  • crates/neovm-core/src/emacs_core/runtime/pdump/face_image/tests/face_image_test.rs
  • crates/neovm-core/src/emacs_core/runtime/pdump/types.rs
  • crates/neovm-core/src/face.rs
  • crates/neovm-core/src/face/tests/face_test.rs
  • crates/neovm-oracle-tests/tests/oracle_tab_line.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The changes separate plain and button box styles, apply style-specific default colors during face realization, and update face-image persistence. They also add GUI, TUI, and oracle tests for global tab-line behavior and box rendering.

Changes: Tab-line and Box Style Support

Layer / File(s) Summary
Box-style parsing and persistence
crates/neovm-core/src/face.rs, crates/neovm-core/src/emacs_core/display/xfaces/mod.rs, crates/neovm-core/src/emacs_core/runtime/pdump/*, crates/neovm-core/src/face/tests/face_test.rs, crates/neovm-core/src/emacs_core/runtime/pdump/face_image/tests/face_image_test.rs, crates/neovm-oracle-tests/tests/oracle_tab_line.rs
Plain box specifications now default to Simple; flat-button remains a distinct style. Nil or unrecognized plist styles preserve the current style. Face-image format version 4 stores the new distinction, and tests cover parsing, oracle attributes, and round trips.
Box-border face realization
crates/neomacs-layout-engine/src/neovm_bridge.rs, crates/neomacs-layout-engine/src/neovm_bridge/tests/neovm_bridge_test.rs
Default-face setup, face merging, and base face realization use shared box-border handling. Simple boxes default to the foreground color; button styles default to the background color. Explicit colors take precedence.
Global tab-line regression coverage
crates/neomacs-gui-tests/fixtures/issue-583-tab-line/*, crates/neomacs-gui-tests/tests/window_chrome.rs, crates/neomacs-tui-tests/tests/windows_tabs.rs, crates/neovm-oracle-tests/tests/oracle_tab_line.rs
The GUI fixture snapshots startup, visited-file, split-window, and styled-tab states. GUI checks inspect tab-line geometry, labels, and selected border properties. TUI and oracle tests check global tab-line behavior across buffers.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~22 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 955f5

No actionable merge-blocking risk is established; the change is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 58.62% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 29 functions across 12 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the two main changes: correcting GNU flat-button box colors and adding tab-line startup coverage.
Description check Passed The description directly explains the box-color fix, tab-line regressions, schema changes, and validation results. It is fully related to the changeset.
Linked Issues check Passed Issue #583 has two coding objectives. The PR preserves BoxStyle::Simple and BoxStyle::Flat through parsing and pdump storage, realizes default colors after face colors, and adds coverage for anony…
Out of Scope Changes check Passed The changes stay within issue #583. Face parsing, box realization, pdump schema and round-trip updates support the flat-button fix. GUI, TUI, oracle, and layout regressions support tab-line behavior…
Full details: Linked Issues check

Explanation

Issue #583 has two coding objectives. The PR preserves BoxStyle::Simple and BoxStyle::Flat through parsing and pdump storage, realizes default colors after face colors, and adds coverage for anonymous, named, and default faces. This fixes plain-box versus flat-button color behavior. The PR also adds startup regressions for global-tab-line-mode, new files, split windows, and tab placement. The reviewed summary states that the existing tab-line implementation already renders correctly on the current base, and the new tests cover the reported startup case.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #583. Face parsing, box realization, pdump schema and round-trip updates support the flat-button fix. GUI, TUI, oracle, and layout regressions support tab-line behavior and box rendering. The added fixtures and pixel checks validate the reported symptoms. No unrelated product behavior is identified.

Full details: Docstring Coverage

Explanation

Docstring coverage is 58.62% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 29 functions across 12 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It changes the pdump face-section format (bumping to v4 to reject existing dumps) and alters box-color realization semantics across multiple crates, with verification resting on gated GUI/oracle tests that cannot be exercised here.

No open issues 🎉

What changed in this PR

This PR fixes GitHub issue #583 by correcting the realized color of colorless :box '(:style flat-button) borders and adding regression coverage for global-tab-line-mode activated from an init file. GNU draws plain boxes and flat-button boxes with the same drawing kind (FACE_SIMPLE_BOX) but defaults their colors differently — plain boxes to the face foreground, flat buttons to the face background. The previous code collapsed every parsed box style into BoxStyle::Flat and defaulted all box colors to the foreground, so flat buttons were painted with the wrong color.

The fix introduces a distinct BoxStyle::Simple variant that is kept separate from Flat through Lisp parsing and pdump storage, and chooses the default color after face colors are realized. The pdump face-section schema is bumped to version 4 so older, ambiguous dumps are rejected rather than silently mis-decoded.

Changes:

  • Add BoxStyle::Simple, make gnu_code/from_gnu_code explicit (drawing code 1 decodes to Simple), and preserve a preceding :style when a later :style is nil (in both face.rs parsing and xfaces resolution).
  • Centralize box realization in a new apply_box_border helper that defaults the color to foreground for Simple and background for Flat/Raised/Pressed.
  • Add DumpBoxStyle::Simple, bump FACE_FORMAT_VERSION to 4, and extend pdump conversions; add core, bridge, oracle, TUI, and GUI tests plus a GUI fixture.
File Description
crates/​neovm-core/​src/​face.rs Adds Simple variant, explicit gnu_code/from_gnu_code, and nil-preserving :style parsing.
crates/​neovm-core/​src/​emacs_core/​display/​xfaces/​mod.rs Defaults boxes to Simple and preserves a prior :style when a later one is nil.
crates/​neovm-core/​src/​emacs_core/​runtime/​pdump/​types.rs Adds DumpBoxStyle::Simple = 3.
crates/​neovm-core/​src/​emacs_core/​runtime/​pdump/​face_image.rs Bumps face-section format version to 4 to reject ambiguous old dumps.
crates/​neovm-core/​src/​emacs_core/​runtime/​pdump/​convert.rs Maps Simple between runtime and dump box styles.
crates/​neomacs-layout-engine/​src/​neovm_bridge.rs Adds apply_box_border, choosing default box color by style.
crates/​neomacs-gui-tests/​fixtures/​issue-583-tab-line/​init.el GUI fixture exercising startup tab lines, splits, and flat-button box.
crates/​neomacs-gui-tests/​tests/​window_chrome.rs GUI regression asserting tab placement, resolved colors, and GPU pixels.
crates/​neomacs-tui-tests/​tests/​windows_tabs.rs TUI regression for global tab line from init and visiting a new file.
crates/​neovm-oracle-tests/​tests/​oracle_tab_line.rs Live-GNU parity for tab-line activation and flat-button style ordering.
crates/​neovm-core/​src/​face/​tests/​face_test.rs, .../​face_image/​tests/​face_image_test.rs, .../​neovm_bridge/​tests/​neovm_bridge_test.rs Unit tests covering the new style distinction and dump round-trips.

I verified that BoxStyle::from_gnu_code and the removed IntoPrimitive/TryFromPrimitive derives have no remaining production callers, that box_style_to_u8 is fully replaced, that apply_box_border reads fg/bg only after they are installed in all three realization paths, that the dump conversions map by name (not discriminant) so the differing enum orderings are safe, and that the new test files follow existing registration and harness conventions. No objective defects were found in the changed hunks.

Review effort: Balanced

@eval-exec
eval-exec merged commit 16150e0 into main Oct 22, 2026
29 of 37 checks passed
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.

[Bug]: tab-line not showing in tab-line-mode and :box :style 'flat-button is not supported-

2 participants