Group the long pages by what you are trying to do
Notifications repeated both lock-screen switch labels for every application, so twenty apps meant sixty rows of the same two sentences and the page could not be scanned at all. Each app is one row now, carrying what its switches add up to -- "On, lock screen shows the sender only", "On, hidden on the lock screen", "Notifications off" -- with the switches behind it, one app open at a time. The identifier only appears while an app is open, which is the only time it disambiguates anything, and the content switch dims when the app cannot reach the lock screen at all, because there it means nothing. Shortcuts were already grouped; the problem was that "Windows" caught focus, movement, splitting, resizing and window state alike and held 43 of the 93 binds. A section that long is a list, not a grouping. They are separated by intent now -- Focus, Move & split, Size, Window state -- and the split was checked against the binds this machine actually has rather than trusted from the keywords. Order matters in two places worth naming: "Next window splits down" is about splitting rather than focus, and "Focus session" is quiet mode bound to a workspace rather than window focus, so both are settled before the general checks. Refresh rate gets its own row. That need was created by collapsing the resolution list: the rates for a resolution were only ever reachable by opening it, so changing nothing but the rate meant going through the mode you already had. It appears only when the current resolution offers more than one. Default-application rows carry a chevron, having previously opened a chooser while looking completely inert. The notification contract asserted the literal Notifs.appRule(app.id).enabled, which moved when the rows collapsed. The rule is still read through a binding on Notifs.appRule, so a rule changed elsewhere still reaches the row -- the assertion now requires that, rather than requiring one particular spelling of it. The power profile rows were left alone. A three-way choice in three rows looks wasteful until you notice each row explains what the profile does, and that page has empty space to spare; a segmented control would trade information for space that is not scarce. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
This commit is contained in:
@@ -277,30 +277,60 @@ Singleton {
|
||||
|
||||
// Grouping is by what the shortcut does, taken from its own description,
|
||||
// so adding a bind puts it in the right section without touching this file.
|
||||
// Which section a bind belongs to.
|
||||
//
|
||||
// "Windows" used to catch focus, movement, splitting, resizing and window
|
||||
// state alike, which put 43 of the 93 binds under one heading -- a section
|
||||
// that long is a list, not a grouping. The window verbs are separated here
|
||||
// by what you are actually trying to do.
|
||||
//
|
||||
// Order matters: "Next window splits down" is about splitting rather than
|
||||
// focus, and "Focus session" is a Panama feature rather than window focus,
|
||||
// so both are settled before the general checks below them.
|
||||
function groupFor(description: string, bind: var): string {
|
||||
const text = description.toLowerCase();
|
||||
if (bind.key && String(bind.key).indexOf("XF86") === 0)
|
||||
return "Media & hardware keys";
|
||||
|
||||
// Quiet mode and Caffeine bound to a workspace, not window focus.
|
||||
if (text.indexOf("focus session") >= 0)
|
||||
return "Applications & shell";
|
||||
|
||||
if (text.indexOf("workspace") >= 0)
|
||||
return "Workspaces";
|
||||
if (text.indexOf("window") >= 0 || text.indexOf("focus") >= 0
|
||||
|| text.indexOf("swap") >= 0 || text.indexOf("split") >= 0
|
||||
|| text.indexOf("wider") >= 0 || text.indexOf("narrower") >= 0
|
||||
|
||||
if (text.indexOf("wider") >= 0 || text.indexOf("narrower") >= 0
|
||||
|| text.indexOf("taller") >= 0 || text.indexOf("shorter") >= 0
|
||||
|| text.indexOf("shrink") >= 0 || text.indexOf("grow") >= 0
|
||||
|| text.indexOf("float") >= 0 || text.indexOf("fullscreen") >= 0
|
||||
|| text.indexOf("close") >= 0 || text.indexOf("scratchpad") >= 0)
|
||||
return "Windows";
|
||||
|| text.indexOf("shrink") >= 0 || text.indexOf("expand") >= 0
|
||||
|| text.indexOf("grow") >= 0 || text.indexOf("resize") >= 0)
|
||||
return "Size";
|
||||
|
||||
if (text.indexOf("split") >= 0 || text.indexOf("swap") >= 0
|
||||
|| text.indexOf("move window") >= 0)
|
||||
return "Move & split";
|
||||
|
||||
if (text.indexOf("close") >= 0 || text.indexOf("fullscreen") >= 0
|
||||
|| text.indexOf("float") >= 0 || text.indexOf("pin ") >= 0
|
||||
|| text.indexOf("scratchpad") >= 0 || text.indexOf("minimize") >= 0)
|
||||
return "Window state";
|
||||
|
||||
if (text.indexOf("focus") >= 0 || text.indexOf("next window") >= 0
|
||||
|| text.indexOf("previous window") >= 0 || text.indexOf("last window") >= 0
|
||||
|| text.indexOf("window switch") >= 0)
|
||||
return "Focus";
|
||||
|
||||
if (text.indexOf("volume") >= 0 || text.indexOf("mute") >= 0
|
||||
|| text.indexOf("track") >= 0 || text.indexOf("play") >= 0
|
||||
|| text.indexOf("brightness") >= 0)
|
||||
return "Media & hardware keys";
|
||||
|
||||
return "Applications & shell";
|
||||
}
|
||||
|
||||
// Section order for the page. Anything a future bind invents lands at the
|
||||
// end rather than being dropped.
|
||||
readonly property var groupOrder: ["Windows", "Workspaces", "Applications & shell", "Media & hardware keys"]
|
||||
readonly property var groupOrder: ["Focus", "Move & split", "Size", "Window state",
|
||||
"Workspaces", "Applications & shell", "Media & hardware keys"]
|
||||
|
||||
function grouped(): var {
|
||||
const buckets = {};
|
||||
|
||||
Reference in New Issue
Block a user