Skip to content

fix: order ui accent before nested config tables - #2698

Open
akbash-bot wants to merge 2 commits into
masterfrom
akbash/2697-order-default-accent
Open

fix: order ui accent before nested config tables#2698
akbash-bot wants to merge 2 commits into
masterfrom
akbash/2697-order-default-accent

Conversation

@akbash-bot

Copy link
Copy Markdown
Collaborator

Summary

  • emit the ui.accent example before nested [ui.*] tables in --default-config
  • add a regression test for the parent-before-child TOML ordering

Checks

  • cargo test default_config_lists_ui_accent_before_nested_tables -- --nocapture
  • generated --default-config, uncommented ui.accent and [ui.sidebar.spaces] in place, then herdr config check (config: ok)
  • cargo fmt --check
  • cargo clippy --all-targets --locked -- -D warnings
  • just check reached 959 passing tests, then hit the pre-existing live-handoff test harness assumption that test binaries live under <checkout>/target; this issue environment requires an external isolated CARGO_TARGET_DIR

refs #2697

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e0403342-0da7-497f-b292-6140800306a6

📥 Commits

Reviewing files that changed from the base of the PR and between 7ae63e0 and dfb0ca1.

📒 Files selected for processing (1)
  • src/main.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main.rs

📝 Walkthrough

Walkthrough

The default configuration now documents ui.accent before nested sidebar settings. The duplicate later block was removed. A regression test verifies the setting's uniqueness and ordering.

Changes

UI accent configuration ordering

Layer / File(s) Summary
Default configuration and ordering test
src/main.rs
The documented ui.accent examples now appear before the sidebar configuration tables. The duplicate block was removed. A test verifies uniqueness and ordering.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: ordering the ui.accent example before nested configuration tables.
Description check ✅ Passed The description directly explains the configuration ordering change, regression test, and validation results.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch akbash/2697-order-default-accent

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

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
src/main.rs (1)

927-934: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the regression test reject duplicate accent documentation.

find returns the first matching block. If the removed later block is reintroduced, accent < sidebar still passes. Count the accent documentation marker and assert that it occurs exactly once before checking the ordering.

Proposed test improvement
 #[test]
 fn default_config_lists_ui_accent_before_nested_tables() {
-    let accent = DEFAULT_CONFIG.find("# accent = \"cyan\"").unwrap();
-    let sidebar = DEFAULT_CONFIG.find("# [ui.sidebar.agents]").unwrap();
+    let accent_marker = "# Accent color for highlights, borders, and navigation UI.";
+    assert_eq!(DEFAULT_CONFIG.matches(accent_marker).count(), 1);
+    let accent = DEFAULT_CONFIG.find("# accent = \"cyan\"").unwrap();
+    let sidebar = DEFAULT_CONFIG.find("# [ui.sidebar.agents]").unwrap();

     assert!(accent < sidebar);
 }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8ac84c1f-388d-4ac8-9524-b218cf4232a6

📥 Commits

Reviewing files that changed from the base of the PR and between 5600197 and 7ae63e0.

📒 Files selected for processing (1)
  • src/main.rs

@akbash-bot

Copy link
Copy Markdown
Collaborator Author

CodeRabbit review 4913662039: agreed, fixed in dfb0ca1.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown

Greptile Summary

The PR corrects the generated default configuration’s TOML ordering and adds focused regression coverage.

  • Moves the commented ui.accent example before all nested [ui.*] tables.
  • Verifies that the accent example occurs exactly once and precedes the first nested UI table.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The generated configuration now places the ui.accent scalar before the first nested UI table, and the regression test directly protects that ordering.

Important Files Changed

Filename Overview
src/main.rs Reorders the ui.accent example in DEFAULT_CONFIG and adds a focused ordering regression test; no actionable issues found.

Reviews (1): Last reviewed commit: "test: reject duplicate ui accent example..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Trigger automated AI reviews for pull requests admitted by the PR gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants