From 3f602c37ab24a9e1ec1a848e674f96b24fdf4db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Jusevi=C4=8Dius?= Date: Sun, 17 May 2026 00:32:18 +0200 Subject: [PATCH] Path-aware view ordering for modal search; assorted fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit View block now derives a variable→predicate-URI-set map from the SELECT's BGPs (handling alternative property paths like rdfs:label|sh:name|... whose items are URIs) and drives three things from it: the order-by dropdown (one option per variable, deduped), auto-pickup of ORDER BY from the SELECT, and a COALESCE-style client-side sort key that prefers literals whose @xml:lang primary subtag matches $ac:lang. `ORDER BY ?label` baked into $select-labelled-string so the modal search returns alphabetically by label. Search modal: form moved into the modal-header with a magnifier submit button; `.search-form-modal` CSS extends `.search-form`'s flex layout so input + button fit naturally. Empty address-bar submit button removed from the navbar-form (its ldh:logo template was never added; pressing Enter still submits). $ac:lang now reads the primary subtag of navigator.language so existing `lang($ac:lang)` checks (which spec-match `xml:lang='en'` for input `'en'`, not for `'en-US'`) keep working under browser preferences like `en-US`. Block mousemove handler guards the LinkedDataHub.contents cache lookup with ixsl:contains to avoid a warning per pixel when the hovered document-body's URI isn't cached. Local-document navigation handlers (tab activate, tab-close fallback, popstate, generic link click) now strip the query string from $uri via ac:absolute-path before passing it to ldh:DocumentNavigate. The cache key downstream now matches document-body/@about / tab data-uri, both already canonicalised via ac:absolute-path. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../atomgraph/linkeddatahub/css/bootstrap.css | 10 +- .../xsl/bootstrap/2.3.2/client/block.xsl | 17 +- .../xsl/bootstrap/2.3.2/client/block/view.xsl | 157 +++++++----- .../xsl/bootstrap/2.3.2/client/navigation.xsl | 224 +++++++++++++++++- .../xsl/bootstrap/2.3.2/layout.xsl | 12 +- .../xsl/bootstrap/2.3.2/translations.rdf | 12 + .../atomgraph/linkeddatahub/xsl/client.xsl | 113 +-------- 7 files changed, 357 insertions(+), 188 deletions(-) diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/css/bootstrap.css b/src/main/webapp/static/com/atomgraph/linkeddatahub/css/bootstrap.css index f1c7f6e02..0199823ea 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/css/bootstrap.css +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/css/bootstrap.css @@ -1,4 +1,4 @@ -html { height: 100%; overscroll-behavior-y: none; } +html { height: 100%; } /* only the main navbar is fixed-top now; tab bar + action bar are sticky inside #tab-body */ body { height: calc(100% - 51px); padding-top: 51px; padding-bottom: 0; } #tab-bar { position: sticky; top: 51px; z-index: 1000; margin-bottom: 0; } @@ -27,8 +27,10 @@ ul.dropdown-menu ul { margin: 0; } .dropdown-menu li form { margin-bottom: 0; } .dropdown-menu li form button { width: 100%; text-align: left; } #collapsing-top-navbar .brand.context { display: inline-block; vertical-align: middle; } -.navbar-form input#uri { width: calc(100% - 50px); } -.navbar-form .btn-search { background-image: url('../icons/ic_search_white_24px.svg'); background-position: center center; background-repeat: no-repeat; width: 34px; height: 34px; } +.btn-search { background-image: url('../icons/ic_search_white_24px.svg'); background-position: center center; background-repeat: no-repeat; width: 34px; height: 34px; } +.search-form .input-append, .search-form-modal .input-append { display: flex; width: 100%; align-items: stretch; } +.search-form .input-append .search-query, .search-form-modal .input-append .search-query { flex: 1 1 auto; min-width: 0; height: 34px; box-sizing: border-box; margin: 0; } +.search-form .input-append .btn-search, .search-form-modal .input-append .btn-search { flex: 0 0 34px; margin: 0; } .action-bar { position: sticky; top: var(--action-bar-top, 51px); z-index: 999; background: #dfdfdf; padding: 0; box-shadow: none; } .action-bar form { margin-bottom: 0; } .action-bar .span7 .row-fluid > * { margin-top: 10px; } @@ -165,7 +167,7 @@ fieldset fieldset { margin-left: 3%; margin-bottom: 3%; } .constructor-triple .controls label.radio { display: inline-block; padding-top: 10px; margin-right: 10px; } .constructor-triple .controls .help-inline { vertical-align: top; padding-top: 5px; } .control-group.error .checkbox, .control-group.error .radio, .control-group.error input, .control-group.error select, .control-group.error textarea { color: unset; } -#uri { height: 24px; } +#uri { height: 24px; width: 100%; } #query-form fieldset { border: initial; margin: initial; } button.add-typeahead { width: 219px; } .btn.btn-remove-property, .btn.btn-remove-resource { background-image: url('../icons/ic_remove_black_24px.svg'); background-position: center center; background-repeat: no-repeat; height: 30px; width: 30px; } diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block.xsl index b9390a0c5..c432f02ac 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block.xsl @@ -237,10 +237,14 @@ exclude-result-prefixes="#all" - - - - + + + + + + + + @@ -286,10 +290,11 @@ exclude-result-prefixes="#all" - + + - + diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block/view.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block/view.xsl index 0ad6ce5cd..30bbe2a9f 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block/view.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block/view.xsl @@ -104,6 +104,19 @@ exclude-result-prefixes="#all" "/> + + + + + + + + + + + + + @@ -354,31 +367,6 @@ exclude-result-prefixes="#all" on-failure="ldh:promise-failure#1"/> - - - - - - - - - - - @@ -525,11 +513,7 @@ exclude-result-prefixes="#all" - - - - - + @@ -768,9 +752,9 @@ exclude-result-prefixes="#all" - + - + @@ -817,6 +801,19 @@ exclude-result-prefixes="#all" + + + + + + + + @@ -855,24 +852,24 @@ exclude-result-prefixes="#all" - - - - - - + + + + + + + - - + @@ -1348,8 +1345,7 @@ exclude-result-prefixes="#all" - - + @@ -1822,24 +1818,53 @@ exclude-result-prefixes="#all" ldh:render-view - - + + + + + + + + + + + + + + + - + - + - - - - + + + + @@ -1853,12 +1878,12 @@ exclude-result-prefixes="#all" - + - + @@ -2236,27 +2261,29 @@ exclude-result-prefixes="#all" - - - + + - - - - ldh:order-by-response + + - - - + @@ -2265,5 +2292,5 @@ exclude-result-prefixes="#all" - + \ No newline at end of file diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/navigation.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/navigation.xsl index 516accf02..694a66207 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/navigation.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/navigation.xsl @@ -94,6 +94,18 @@ ORDER BY DESC(?created) + + +