fix(settings): keep the --app hint on the daemon route and type mode for photos only
Merged
IM
5d ago+67+67+01234567890123456789-17-17-01234567890123456789
Summary
- Daemon route keeps the
--appguidance.parseSettingsArgsreturned only the code and message, so a caller sending positionals straight to the daemon lostsetting_permission_app_positionaland the--apphint. It now normalizes theAppErrorlike other daemon handlers, matching the CLI route. SettingsUpdateOptionstakesmodeonly withphotos. The targets that take a mode are read from the catalog forms; every other target typesmode?: never, so{ permission: 'camera', mode: 'limited' }fails to compile instead of at runtime. A caller that forwards a widePermissionTargettogether with a mode must now narrow it to'photos'before passing the mode.- Help. The
settingshelp says iOS simulatorwifiandairplanechange only the status bar. - Test. The wifi/airplane warning test now checks the setting name and "status bar".
Before / after
parseSettingsArgs with ['permission', 'deny', 'notifications', 'com.example.app']:
"code": "INVALID_ARGS",
- "message": "settings permission notifications takes no mode."
+ "message": "settings permission notifications takes no mode.",
+ "hint": "Pass the app with --app com.example.app.",
+ "details": { "reason": "setting_permission_app_positional", "dispatched": "no", "permission": "notifications", "app": "com.example.app" }
tsc on const o: SettingsUpdateOptions = { setting: 'permission', state: 'grant', permission: 'camera', mode: 'limited' }:
base: exit 0
head: probe.ts(2,116): error TS2322: Type 'string' is not assignable to type 'undefined'.
Validation
- Focused
unit-coreruns: the four touched settings test files (87 tests) and the command-doc guards (77 tests) passed.generate:command-docsreportscommands.mdis current. - Mutants (each fails a test): dropping the daemon-route details, naming wifi in the airplane warning, removing "status bar", letting non-photos targets take a mode, emptying the moded target set.
- Base
aecafaf30, heade15ede08b.pnpm check:affected --run --head e15ede08b: format, lint, typecheck, layering, fallow, build, package, integration-node, and vitest-related passed.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.