Skip to content

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
EvanStreams merged 4 commits into
hackclub:mainfrom
Renjini221:main
Jun 15, 2026
Merged

fix: nav media query listener leak, case-insensitive channel search, race condition in conduct fetch; feat: add Kerala & Tamil Nadu Indian state channels#70
EvanStreams merged 4 commits into
hackclub:mainfrom
Renjini221:main

Conversation

@Renjini221

Copy link
Copy Markdown
Contributor

Fixes

  • Fixed memory leak in components/nav.js: mobile media query change
    listener was never removed on unmount; also fixed initial mobile
    state not being set on first render
  • Fixed case-sensitive search in pages/channels.js
  • Fixed race condition in components/slides/Slides.js: added
    AbortController to cancel in-flight conduct fetch on rapid
    navigation

New features

  • Added Kerala and Tamil Nadu as new "Indian State" channel type
    with its own filter

…race condition in conduct fetch; feat: random channel button, add Kerala & Tamil Nadu Indian state channels
Copilot AI review requested due to automatic review settings June 14, 2026 04:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-state channel type.
  • Update slide “fetch” behavior to use AbortController and avoid setting error state on aborted requests.
  • Refactor header effect to early-return on SSR and properly subscribe/unsubscribe to matchMedia changes.

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 thread pages/channels.js
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 thread pages/channels.js
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 thread pages/channels.js
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 thread channels.json
Comment on lines +416 to +422
"channel":"kerala",
"match":"kerala",
"type":"indian-state",
"url": "https://app.slack.com/client/E09V59WQY1E/C08D8B0STPE",
"id":"C08D8B0STPE"

},
@Renjini221

Copy link
Copy Markdown
Contributor Author

@wally-ben, this PR is just the fixes + Indian state channels, no Random button — as you suggested.

@EvanStreams EvanStreams merged commit 4240e32 into hackclub:main Jun 15, 2026
5 checks passed
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.

4 participants