frontend-patterns/research/candidates/URLAddressableState.md

50 lines
2.6 KiB
Markdown
Raw Normal View History

---
title: URL-addressable State
status: draft
maturity: hypothesis
families: [address, projection]
scales: [L3]
admission: research-candidate-only
---
# URL-addressable State
Context: readers need to share, bookmark and revisit a resource or selected view.
Problem: an address change can conceal state that only exists in the current tab.
Addressability competes with private/transient state and URL/schema stability.
Proposed solution: encode the public, stable resource identity and relevant view
selection in path/query parameters. Define parameter validation, defaults and route
resolution so direct entry and reload reconstruct that selection under current
authorization. A URL identifies a view, not necessarily immutable bytes or guaranteed
future availability. Use an explicit version if a stable historical snapshot matters.
Do not place secrets, private draft content, focus or every transient interaction
in the address. An identifier confers no authorization. Server-visible query/path
state and fragment-only state have different resolution contracts. If history is
enhanced, back/forward, cache misses and direct loads must resolve coherently;
pushState success alone is insufficient.
Consequences: views become independently reachable, but parameter compatibility,
invalid/deleted resources and full-versus-fragment cache behavior need contracts.
Alternatives: ephemeral in-tab selection when sharing is unnecessary; authenticated
saved-view identifiers when the selection is too large or private for the URL.
Evidence: [navigation review](../reviews/NavigationRenderingEvidence.md) N01/N02/N06
locates documentation mechanisms, not verified deployments of this whole proposal.
Full-pattern known uses and recurrence remain unknown. Refines the existing URL as
Application State seed; no canonical identity or admitted relations.
Proposed connection: [Progressive Enhancement](ProgressiveEnhancement.md) can preserve
native navigation while adding faster transitions; it is optional, not required by
addressability. [VC-03](../walkthroughs/VC03-ContentPublication.md) is a synthetic trace.
## Prospective runtime corroboration — 2026-09-27
Direct filtered entry, reload, snapshot restoration and explicit history-miss recovery
preserve selection in a pinned htmx fixture. Omitting representation Vary reproduces
a fragment served as a full document in Chromium and Firefox; correct selection
keeps representations distinct, without promising cache retention or freshness.
See [NH01–NH06](../reviews/NavigationHistoryExperiment.md). One authored application
with a real package, not independent deployed recurrence. Hypothesis retained.