Skip to content

feat(yasgui): show IRI info when hovering an IRI in the editor - #234

Merged
MathiasVDA merged 1 commit into
mainfrom
claude/issue-196-iri-hover-zf206t
Oct 19, 2026
Merged

MathiasVDA merged 1 commit into
mainfrom
claude/issue-196-iri-hover-zf206t

Conversation

@MathiasVDA

Copy link
Copy Markdown
Collaborator

Requested by Mathias · project thread

Before: to find out what era:solNature or an opaque instance IRI in a query means, you had to Ctrl+click it, which replaces the results view.

After: resting the mouse on an IRI or prefixed name in the editor shows a tooltip with its label, full IRI, description, type and (for properties) domain and range. It reminds you of Ctrl+click / Ctrl+Shift+click, and can be switched off in Settings → Editor.

Closes #196

How

  • Yasqe: new iriHover / iriHoverDelay options, using CodeMirror 6's hoverTooltip, and a getIriAt(pos) method that finds the IRI or expanded prefixed name at a position (ignoring variables, literals and blank nodes). The Ctrl+click URI explorer in Tab.ts now uses getIriAt instead of its own token parsing.
  • Yasgui (IriHoverInfo.ts): a SELECT ?p ?o on rdfs:label, skos:prefLabel, rdfs:comment, skos:definition, rdf:type, rdfs:domain, rdfs:range via tab.runBackgroundQuery (tab auth and request settings), 10 s timeout, cached per endpoint + IRI (failures are retried on the next hover). Label and comment prefer the browser languages, then English, then untagged. Types are shortened with the query prefixes plus a few common ones.
  • When the endpoint returns nothing, the same query runs on the LOV SPARQL endpoint (GRAPH ?g). Not verified against the live LOV endpoint, because the cloud environment can't reach it; it fails silently. It can be turned off with iriHoverLovFallback: false.
  • New Yasgui options iriHover (default true) and iriHoverLovFallback (default true), user setting in Settings → Editor, documented in the user and developer guides, plus a changeset.

Tests: test/iri-hover-browser.ts (7 Puppeteer tests against a mocked endpoint: tooltip content, caching, LOV fallback, variables, setting off, getIriAt edge cases, Ctrl+click still works). The full Puppeteer suite and unit tests pass locally. Light and dark screenshots are in the project thread.


Generated by Claude Code

Hovering an IRI or prefixed name in the query editor shows a tooltip with
its label, description, type and (for properties) domain and range,
fetched with a small background query on the tab's endpoint, cached per
endpoint and IRI, with a LOV lookup when the endpoint doesn't describe it.
Can be switched off in Settings > Editor or with the iriHover option.

Yasqe gets the iriHover / iriHoverDelay options and getIriAt(), which the
Ctrl+click URI explorer now uses too.

Closes #196
@MathiasVDA MathiasVDA self-assigned this Oct 19, 2026
@MathiasVDA
MathiasVDA merged commit 227cf5a into main Oct 19, 2026
2 checks passed
@MathiasVDA
MathiasVDA deleted the claude/issue-196-iri-hover-zf206t branch October 19, 2026 21:20
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.

Show label, description and type when hovering an IRI in the query editor

1 participant