Skip to content

Commit f726423

Browse files
namedgraphclaude
andcommitted
Defer tab activation until rdf-document-response populates the cache
Tab click handler and close-tab fallback eagerly called ldh:ActivateTab, making the pane mouse-targetable before ldh:DocumentNavigate had finished fetching the document and populating LinkedDataHub.contents[$uri]. On a page loaded with ?uri=<external>, the local URI is never in the cache until the user switches back, so any mousemove on a block then hit the nested ixsl:get() in block.xsl and threw an uncaught XError, which also killed the body-level handler that slides in the left sidebar. ldh:RenderTab already runs ldh:ActivateTab at the end of ldh:rdf-document-response, so the eager calls were just trading correctness for an instant visual swap. Removing them aligns tab clicks with how direct navigation works: cursor: progress during the fetch, then tab-bar highlight and pane swap together once the cache is filled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ea50086 commit f726423

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

  • src/main/webapp/static/com/atomgraph/linkeddatahub/xsl

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client.xsl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,8 +1015,6 @@ WHERE
10151015
<!-- proxied tab: $uri is the external target (?uri=…); local tab: $uri is the bare document URI (no query string) - matches data-uri / document-body/@about, so the cache key downstream stays consistent -->
10161016
<xsl:variable name="uri" select="if (map:contains($query-params, 'uri')) then xs:anyURI(map:get($query-params, 'uri')) else ac:absolute-path($href)" as="xs:anyURI"/>
10171017

1018-
<xsl:apply-templates select=".." mode="ldh:ActivateTab"/>
1019-
10201018
<xsl:call-template name="ldh:DocumentNavigate">
10211019
<xsl:with-param name="uri" select="$uri"/>
10221020
<xsl:with-param name="query-params" select="map:remove($query-params, 'uri')"/>
@@ -1040,10 +1038,8 @@ WHERE
10401038
<!-- remove the tab <li> from the DOM -->
10411039
<xsl:sequence select="ixsl:call($tab-li, 'remove', [])[current-date() lt xs:date('2000-01-01')]"/>
10421040

1043-
<!-- if the closed tab was active, activate the fallback and navigate to its URI -->
1041+
<!-- if the closed tab was active, navigate to the fallback's URI (ldh:RenderTab will activate after fetch) -->
10441042
<xsl:if test="$was-active and $fallback-li">
1045-
<xsl:apply-templates select="$fallback-li" mode="ldh:ActivateTab"/>
1046-
10471043
<xsl:variable name="fallback-href" select="xs:anyURI(resolve-uri($fallback-li/a/@href, ldh:base-uri(.)))" as="xs:anyURI"/>
10481044
<xsl:variable name="fallback-query-params" select="ldh:parse-query-params(substring-after($fallback-href, '?'))" as="map(xs:string, xs:string*)"/>
10491045
<xsl:variable name="fallback-uri" select="if (map:contains($fallback-query-params, 'uri')) then xs:anyURI(map:get($fallback-query-params, 'uri')) else ac:absolute-path($fallback-href)" as="xs:anyURI"/>

0 commit comments

Comments
 (0)