Skip to content

feat(web-player): use URL hash for channel deep links - #716

Merged
stackia merged 1 commit into
mainfrom
feat/player-channel-hash-urls
Aug 17, 2026
Merged

feat(web-player): use URL hash for channel deep links#716
stackia merged 1 commit into
mainfrom
feat/player-channel-hash-urls

Conversation

@stackia

@stackia stackia commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

Migrate player deep links from query parameters (?channel_id=1, ?channel_name=...) to URL hash fragments (#5, #CCTV-1). Hash-based navigation is more appropriate for SPAs and avoids sending routing state to the server.

Related: #698

Changes

  • URL format: Changed from /player?channel_name=name to /player#name (or /player#id when ambiguous)
  • Deep link resolution: findDeepLinkChannel() now reads from window.location.hash instead of query params
  • Smart ID vs name selection: Added channelNameIsAmbiguous() and channelDeepLinkToken() to choose the most readable yet unambiguous token
    • Prefers channel name for readability
    • Falls back to ID when name is non-unique or matches an ID
  • Hash change listener: Added hashchange event handler so back/forward navigation and manual hash edits switch channels
  • URL sync: syncChannelDeepLink() now rewrites the hash instead of query params
  • Tests: Removed e2e test for old query parameter format
  • Documentation: Updated guide to show new hash-based syntax and clarify matching rules

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview

The documentation preview has been deployed for this pull request.

@stackia
stackia merged commit afa1bb7 into main Aug 17, 2026
8 of 11 checks passed
@stackia
stackia deleted the feat/player-channel-hash-urls branch August 17, 2026 17:27
Tubetrue01 pushed a commit to Tubetrue01/rtp2httpd that referenced this pull request Aug 18, 2026
## Summary

Migrate player deep links from query parameters (`?channel_id=1`,
`?channel_name=...`) to URL hash fragments (`stackia#5`, `#CCTV-1`). Hash-based
navigation is more appropriate for SPAs and avoids sending routing state
to the server.

Related: stackia#698

## Changes

- **URL format**: Changed from `/player?channel_name=name` to
`/player#name` (or `/player#id` when ambiguous)
- **Deep link resolution**: `findDeepLinkChannel()` now reads from
`window.location.hash` instead of query params
- **Smart ID vs name selection**: Added `channelNameIsAmbiguous()` and
`channelDeepLinkToken()` to choose the most readable yet unambiguous
token
  - Prefers channel name for readability
  - Falls back to ID when name is non-unique or matches an ID
- **Hash change listener**: Added `hashchange` event handler so
back/forward navigation and manual hash edits switch channels
- **URL sync**: `syncChannelDeepLink()` now rewrites the hash instead of
query params
- **Tests**: Removed e2e test for old query parameter format
- **Documentation**: Updated guide to show new hash-based syntax and
clarify matching rules
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.

1 participant