Scope modal forms to active tab pane and promise-ify their handlers#302
Merged
Conversation
The client-side navigation pipeline overloaded a single $uri to mean both "doc to fetch/cache" and "resource to display." Different consumers silently stripped or kept different parts, surfacing as: blank panes on fragment-bearing link clicks, mode toggles ignored when the doc was cached, URL bar gaining a re-encoded fragment after forth-and-back navigation across the local tab. Split into explicit components, threaded through every entry point: - $doc-uri (no fragment, no query) — cache key (LinkedDataHub.contents), tab <li> data-uri, pane @about, every lookup predicate. Always via ac:absolute-path. - $fragment — the sub-anchor; lives on the outer URL per RFC 3986, extracted via ac:fragment-id($href). Round-tripped through tab @href via the 3-arity ldh:href. - $query-params — mode/forClass/etc.; callers strip the URL fragment via ac:document-uri before passing to ldh:parse-query-params, so no caller can corrupt the last value by gluing the fragment onto it. Touched: ldh:DocumentNavigate, ldh:RDFDocumentLoad, ldh:rdf-document-response, ldh:RenderTab, ldh:ActivateTab, ldh:TabSwitch, ldh:AddTabNavBarListItem; the four event handlers (main, link click, tab click, popstate), close-tab fallback, navbar-form, onDelete, onRDFFileUpload; modal/form callers in bootstrap/2.3.2/client. bs2:TabBody and bs2:DocumentBody now take @about as a mandatory param; the no-op ixsl:set-attribute workaround (operating on a detached node after ixsl:replace-element) is removed; layout.xsl passes @about server-side. TabSwitch gate requires cache hit AND non-uri query params unchanged (deep-equal vs ldh:query-params()); mode changes correctly fall through to DocumentNavigate, so the rendered DOM gets refreshed. ldh:query-params is now defined once (imports/default.xsl); the client-side override that wrapped ixsl:query-params() shadowed fragment-safe parsing and is removed. The remaining direct ixsl:query-params() callers (ac:query stylesheet param, navigation.xsl mode tunnel) go through ldh:query-params() too. Anchor-emitting server templates (xhtml:Anchor, svg:Anchor, @Rdf:resource|srx:uri) drop the encoded-full-URI fragment convention: $fragment = ac:fragment-id(.), $href via ac:document-uri. External resource links become ?uri=<doc-uri>#<frag> instead of ?uri=<doc-uri%23frag>#<encoded-full-uri>. Scroll-to-fragment in RenderTab and TabSwitch uses [@about = $resource-uri] in the active pane, replacing id($fragment, ixsl:page()). Sidesteps the DOM-id uniqueness constraint when two panes both render a resource at #this — the RDFa-emitted @about is resource-URI-scoped, naturally unique. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Modals (class-instances, geo, latest, search) and the Add Data / Save As / Reconcile forms now mount inside the active pane's content-body instead of document body, with pane-scoped @id and a data-container-id hook so multiple tabs no longer collide on a single shared modal id. Selectors targeting these modals move from fixed @id to CSS classes (modal-class-instances, modal-geo, modal-latest, modal-search). Converts the access / endpoint-classes / typeahead-resource handlers from xsl:schedule-action named templates to ixsl:promise chains backed by ldh:*-response functions, matching the rest of the client. The typeahead-fetching half of ldh:ShowAddDataForm is extracted to a new ldh:LoadTypeaheads helper so callers compose the two steps explicitly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modals (
class-instances,geo,latest,search) and the Add Data / Save As / Reconcile forms now mount inside the active pane'scontent-bodyinstead of document body, with pane-scoped @id and a data-container-id hook so multiple tabs no longer collide on a single shared modal id.Selectors targeting these modals move from fixed
@idto CSS classes (modal-class-instances,modal-geo,modal-latest,modal-search).Converts the
access/endpoint-classes/typeahead-resourcehandlers fromxsl:schedule-actionnamed templates toixsl:promisechains backed byldh:*-responsefunctions, matching the rest of the client. The typeahead-fetching half ofldh:ShowAddDataFormis extracted to a newldh:LoadTypeaheadshelper so callers compose the two steps explicitly.