feat(yasr): add in-session query result history navigation - #177
Merged
Merged
Conversation
Closed
- Add back/forward chevron buttons to the Yasr header (between plugin controls and the download icon) so users can navigate through previous results within the same session - Each setResponse call pushes the result onto an in-memory history stack (capped at 20 entries to prevent unbounded memory growth) - Sending a new response truncates any forward history - Buttons use the native disabled attribute for accessibility - SCSS styles for the new history buttons; restore fullscreen button styles
Copilot
AI
changed the title
[WIP] Add history functionality for query results in session
feat(yasr): add in-session query result history navigation
Sep 12, 2026
…shes (#175) * Initial plan * fix: persist horizontal/vertical orientation across page refreshes * fix: add JSDoc comments to getOrientation/setOrientation * Improve getOrientation method implementation Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mathias Vanden Auweele <mathias@matdata.eu> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…end the result (fixes #176) * Initial plan * feat: Ctrl+Click URI in response plugin runs DESCRIBE and appends result * refactor: surface DESCRIBE failures in response view and tighten typing * refactor: reuse showMore for revealing appended DESCRIBE content * feat: don't describe but retrieve all triples where uri is subject of * docs: also the docker image has been renamed * chore: update prefixes * fix: persist horizontal/vertical layout orientation across page refreshes (#175) * Initial plan * fix: persist horizontal/vertical orientation across page refreshes * fix: add JSDoc comments to getOrientation/setOrientation * Improve getOrientation method implementation Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mathias Vanden Auweele <mathias@matdata.eu> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Fix offset condition in extractUriAtOffset function Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Modify loading behavior in describeUri method Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mathias Vanden Auweele <mathias@matdata.eu> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
There is a confirmed functional mismatch that will fail unit tests (DESCRIBE builder returns a CONSTRUCT query) plus additional correctness/maintainability concerns in the changed code.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR extends the Matgui SPARQL result viewing experience by adding in-session navigation of previous Yasr results, and introduces a “Ctrl/Cmd+Click URI to run DESCRIBE” workflow in the Response plugin. It also includes some additional UI persistence and documentation/link updates.
Changes:
- Add an in-memory back/forward result history stack to
Yasr, with header navigation buttons. - Add Response plugin URI utilities + Ctrl/Cmd+Click behavior to execute a DESCRIBE and append returned triples; includes new unit tests.
- Persist Yasgui layout orientation and update Docker Hub/documentation links.
File summaries
| File | Description |
|---|---|
| website/docusaurus.config.ts | Updates Docker Hub link to the matgui image. |
| test/unit/response-uri-utils-test.ts | Adds unit tests for URI extraction and DESCRIBE query building. |
| README.md | Updates Docker Hub URLs and docker run examples to mathiasvda/matgui. |
| packages/yasr/src/plugins/response/uriUtils.ts | Adds testable helpers for extracting URIs and building a DESCRIBE query. |
| packages/yasr/src/plugins/response/index.ts | Adds Ctrl/Cmd+Click handling to run a DESCRIBE query and append results to the response view. |
| packages/yasr/src/main.scss | Styles new Yasr history navigation buttons with disabled-aware hover behavior. |
| packages/yasr/src/index.ts | Implements Yasr result history stack + back/forward navigation buttons. |
| packages/yasqe/src/prefixes.json | Reorders/adds prefixes (data update). |
| packages/yasgui/src/Tab.ts | Persists orientation changes when toggling layout. |
| packages/yasgui/src/PersistentConfig.ts | Adds getters/setters for persisted orientation (and stores it). |
| packages/yasgui/src/index.ts | Loads persisted orientation at startup. |
| docs/user-guide.md | Updates Docker commands and documents the new Ctrl/Cmd+Click DESCRIBE behavior in the Response plugin. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+159
to
+163
| const query = buildDescribeQuery(uri); | ||
| try { | ||
| this.yasr.showLoading(); | ||
| const response = await this.yasr.executeQuery(query, { acceptHeader: this.getDescribeAcceptHeader() }); | ||
| if (this.cm !== cmAtStart) return; |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.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.
Yasr had no way to revisit previous query results within a session — each new response overwrote the last.
Changes
packages/yasr/src/index.tsresultHistory, capped at 20 entries) of raw response data per Yasr instancesetResponsetruncates forward history on new queries, pushes the new entry, and updates navigation statedrawHistoryButtons()renders back/forward chevron buttons (fa-chevron-left/fa-chevron-right) in the header between the plugin controls and the download icon — created once, guarded against re-creation on subsequentdraw()callsnavigateHistory(direction)replays a history entry by reinstantiatingParserand callingdraw()disabledattribute (not a CSS class) for correct focus/keyboard/AT behaviourpackages/yasr/src/main.scss.yasr_btn_historystyles with[disabled]-aware hover suppressionBehaviour
History is in-memory only and does not persist across page reloads.