Skip to content

Disable followup clicks after freebuff session ends#531

Merged
jahooma merged 1 commit intomainfrom
jahooma/disable-followups
Apr 22, 2026
Merged

Disable followup clicks after freebuff session ends#531
jahooma merged 1 commit intomainfrom
jahooma/disable-followups

Conversation

@jahooma
Copy link
Copy Markdown
Contributor

@jahooma jahooma commented Apr 22, 2026

Summary

After a freebuff session ends, the chat input is swapped out for a SessionEndedBanner, but the suggested-followup buttons from earlier in the transcript stayed clickable (the server grants a 30-minute grace period, so clicks still went through). This extends the disabled gate on FollowupLine to also cover IS_FREEBUFF && session.status === 'ended' — the same condition chat.tsx already uses to show the session-ended banner.

Test plan

  • Start a freebuff session, trigger suggested followups, end the session, and confirm the followup buttons no longer highlight on hover or respond to clicks
  • Confirm followups still work normally in a non-freebuff (Codebuff) session and in an active freebuff session

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 22, 2026

Greptile Summary

This PR fixes a UX bug where suggested-followup buttons remained interactive after a freebuff session ended. The server's 30-minute grace period meant clicks would still succeed, so the fix extends the existing disabled gate on FollowupLine to also cover the IS_FREEBUFF && session.status === 'ended' condition — mirroring the identical check already used in chat.tsx to swap in the SessionEndedBanner.

Changes:

  • Added useFreebuffSessionStore import and a new isFreebuffSessionOver selector in SuggestFollowupsItem
  • Extended the disabled prop passed to FollowupLine with || isFreebuffSessionOver
  • Because IS_FREEBUFF is a build-time constant, this adds zero overhead in non-freebuff builds (dead-code eliminated by the bundler)
  • The pattern is consistent with how chat.tsx detects the same ended-session state

Confidence Score: 5/5

Safe to merge — single-line gate change that correctly mirrors an existing pattern used elsewhere in the codebase.

The change is minimal (one new selector + one boolean OR in the disabled prop), directly mirrors the identical condition already used in chat.tsx, short-circuits safely in non-freebuff builds due to the build-time IS_FREEBUFF constant, and the existing disabled path in FollowupLine already handles the visual and interactive suppression correctly.

No files require special attention.

Important Files Changed

Filename Overview
cli/src/components/tools/suggest-followups.tsx Adds isFreebuffSessionOver derived state and gates FollowupLine's disabled prop on it; logic is correct, consistent with chat.tsx, and harmless in non-freebuff builds.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User hovers / clicks FollowupLine] --> B{disabled?}
    B -->|!inputFocused| C[Block interaction]
    B -->|isFreebuffSessionOver| C
    B -->|neither| D[Allow interaction]
    D --> E[dispatch codebuff:send-followup event]
    E --> F[chat.tsx global handler sends message]

    subgraph isFreebuffSessionOver
        G[IS_FREEBUFF build flag] -->|false| H[always false — dead-code eliminated]
        G -->|true| I{session?.status === 'ended'?}
        I -->|yes| J[true — disable buttons]
        I -->|no| K[false — buttons active]
    end
Loading

Reviews (1): Last reviewed commit: "Disable followup clicks after freebuff s..." | Re-trigger Greptile

@jahooma jahooma merged commit 52fc32e into main Apr 22, 2026
34 checks passed
@jahooma jahooma deleted the jahooma/disable-followups branch April 22, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant