Design proper execute mode precedence system
Problem
The current mode precedence (CLI -> file embedded -> global) means a user's global config is always overridden by the file's embedded mode. This makes the global config meaningless -- users can't set a blanket behavior (e.g., "always show info first") without editing every .dazzlelink file.
But the previous behavior (CLI -> global -> file) was also wrong -- it prevented files from specifying their intended mode (e.g., "open" was overridden by the global default "info").
Root cause
The global config object always returns "info" as the default mode, even when the user hasn't explicitly configured anything. There's no way to distinguish "user set global to info" from "nothing was configured."
Proposed solutions
Option A: Add an "explicit" flag to config. Only override file mode when the user has explicitly set a global preference.
Option B: Use None as the default for global mode (not "info"). Only apply global when it's not None.
Option C: Add a --respect-global / --respect-file flag to the CLI for explicit control.
Option D: Priority layers: CLI > global (if explicitly set) > file embedded > hardcoded default ("info")
Acceptance criteria
Design proper execute mode precedence system
Problem
The current mode precedence (CLI -> file embedded -> global) means a user's global config is always overridden by the file's embedded mode. This makes the global config meaningless -- users can't set a blanket behavior (e.g., "always show info first") without editing every .dazzlelink file.
But the previous behavior (CLI -> global -> file) was also wrong -- it prevented files from specifying their intended mode (e.g., "open" was overridden by the global default "info").
Root cause
The global config object always returns
"info"as the default mode, even when the user hasn't explicitly configured anything. There's no way to distinguish "user set global to info" from "nothing was configured."Proposed solutions
Option A: Add an "explicit" flag to config. Only override file mode when the user has explicitly set a global preference.
Option B: Use
Noneas the default for global mode (not "info"). Only apply global when it's not None.Option C: Add a
--respect-global/--respect-fileflag to the CLI for explicit control.Option D: Priority layers: CLI > global (if explicitly set) > file embedded > hardcoded default ("info")
Acceptance criteria