Make the focus exception list real, or it was a page telling a lie
The mode data model shipped with an allow list and nothing that read it. The summary would say "2 apps may interrupt" while notification delivery never consulted the list and no editor could set it. That is the dead row this work has spent its time removing, introduced by the work itself. The banner gate consults the mode in force now, and the list can be edited from the applications that have actually sent a notification -- an exception for something that never notifies is not a choice worth offering. Exceptions belong to a mode. allowedApps is empty whenever no mode is active, so a Do Not Disturb switched on by hand stays absolute and nothing can leak into it. That scoping is asserted, not just written. Verifying this took three attempts, and the second was a real defect in the guard rather than in the code. The contract grep for FocusModes.allows matched the comment that explains it, so the check passed with the enforcement deleted. It matches the gate expression now. A guard a comment can satisfy is not a guard, and this is the third time prose has satisfied one here. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
This commit is contained in:
@@ -84,8 +84,14 @@ if (!source.includes("next[knownAppId] = root.appRule(knownAppId)"))
|
||||
fail("persisted rules are not normalized to the required three-field shape");
|
||||
if (!source.includes("root.fallbackAppRules = next"))
|
||||
fail("missing-schema preference writes do not retain an in-memory fallback");
|
||||
if (!source.includes("if (!root.doNotDisturb)"))
|
||||
fail("global DND popup override was removed");
|
||||
// Do Not Disturb still gates popups; it gained exactly one exception, and the
|
||||
// assertion names that exception rather than being loosened. A bare
|
||||
// if (!doNotDisturb) would mean the allow list of the active focus mode is
|
||||
// never consulted. Anything wider would let a manual Do Not Disturb be
|
||||
// overridden. No apostrophes here: this block is inside a single-quoted shell
|
||||
// string, and one closes it.
|
||||
if (!source.includes("if (!root.doNotDisturb || FocusModes.allows("))
|
||||
fail("Do Not Disturb no longer gates popups with a focus-mode exception");
|
||||
for (const required of [
|
||||
"DesktopEntries.applications.values",
|
||||
"DesktopEntries.byId(appId)",
|
||||
|
||||
Reference in New Issue
Block a user