Skip to content

Comments

Update URL hash when category filter is applied#54

Merged
brunoborges merged 2 commits intomainfrom
copilot/update-url-with-filter-hash
Feb 19, 2026
Merged

Update URL hash when category filter is applied#54
brunoborges merged 2 commits intomainfrom
copilot/update-url-with-filter-hash

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

Filter state on the homepage was ephemeral — no way to share a filtered view via URL.

Changes

  • Hash sync on filter click: history.replaceState writes #<category> to the URL when a filter is activated; clears the hash when "All" is selected or the active filter is toggled off.
  • Load-time filter restore: On DOMContentLoaded, reads window.location.hash and clicks the matching pill instead of unconditionally defaulting to "All".
  • hashchange listener: Applies the correct filter when the hash changes externally (browser back/forward, direct URL edit).

Shared URLs like https://javaevolved.github.io/#streams now land directly on the Streams-filtered view.

Original prompt

This section details on the original issue you should resolve

<issue_title>Update URL with filter hash</issue_title>
<issue_description>When user filters, update the url with hash for the filter category such as #enterprise, so users can share that category in particular. Filter automatically when loaded, of course.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Update URL with filter hash for sharing Update URL hash when category filter is applied Feb 19, 2026
@brunoborges brunoborges marked this pull request as ready for review February 19, 2026 20:50
@brunoborges brunoborges merged commit 2288377 into main Feb 19, 2026
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.

Update URL with filter hash

2 participants