Skip to content

Button: an icon face's name and .named() can both set the name #306

Closed

Description

@samitbasu

Reported by a consumer after adopting WP2 (#304, v0.1.0-m8.26). An icon-only face now carries its name, b.button(key, (icon, "Close")), but ButtonOptions::named(..) still exists. So a button can be named twice, with no report and no documented winner. That's two sources of truth for one value.

Options (the user decides the API shape):

  • (a) Remove .named from buttons, so the face is the only place a name lives. A text face's name is its text, and an icon face's name is its tuple.
  • (b) Keep .named as an override of the face's text name (for a text face whose label differs from its accessible name), but make it unavailable on an icon face, by typestate or a separate method.
  • (c) Keep both: .named wins, report Problem::NamedTwice, and document it.

(a) or (b) makes the conflict unrepresentable, which fits #279.

Activity

  1. added
    consumer
    on Nov 17, 2026
  2. samitbasu commented on Nov 17, 2026

    @samitbasu
    OwnerAuthor

    Decision (user, 2026-11-17): (a). Remove .named from buttons. The face is the only place a button's name lives: a text face's name is its text, and an icon face's name is in its tuple.

  3. samitbasu commented on Nov 17, 2026

    @samitbasu
    OwnerAuthor

    Decision (user, 2026-11-17), refining (a): the face is the only place the name lives, for every face-carrying control (button, toggle, toggle-group item, dropdown). .named is removed from their chains and from ButtonOptions. A text face can carry a name different from its text: Face::text("···").named("The levels between"). This came from a consumer's elided breadcrumb case.

  4. added a commit that references this issue on Nov 17, 2026
  5. added a commit that references this issue on Nov 17, 2026
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

    consumer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions