Skip to content

feat: let groups override the default unblock duration and key - #123

Merged
ykisana merged 1 commit into
mainfrom
feat/group-unblock-defaults
Nov 18, 2026
Merged

ykisana merged 1 commit into
mainfrom
feat/group-unblock-defaults

Conversation

@ykisana

@ykisana ykisana commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Closes #91.

What

  • Edit Group has a new Unblocking section with Default Duration and Default Key.
  • Both start on App Default, which follows Settings. Choosing anything else overrides Settings for that group only, in either direction:
    • a duration or key type, even when Settings has none;
    • None, to always pick for this group even when Settings has a default.
  • The row shows the short value (App Default, None, 4 hours). The menu's first option says what App Default is right now, e.g. "App Default (30 minutes)".

When the group's default applies

  • Duration: any group unblock that uses the default:
    • the group card's Unblock;
    • a widget or link set to Default Duration;
    • the Shortcuts Unblock Group action with Default Duration.
    • The duration sheet also starts on the group's default.
  • Key: where Settings' Default Key applies today: the Groups key check and Shortcuts. Widgets and links still use the key type they're set to.
  • Explicit choices still win: a fixed duration, Ask Each Time, Until Manually Re-Blocked, or a requested key type. Unblock All always uses Settings.
  • Stale values: if a group's duration is later removed from Unblock Durations, or its key type no longer has a key, it acts as None, the same as Settings' own defaults.
  • While blocked: the section is read-only, like the rest of Edit Group.

How

  • AppGroup stores overridesDefaultDuration + defaultUnblockSeconds and overridesDefaultKey + defaultKeyType. All are optional or defaulted, so existing groups migrate lightly and start on App Default. durationOverride and keyOverride read them as a DefaultOverride (.appDefault, .none, .value).
  • Settings.defaultDuration(for:) and defaultKeyType(for:) resolve a group's effective default. unblockLength(for:group:) now requires the group, so every caller decides.
  • Callers updated: group card, widget and link handler, duration sheet, Groups key check, Shortcuts performer.

Tests

  • GroupUnblockDefaultsTests: following, overriding and turning off the app defaults; a removed duration acting as None; explicit requests ignoring the group default; choosing App Default again clearing the override.
  • AppUnblockIntentPerformerTests: a Shortcuts location unblock uses the group's duration, and handing off to the app uses the group's key.
  • StoreUpgradeTests: 1.4 groups open on App Default.
  • BlockingUITests.testGroupDefaultDurationSkipsTheDurationSheet: with no app default, sets a group to 4 hours in Edit Group, checks the row reads App Default and the menu says what it is, then unblocking starts without the duration sheet.
  • Unit tests: 893/893. UI tests: 48/48. Both on the iPhone Air iOS 27.0 simulator. The iOS 17 fallback (row and menu both say "App Default") was checked on an iPhone SE iOS 17.5 simulator.

Edit Group has a new Unblocking section with Default Duration and
Default Key. Both start on App Default, which follows Settings; any
other choice, including None, overrides it for that group. A group's
default applies wherever the app default would: its card, widgets and
links set to Default Duration, and Shortcuts. Explicit choices and
Unblock All are unchanged.

Closes #91.
@ykisana
ykisana force-pushed the feat/group-unblock-defaults branch from 93f4aeb to 92e3d51 Compare November 18, 2026 15:37
@ykisana
ykisana merged commit cfcc0ae into main Nov 18, 2026
1 check passed
@ykisana
ykisana deleted the feat/group-unblock-defaults branch November 18, 2026 18:17
ykisana added a commit that referenced this pull request Nov 19, 2026
While anything is blocked the group sheet is read-only, which also locked
the Unblocking section #123 added. Changing a group's Default Duration or
Default Key doesn't loosen anything: an unblock still needs a key, and the
duration sheet already offers every duration. The two pickers now stay
editable while blocked, and Done saves them. Name, apps, websites and keys
stay locked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default Unblock Time For Groups

1 participant