Skip to content

Design proper execute mode precedence (global vs file-embedded) #19

@djdarcy

Description

@djdarcy

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

  • Users can set a global mode that applies to all files
  • Files can specify their own mode that works when no global is set
  • CLI always overrides everything
  • The distinction between "explicitly configured" and "default" is clear

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions