Gallery search and filters stop working after you come back to /templates through a site link
Mantenedores costumam responder em até 1 dia
Avaliação
Esta issue ainda não foi avaliada.
Descrição
The gallery's search box and category pills stop working once you come back to /templates through a link on the site. On https://og.codercops.com:
- Open
/templates. Typing "dark" filters the gallery, and the GitHub pill shows 10 templates. - Click "Preview" in the header, then "Templates".
- Type "dark" or click a category pill. All 110 templates stay on screen, the "Showing" line doesn't change, and there's no error in the console.
The site uses Astro's <ClientRouter /> (src/layouts/Layout.astro, line 75), so links inside the site swap the page without a full reload. The router runs each script once until the next full reload: it remembers scripts by their text and skips any it has already run, unless the script has data-astro-rerun. The gallery's code is a top-level <script is:inline> (src/pages/templates.astro, lines 80 to 163), so the second time the page is shown, nothing attaches listeners to the new search box and pills, and ?q= and ?category= aren't read either.
What to do
- Put the gallery setup in a function and run it on
astro:page-load, which fires on the first load and after every navigation.Layout.astrodoes this for the scroll animations (line 107). - The event fires on every page, so return early when the gallery isn't on the page.
- Attach the listeners once per visit to
/templates, not once more for every navigation. - If you'd rather add
data-astro-rerun, wrap the code in a function first: run twice, the script's top-levelconsts would be declared twice and it would throw. - Keep the search matching names, descriptions and tags (#147), and keep
?q=and?category=working.
Where to look
src/pages/templates.astro: the script at lines 80 to 163src/layouts/Layout.astro:<ClientRouter />(line 75) and theastro:page-loadlistener (line 107)src/components/Header.astro(line 11) andsrc/components/Footer.astro(line 20) link to/templates
Acceptance criteria
- After going from
/templatesto another page and back with the header or footer link, the search box and the category pills filter the gallery, and the "Showing" line updates - Going back and forth several times still works, without adding another set of listeners each time
- Opening
/templates?q=dark&category=githubdirectly still applies both -
npm run check,npm run testandnpm run buildpass - The PR says how you tested the navigation in a browser with
npm run dev
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>.
- Linguagem predominante
- TypeScript
- Estrelas
- 8
- Forks
- 4
- Merge médio
- 6h 40min
- PRs com merge (30d)
- 106
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de codercops/ogcops
-
Add the Year in Review developer template (`developer-year-review`)Talvez já em andamento @Saifjafri212213 assumiu hoje. Abertagood first issue hacktoberfest templates
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 79/100
codercops/ogcops#248 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
good first issue hacktoberfest templates
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 79/100
Mantenedores costumam responder em até 1 dia
-
Add the Listen On podcast template (`podcast-listen-on`)Talvez já em andamento @srujankaleru2007 assumiu hoje. Abertagood first issue hacktoberfest templates
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 76/100
codercops/ogcops#243 · 2 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Add the Benefits job template (`job-benefits`)Talvez já em andamento @piyusshhjangid assumiu hoje. Abertagood first issue hacktoberfest templates
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 78/100
codercops/ogcops#242 · 3 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Add the Scheduled Maintenance SaaS template (`saas-maintenance`)Talvez já em andamento @prakashNalla assumiu há 3 dias. Abertagood first issue hacktoberfest templates
codercops/ogcops#204 · 2 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de codercops/ogcops
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
openremote/openremote#3487 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
coollabsio/jean#867 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
ehmpathy/rhachet-roles-bhuild#616 ·
Mantenedores costumam responder em até 1 dia
-
📘 Docs supabase/cli
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
Mantenedores costumam responder em até 1 dia
-
bug(cli): theme file home-directory check uses startsWith (sibling dirs pass, Windows casing fails)Abertaarea/core kind/bug priority/p2 status/bot-triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
google-gemini/gemini-cli#29955 · 2 comentários ·
Mantenedores costumam responder em até 1 dia