Skip to content

web: composer context strip visibility is modelled in the parent, one flag per child #436

Description

@rynfar

The shape of the problem

shouldShowComposerContextStrip (BranchToolbar.logic.ts:58) decides whether the composer context strip is visible by re-deriving, in the parent, whether each of its children will render:

hasActiveProject && (isGitRepo || showEnvironmentIndicator || hostsRestingComposerControls || hasCapacityReading)

One boolean per child, assembled in ChatView and passed down — a parallel model of what BranchToolbar actually draws. The two can drift, and when they do the failure is always one of two visible bugs:

Why it is worth changing

Both bugs above are the same bug from opposite directions, and each was found separately, months apart. The next item added to the strip — a token or context readout, a queue badge, anything — silently reproduces one of them unless whoever adds it also remembers to add a flag, wire it through ChatView, and cover it.

hasCapacityReading was added in #432 specifically because the capacity readout was the third kind of content and nobody had taught the predicate about it.

Possible directions

  • Let BranchToolbar report its own emptiness upward. It already measures itself (stripElement, useLabelsOverflow), so it knows whether it rendered anything.
  • Or collapse the strip from CSS on :empty / :has(), so emptiness is structural rather than modelled.

Either removes the parent's need to enumerate children at all.

Notes

Design/altitude issue rather than a live defect. Raised during review of #432 and deliberately left out of it to keep that PR to one concern.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions