Skip to content

Conversation

@pfefferle
Copy link
Member

  1. parseHash() function (lines 26-41):
    • Parses URL hash like #/followers or #/followers/abc123
    • Returns both section and optional itemId
    • Defaults to 'dashboard' if no hash present
  2. updateHash() function (lines 43-49):
    • Updates URL hash without page reload
    • Uses window.history.pushState() for clean history management
  3. URL Initialization (lines 55-60):
    • Reads URL hash on component mount
    • Sets initial section and item from URL
  4. Hash Change Listener (lines 62-74):
    • Listens for browser back/forward navigation
    • Updates state when hash changes
  5. Navigation Handlers:
    • handleNavigate() - Updates URL when switching sections
    • handleSelectItem() - Updates URL when viewing item details
    • handleCloseInspector() - Removes item from URL

Proposed changes:

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Go to '..'

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

1. parseHash() function (lines 26-41):
    - Parses URL hash like #/followers or #/followers/abc123
    - Returns both section and optional itemId
    - Defaults to 'dashboard' if no hash present
  2. updateHash() function (lines 43-49):
    - Updates URL hash without page reload
    - Uses window.history.pushState() for clean history management
  3. URL Initialization (lines 55-60):
    - Reads URL hash on component mount
    - Sets initial section and item from URL
  4. Hash Change Listener (lines 62-74):
    - Listens for browser back/forward navigation
    - Updates state when hash changes
  5. Navigation Handlers:
    - handleNavigate() - Updates URL when switching sections
    - handleSelectItem() - Updates URL when viewing item details
    - handleCloseInspector() - Removes item from URL
@pfefferle pfefferle requested a review from obenland October 30, 2025 11:20
@pfefferle pfefferle self-assigned this Oct 30, 2025
@github-actions github-actions bot added the [Focus] Editor Changes to the ActivityPub experience in the block editor label Oct 30, 2025
@obenland
Copy link
Member

I'm fine with going with this for now. Before release, I'd like to check if we can make query-based URLs work, maybe use a proper router like tanstack.

@pfefferle pfefferle merged commit 601ca15 into refactor/social-web-ui-second-pass Oct 30, 2025
4 checks passed
@pfefferle pfefferle deleted the add/reader-ui-hash-urls branch October 30, 2025 13:24
@pfefferle
Copy link
Member Author

Will check out tanstack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Focus] Editor Changes to the ActivityPub experience in the block editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants