Skip to content

Scope modal forms to active tab pane and promise-ify their handlers#302

Merged
namedgraph merged 5 commits into
developfrom
rf-doc-uri-fragment
May 19, 2026
Merged

Scope modal forms to active tab pane and promise-ify their handlers#302
namedgraph merged 5 commits into
developfrom
rf-doc-uri-fragment

Conversation

@namedgraph
Copy link
Copy Markdown
Member

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.

namedgraph and others added 5 commits April 5, 2026 23:01
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>
@namedgraph namedgraph changed the base branch from master to develop May 19, 2026 09:39
@namedgraph namedgraph merged commit 8b8aa5d into develop May 19, 2026
1 check failed
@namedgraph namedgraph deleted the rf-doc-uri-fragment branch May 19, 2026 09:50
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