Skip to content

Commit 311da35

Browse files
ZviBaratzclaude
andauthored
fix(ego-lint): expand CSS shell-class list from GNOME Shell SCSS source (#57)
## Summary - Cross-referenced `KNOWN_SHELL_CLASSES` in `check-css.py` against GNOME Shell's canonical SCSS widget files to add 13 missing shell classes across 6 categories - Added compound selector detection to `check_shell_class_override` to avoid false positives on `.shell-class.my-ext-class` patterns - Added test fixture and assertions for the new classes ### Classes added | Category | Classes | SCSS Source | |----------|---------|-------------| | Panel | `panel-status-indicators-box`, `clock-display` | `_panel.scss` | | Popup menu | `popup-status-menu-item`, `panel-menu`, `background-menu` | `_popovers.scss`, `popupMenu.js` | | Overview | `window-picker`, `window-caption`, `window-close` | `_window-picker.scss` | | Dash / app grid | `dash-background`, `overview-icon`, `icon-grid`, `app-folder` | `_dash.scss`, `_app-grid.scss` | | Dialogs | `modal-dialog` | `_dialogs.scss` | | Also from prior commit | `popup-menu-content`, `popup-menu-arrow`, `popup-menu-boxpointer`, `popup-menu-icon`, `popup-menu-ornament`, `popup-inactive-menu-item`, `popup-ornamented-menu-item`, `quick-settings-grid`, `quick-menu-toggle`, `quick-toggle-menu`, `quick-slider`, `notification-banner`, `calendar`, `events-button`, `workspace-background`, `workspace-thumbnails`, `osd-window`, `slider` | various | ### Note on issue scope `.popup-menu-container` and `.popup-menu-box` (mentioned in #44) are **not** standard GNOME Shell theme classes. They are custom classes the media-controls extension adds to its own widgets (`PanelButton.js:178,232`). Adding them to `KNOWN_SHELL_CLASSES` would create false positives for extensions using these as their own class names. The field test report was mistaken about their origin. ## Test plan - [x] `bash tests/run-tests.sh` — all assertions pass - [x] Fixture `css-shell-classes-extra@test` verifies new overrides detected and compound selectors exempted - [x] Added fixture coverage for panel (`panel-status-indicators-box`) and window-picker (`window-caption`) categories Closes #44 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9d6654a commit 311da35

File tree

3 files changed

+46
-10
lines changed

3 files changed

+46
-10
lines changed

skills/ego-lint/scripts/check-css.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,36 @@ def result(status, check, detail):
2121

2222
# Known GNOME Shell theme classes that are OK to target
2323
KNOWN_SHELL_CLASSES = {
24-
# Panel
24+
# Panel (_panel.scss)
2525
'panel', 'panel-button', 'system-status-icon',
26-
# Popup menu
26+
'panel-status-indicators-box', 'clock-display',
27+
# Popup menu (_popovers.scss + popupMenu.js)
2728
'popup-menu', 'popup-menu-item', 'popup-separator-menu-item',
2829
'popup-sub-menu', 'popup-menu-section',
2930
'popup-menu-content', 'popup-menu-arrow', 'popup-menu-boxpointer',
3031
'popup-menu-icon', 'popup-menu-ornament',
3132
'popup-inactive-menu-item', 'popup-ornamented-menu-item',
32-
# Quick settings
33+
'popup-status-menu-item', 'panel-menu', 'background-menu',
34+
# Quick settings (_quick-settings.scss)
3335
'quick-toggle', 'quick-settings', 'quick-settings-item',
3436
'quick-settings-grid', 'quick-menu-toggle', 'quick-toggle-menu',
3537
'quick-slider',
36-
# Notifications / messages
38+
# Notifications / messages (_notifications.scss, _message-list.scss)
3739
'message', 'message-list', 'notification', 'notification-banner',
38-
# Calendar / date
40+
# Calendar / date (_calendar.scss)
3941
'calendar', 'events-button',
40-
# Overview / workspace
42+
# Overview / workspace (_overview.scss, _window-picker.scss)
4143
'overview', 'workspace', 'workspace-background',
42-
'workspace-thumbnails',
43-
# Search
44+
'workspace-thumbnails', 'window-picker', 'window-caption',
45+
'window-close',
46+
# Search (_search-entry.scss)
4447
'search-entry',
45-
# Dash / app grid
48+
# Dash / app grid (_dash.scss, _app-grid.scss)
4649
'app-well-icon', 'dash', 'show-apps',
47-
# OSD / other
50+
'dash-background', 'overview-icon', 'icon-grid', 'app-folder',
51+
# Dialogs (_dialogs.scss)
52+
'modal-dialog',
53+
# OSD / other (_osd.scss, _slider.scss)
4854
'osd-window', 'slider',
4955
}
5056

tests/fixtures/css-shell-classes-extra@test/stylesheet.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,31 @@
1919
height: 20px;
2020
}
2121

22+
/* Dialog class — should trigger shell-class-override */
23+
.modal-dialog {
24+
border-radius: 12px;
25+
}
26+
27+
/* Popup context menu — should trigger shell-class-override */
28+
.background-menu {
29+
opacity: 0.9;
30+
}
31+
32+
/* Dash class — should trigger shell-class-override */
33+
.dash-background {
34+
background: transparent;
35+
}
36+
37+
/* Panel class — should trigger shell-class-override */
38+
.panel-status-indicators-box {
39+
spacing: 6px;
40+
}
41+
42+
/* Window picker class — should trigger shell-class-override */
43+
.window-caption {
44+
font-size: 11pt;
45+
}
46+
2247
/* Scoped usage — should NOT trigger shell-class-override */
2348
.my-extension .popup-menu-arrow {
2449
color: red;

tests/run-tests.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,11 @@ assert_output_contains "detects popup-menu-boxpointer override" "css/shell-class
601601
assert_output_contains "detects notification-banner override" "css/shell-class-override.*notification-banner"
602602
assert_output_contains "detects osd-window override" "css/shell-class-override.*osd-window"
603603
assert_output_contains "detects slider override" "css/shell-class-override.*slider"
604+
assert_output_contains "detects modal-dialog override" "css/shell-class-override.*modal-dialog"
605+
assert_output_contains "detects background-menu override" "css/shell-class-override.*background-menu"
606+
assert_output_contains "detects dash-background override" "css/shell-class-override.*dash-background"
607+
assert_output_contains "detects panel-status-indicators-box override" "css/shell-class-override.*panel-status-indicators-box"
608+
assert_output_contains "detects window-caption override" "css/shell-class-override.*window-caption"
604609
assert_output_not_contains "no unscoped-class FP on new shell classes" "css/unscoped-class"
605610
assert_output_not_contains "compound selector not flagged" "css/shell-class-override.*quick-settings-grid"
606611
echo ""

0 commit comments

Comments
 (0)