Skip to content

refactor(picker): the Layout type names frame sizing, not the Layout #54

Description

@hammadmajid

What problem are you trying to solve?

CONTEXT.md now defines Layout:

Layout:
One of the arrangements in which the Picker draws Projects: the Grouped Layout puts them under Kind headers, the List Layout in one flat run.

The picker package uses that name for something else. After #44 it holds three things whose names read backwards against the glossary:

Identifier What it actually is
Layout (struct) per-frame sizing: NameWidth, StatusWidth, TimeWidth, ListWidth, PreviewWidth, ListHeight, ShowPreview, ShowLegend, ShowKeys
ComputeLayout computes that sizing, not the arrangement
LayoutStyle (+ LayoutGrouped, LayoutList) the Layout in the glossary's sense

So the domain term is taken by the frame geometry, and the actual Layout had to be called LayoutStyle to get out of its way. A reader who starts from CONTEXT.md will look for the arrangement under Layout and find column widths.

Proposed solution

Give the arrangement the glossary's name and name the sizing struct for what it is:

  • LayoutStyleLayout, with LayoutGrouped / LayoutList unchanged
  • Layout (struct) → Metrics (or Frame / Geometry)
  • ComputeLayoutComputeMetrics
  • Options.Layout keeps its name and changes type

Config keeps picker.layout with its "grouped" / "list" values: this is an internal naming change with no user-visible effect.

Alternatives considered

  • Leave it. The names work, they just read backwards against the glossary. The cost is paid by every future reader who trusts CONTEXT.md.
  • Rename the glossary term instead (e.g. Arrangement, Presentation) so Layout can stay with the sizing struct. Worse: "layout" is the word the config key, the README and the original issue all use, and it is the term users see.

Additional context

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

    enhancementNew feature or requestneeds-triageMaintainer needs to evaluate this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions