Cap the chips at three, and make the menu report-only
Two changes that pull in the same direction: the panel says less, and the menu stops pretending to do anything. The chip row had no bound. It sits in the centre box next to the clock, so enough open sessions would have shoved the clock off centre. It now shows the first N, settable and three by default, and counts the rest as "+N". Chips are already ordered by urgency, so the ones that survive the cut are the ones that need you soonest. Labels are still assigned across every session, including hidden ones, so a chip does not change when the cap does or when a session ahead of it disappears. Clicking a menu row used to switch the zellij tab and raise a terminal. That is gone. It cost real machinery for what it saved -- gnome-terminal runs every window under one shared server process, so windows cannot be matched by pid and the code fell back to matching the zellij session name against window titles, with all the ways that misses. The menu reports status; alt-tab is not the bottleneck. Rows are built inert rather than demoted after the fact, because PopupBaseMenuItem latches _activatable in its constructor. zellij tab lookup stays: naming the tab is the better half of that feature and costs one process every couple of minutes. The preferences test now asserts a control per settings key rather than a switch per key, so the new spin row counts and a future non-boolean setting cannot slip in without one.
This commit is contained in:
+6
-4
@@ -48,7 +48,7 @@ const rows = [];
|
||||
const walk = widget => {
|
||||
for (let c = widget.get_first_child?.(); c; c = c.get_next_sibling()) {
|
||||
const type = c.constructor.$gtype.name;
|
||||
if (type === 'AdwSwitchRow' || type === 'AdwActionRow')
|
||||
if (type === 'AdwSwitchRow' || type === 'AdwSpinRow' || type === 'AdwActionRow')
|
||||
rows.push({ type, title: c.title, subtitle: c.subtitle });
|
||||
walk(c);
|
||||
}
|
||||
@@ -65,11 +65,13 @@ function check(name, condition, detail = '') {
|
||||
for (const row of rows)
|
||||
print(` ${row.type.replace('Adw', '').padEnd(10)} ${row.title}`);
|
||||
|
||||
// One switch per settings key, so a key added without a row is caught.
|
||||
// One control per settings key, so a key added without a row to change it is
|
||||
// caught here rather than by a user wondering why nothing happens.
|
||||
const keys = schemas.lookup('org.gnome.shell.extensions.claude-code-status', true)
|
||||
.list_keys().length;
|
||||
const switches = rows.filter(r => r.type === 'AdwSwitchRow').length;
|
||||
check('a switch for every settings key', switches === keys, `${switches} of ${keys}`);
|
||||
const controls = rows.filter(
|
||||
r => r.type === 'AdwSwitchRow' || r.type === 'AdwSpinRow').length;
|
||||
check('a control for every settings key', controls === keys, `${controls} of ${keys}`);
|
||||
|
||||
// The hook status line is the reason this page is worth opening at all: a
|
||||
// silent panel looks the same whether nothing runs or nothing is installed.
|
||||
|
||||
Reference in New Issue
Block a user