Skip to content

Predictable UI: disable-with-reason instead of hiding affordances #111

Description

@fgilio

Context

The branch-explorer picker now keeps its scope options ("Since {base}", "Since the beginning", working tree) in a fixed position and disables them with a one-line reason when they can't be used, rather than removing them from the layout. This shipped alongside the "Since the beginning" (entire-repo diff) feature.

Removing an affordance shifts the layout and makes the option feel like it doesn't exist. A disabled row with a reason teaches what the option is and why it's currently off, and keeps the layout stable and learnable.

Ask

Audit the rest of the app for affordances that appear/disappear based on state, and convert conditional hiding to disable-with-reason where the option is real but currently unusable. Candidates:

  • Header buttons
  • Native menu items (HandleMenuItemClicked)
  • Project settings entries
  • Remote actions (push/fetch/compare-on-remote)

Out of scope

Options that are genuinely inapplicable (not merely unavailable) should still not render. The goal is a stable layout where nothing real silently vanishes, not showing controls that make no sense in context.

Reference implementation

See the "Since {base}" row in resources/views/livewire/⚡branch-explorer.blade.php and the sinceBaseActionable / sinceBaseReason getters in public/js/branch-explorer.js for the pattern (always render, gate clickability, surface a reason).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions