fix(noctalia): improve bar visibility - #1692
Conversation
Co-authored-by: Codex <noreply@openai.com>
|
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughBar widget configuration for noctalia is updated with new center-aligned workspace widget and extended clock formatting. The clock gains vertical and tooltip format options. Right-side widgets are reformatted while retaining functionality. Tests validate the new layout structure and configuration fields. ChangesNoctalia bar widget configuration and testing
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Mesa DescriptionTL;DRFixes Noctalia bar visibility issues. What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
spec/noctalia_bar_spec.sh (1)
18-18: ⚡ Quick winHarden block-end matching to avoid whitespace-coupled test failures.
Line 18 and Line 32 depend on exact indentation, so formatting-only Nix changes can break tests. Prefer end-patterns that ignore leading spaces.
Diff suggestion
-It 'does not duplicate the workspace widget on the left bar' -When run bash -c "awk '/widgets.left = \\[/{in_left=1} in_left && /id =/ {print} in_left && /^ \\];/{exit}' '$CONFIG'" +It 'does not duplicate the workspace widget on the left bar' +When run bash -c "awk '/widgets.left = \\[/{in_left=1} in_left && /id =/ {print} in_left && /^[[:space:]]*\\];/{exit}' '$CONFIG'" @@ -It 'keeps seconds visible in clock formats' -When run bash -c "awk '/id = \"Clock\";/{in_clock=1} in_clock && /^ }/{exit} in_clock{print}' '$CONFIG'" +It 'keeps seconds visible in clock formats' +When run bash -c "awk '/id = \"Clock\";/{in_clock=1} in_clock && /^[[:space:]]*}/{exit} in_clock{print}' '$CONFIG'"Also applies to: 32-32
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@spec/noctalia_bar_spec.sh` at line 18, The awk end-pattern is tightly coupled to indentation (the pattern in the awk invocation that currently uses /^ \];/); change the exit condition in both occurrences (the awk pipeline that starts with '/widgets.left = \[/{in_left=1}') to match a closing bracket regardless of leading whitespace, e.g. replace the /^ \];/ check with /^[[:space:]]*\];/ (or /^[ \t]*\];/), so the block-end detection is resilient to formatting-only whitespace changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@spec/noctalia_bar_spec.sh`:
- Line 18: The awk end-pattern is tightly coupled to indentation (the pattern in
the awk invocation that currently uses /^ \];/); change the exit
condition in both occurrences (the awk pipeline that starts with '/widgets.left
= \[/{in_left=1}') to match a closing bracket regardless of leading whitespace,
e.g. replace the /^ \];/ check with /^[[:space:]]*\];/ (or /^[ \t]*\];/),
so the block-end detection is resilient to formatting-only whitespace changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3066acf0-5e92-4162-a470-d27e91e48b90
📒 Files selected for processing (2)
config/noctalia/default.nixspec/noctalia_bar_spec.sh
There was a problem hiding this comment.
Code Review
This pull request reorganizes the Noctalia bar layout by moving the workspace widget to a new center section and configuring the clock and tray widgets. It also introduces a suite of shell tests to validate these configuration changes. The review feedback suggests improving the reliability of the test scripts by removing fragile indentation anchors and refining the scoping of awk commands to avoid potential false positives.
| End | ||
|
|
||
| It 'shows tray items inline instead of hiding them in the drawer' | ||
| When run bash -c "awk '/id = \"Tray\";/{in_tray=1} in_tray && /drawerEnabled = false;/{print; exit}' '$CONFIG'" |
There was a problem hiding this comment.
The awk script for the Tray widget is not scoped to the widget block. If drawerEnabled = false; appears later in the file for a different widget, this test could produce a false positive. Consider exiting the script if the closing brace of the block is reached without finding the property.
| When run bash -c "awk '/id = \"Tray\";/{in_tray=1} in_tray && /drawerEnabled = false;/{print; exit}' '$CONFIG'" | |
| When run bash -c "awk '/id = \"Tray\";/{in_tray=1} in_tray && /drawerEnabled = false;/{print; exit} in_tray && /}/{exit}' '$CONFIG'" |
| End | ||
|
|
||
| It 'does not duplicate the workspace widget on the left bar' | ||
| When run bash -c "awk '/widgets.left = \\[/{in_left=1} in_left && /id =/ {print} in_left && /^ \\];/{exit}' '$CONFIG'" |
There was a problem hiding this comment.
The use of a hardcoded indentation anchor (^ ) makes this test fragile and inconsistent with the existing test pattern on line 8. Removing the anchor makes the test more robust against formatting changes.
| When run bash -c "awk '/widgets.left = \\[/{in_left=1} in_left && /id =/ {print} in_left && /^ \\];/{exit}' '$CONFIG'" | |
| When run bash -c "awk '/widgets.left = \\[/{in_left=1} in_left && /id =/ {print} in_left && /\\];/{exit}' '$CONFIG'" |
References
- Maintain consistency with established patterns for writing scripts that are extracted from Nix expressions. The existing test on line 8 uses a more robust pattern without hardcoded indentation anchors.
| End | ||
|
|
||
| It 'shows applications inside the centered numbered workspace widget' | ||
| When run bash -c "awk '/widgets.center = \\[/{in_center=1} in_center && /^ \\];/{exit} in_center{print}' '$CONFIG'" |
There was a problem hiding this comment.
The use of a hardcoded indentation anchor (^ ) makes this test fragile. Removing the anchor ensures the test remains valid even if the file is reformatted and maintains consistency with established patterns.
| When run bash -c "awk '/widgets.center = \\[/{in_center=1} in_center && /^ \\];/{exit} in_center{print}' '$CONFIG'" | |
| When run bash -c "awk '/widgets.center = \\[/{in_center=1} in_center && /\\];/{exit} in_center{print}' '$CONFIG'" |
References
- Maintain consistency with established patterns for writing scripts that are extracted from Nix expressions.
| End | ||
|
|
||
| It 'keeps seconds visible in clock formats' | ||
| When run bash -c "awk '/id = \"Clock\";/{in_clock=1} in_clock && /^ }/{exit} in_clock{print}' '$CONFIG'" |
There was a problem hiding this comment.
The use of a hardcoded indentation anchor (^ ) makes this test fragile. Removing the anchor improves maintainability and maintains consistency with established patterns.
| When run bash -c "awk '/id = \"Clock\";/{in_clock=1} in_clock && /^ }/{exit} in_clock{print}' '$CONFIG'" | |
| When run bash -c "awk '/id = \"Clock\";/{in_clock=1} in_clock && /}/{exit} in_clock{print}' '$CONFIG'" |
References
- Maintain consistency with established patterns for writing scripts that are extracted from Nix expressions.
Changes
Workspacewidget to the center bar section so it does not duplicate the left bar, while preserving numbered workspace badges.Testing
shellspec spec/noctalia_bar_spec.shnix-instantiate --parse config/noctalia/default.nix >/dev/nullmake nix-switch SUDO='sudo -n'activation verified throughhome-manager-skakinoki.serviceGenerated with Codex.
Summary by cubic
Improves Noctalia bar visibility by showing tray items inline, keeping seconds on the clock, and centering the Workspace widget to avoid duplication.
drawerEnabled = false) instead of hiding them in a drawer.Written for commit 48a1755. Summary will update on new commits.