Skip to content

fix(channel): restore thread reply fetch debounce#5040

Merged
synoet merged 1 commit into
mainfrom
agent/restore-channel-thread-fetch-debounce
Jul 20, 2026
Merged

fix(channel): restore thread reply fetch debounce#5040
synoet merged 1 commit into
mainfrom
agent/restore-channel-thread-fetch-debounce

Conversation

@synoet

@synoet synoet commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Restore a 300 ms cold-start debounce before channel thread reply queries become enabled.
  • Keep the immediate path only for the currently targeted reply while the channel Cmd+F find bar is open.
  • Cancel pending debounce timers when transiently mounted threads unmount.

Why

PR #3305 unintentionally removed the existing reply-fetch debounce while optimizing in-channel search. That allowed transiently mounted virtualized threads to enable reply queries immediately. Normal expansion and non-search deep-link navigation are now debounced; Cmd+F retains immediate targeted-reply navigation.

Validation

  • bunx vitest run src/features/channel/Thread/tests — 27 tests passed
  • bun run check — type-check and Biome passed

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 563575cf-effd-4abb-974e-79cb8fb2f955

📥 Commits

Reviewing files that changed from the base of the PR and between 816d9b1 and 49c77a4.

📒 Files selected for processing (6)
  • apps/web/src/features/channel/Channel/Channel.tsx
  • apps/web/src/features/channel/Thread/ChannelThread.tsx
  • apps/web/src/features/channel/Thread/create-thread-replies-fetch-gate.ts
  • apps/web/src/features/channel/Thread/tests/create-thread-replies-fetch-gate.test.ts
  • apps/web/src/features/channel/Thread/types.ts
  • apps/web/src/lib/core/util/debounce.ts

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved thread reply loading while using the channel find bar.
    • Added a brief delay to prevent unnecessary reply fetches during temporary thread navigation or expansion.
    • Canceled pending reply loads when threads are closed or unmounted.
  • Tests
    • Added coverage for delayed loading, immediate find-bar navigation, and cleanup behavior.

Walkthrough

Channel threads now receive the channel find-bar state and use a dedicated reactive gate for reply fetching. The gate immediately enables targeted replies while the find bar is open and debounces expanded, targeted, or high-count thread fetches. The deferred gate is exported and cancels pending timers on scope disposal. Tests cover debounce timing, immediate find-bar targeting, and cleanup on unmount.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format and clearly summarizes the debounce restoration.
Description check ✅ Passed The description is directly related to restoring thread reply fetch debounce behavior and validation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@synoet
synoet marked this pull request as ready for review July 20, 2026 18:40
@github-actions

Copy link
Copy Markdown

@synoet
synoet merged commit 8b9b6e4 into main Jul 20, 2026
41 of 44 checks passed
@synoet
synoet deleted the agent/restore-channel-thread-fetch-debounce branch July 20, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants