Skip to content

web: composer strip capacity wiring in ChatView has no regression test #437

Description

@rynfar

Gap

The defect fixed in #432 was that ChatView never told the context strip about the capacity readout, so the strip collapsed on a non-Git project and took a live reading with it.

That PR's tests cover the two pure functions on either side of the gap:

  • shouldShowComposerContextStrip — does the right thing given hasCapacityReading
  • hasComposerUsageContent — reports whether there is a reading

Neither covers the wiring between them, which is where the bug actually lived. Replacing hasCapacityReading: composerUsageHasContent with false at ChatView.tsx:5484 and :5491 restores the original bug, and the entire suite still passes.

Suggested approach

apps/web/src/components/ChatView.logic.test.ts already exists as a home for ChatView-level derivations. Extracting the strip-input assembly into a pure function there — inputs to { mount, show } — would make the regression catchable. A rendering test asserting the strip stays visible for a non-Git project with a reading would also do it.

Worth pairing with #436, since a design that removes the parent-side enumeration would change what needs testing here.

Notes

Raised during review of #432; left out to keep that PR to one concern.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions