fix: nav media query listener leak, case-insensitive channel search, race condition in conduct fetch; feat: add Kerala & Tamil Nadu Indian state channels#70
Merged
Conversation
…race condition in conduct fetch; feat: random channel button, add Kerala & Tamil Nadu Indian state channels
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR extends channel filtering to support an additional “indian-state” channel type, improves fetch cancellation for slide content, and tightens client-only event listener setup in the header.
Changes:
- Add “Indian State” labeling, filtering, counts, and UI filter button for the new
indian-statechannel type. - Update slide “fetch” behavior to use
AbortControllerand avoid setting error state on aborted requests. - Refactor header effect to early-return on SSR and properly subscribe/unsubscribe to
matchMediachanges.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| pages/channels.js | Adds indian-state support (label, filter, counts, UI) and updates search matching logic |
| components/slides/Slides.js | Adds request cancellation via AbortController for /api/conduct fetch |
| components/nav.js | Improves SSR guard and properly removes matchMedia change listener |
| channels.json | Adds new indian-state channel entries |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
107
to
112
| const filtered = useMemo(() => { | ||
| return channels.filter((c) => { | ||
| const matchesSearch = | ||
| c.channel.includes(search.toLowerCase()) || | ||
| c.match.includes(search.toLowerCase()) | ||
| const matchesSearch= | ||
| c.channel.toLowerCase().includes(search.toLowerCase())|| | ||
| c.match.toLowerCase().includes(search.toLowerCase()) | ||
| const matchesFilter = |
Comment on lines
14
to
20
| const getTypeLabel = (type) => { | ||
| if (type === 'us-state') return 'US State' | ||
| if (type === 'island') return 'Island' | ||
| if (type === 'indian-state')return 'Indian State' | ||
|
|
||
| return 'Country' | ||
| } |
Comment on lines
+244
to
+247
| <FilterButton active={filter==='indian-state'} onClick={()=>setFilter('indian-state')}> | ||
| Indian States({counts['indian-state']}) | ||
| </FilterButton> | ||
|
|
Comment on lines
+476
to
479
| fetch('/api/conduct',{signal:controller.signal}) | ||
| .then((res)=>{ | ||
| if(!res.ok)throw new Error("failed to fetch") | ||
| return res.text() |
Comment on lines
+416
to
+422
| "channel":"kerala", | ||
| "match":"kerala", | ||
| "type":"indian-state", | ||
| "url": "https://app.slack.com/client/E09V59WQY1E/C08D8B0STPE", | ||
| "id":"C08D8B0STPE" | ||
|
|
||
| }, |
Contributor
Author
|
@wally-ben, this PR is just the fixes + Indian state channels, no Random button — as you suggested. |
wally-ben
approved these changes
Jun 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
listener was never removed on unmount; also fixed initial mobile
state not being set on first render
AbortController to cancel in-flight conduct fetch on rapid
navigation
New features
with its own filter