• wwwillchen-bot's avatar
    Move context limit banner from MessagesList to ChatInput (#2461) · 1fe9bc2a
    wwwillchen-bot 提交于
    ## Summary
    - Relocated the `ContextLimitBanner` from the bottom of `MessagesList`
    to above the chat input area in `ChatInput` for better visibility
    - Moved the `useCountTokens` hook from `MessagesList` to `ChatInput` and
    removed the now-unused `tokenCountResult` from the footer context
    - Updated e2e tests to look for the banner inside the
    `chat-input-container`
    
    ## Test plan
    - [ ] Verify the context limit banner appears above the chat input when
    token usage is high
    - [ ] Verify the context limit banner does not appear when token usage
    is within limits
    - [ ] Run existing e2e tests: `PLAYWRIGHT_HTML_OPEN=never npm run e2e --
    context_limit_banner`
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    <!-- devin-review-badge-begin -->
    
    ---
    
    <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2461">
      <picture>
    <source media="(prefers-color-scheme: dark)"
    srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
    <img
    src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
    alt="Open with Devin">
      </picture>
    </a>
    <!-- devin-review-badge-end -->
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Moved the context limit banner to display above the chat input for
    better visibility when near the limit or when long contexts would cost
    extra. Addresses Linear issue 1770154755693.
    
    - **Refactors**
    - Moved useCountTokens to ChatInput and removed tokenCountResult from
    MessagesList footer context.
    - Updated e2e tests to assert the banner inside chat-input-container;
    added a model-picker test id and a custom test model to cover long
    context.
    
    <sup>Written for commit 04f5b40d66c9efb8d358ce75afa4d9a24258654e.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    
    ---------
    Co-authored-by: 's avatarWill Chen <willchen90@gmail.com>
    Co-authored-by: 's avatarClaude Opus 4.5 <noreply@anthropic.com>
    1fe9bc2a
ContextLimitBanner.tsx 2.1 KB