Skip to content

Conversation

Copy link

Copilot AI commented Dec 24, 2025

Users can now customize which output plugins are preferred for SELECT/ASK vs CONSTRUCT/DESCRIBE queries. Previously, plugin selection was determined solely by plugin priority values.

Changes

Core Plugin Selection Logic

  • PersistentConfig: Added pluginOrder field storing separate arrays for select and construct query types
  • getCompatiblePlugins(): Modified to respect user-defined order while maintaining priority-based fallback
  • getQueryResultType(): New method detecting query type from Parser response format (json/xml/csv → select, turtle/trig → construct)

Settings UI

  • Output Preferences tab: New section in TabSettingsModal with two drag-and-drop lists
  • SortableJS integration: Handle-based reordering with visual feedback (ghost, chosen states)
  • Immediate persistence: Changes saved to storage on drop with notification
  • Theme-adaptive styling: CSS custom properties for light/dark mode compatibility

API Surface

// New YASR methods
yasr.getAvailablePlugins(): { name: string; label: string; priority: number }[]
yasr.getPluginOrder(): { select?: string[]; construct?: string[] } | undefined
yasr.setPluginOrder(order: { select?: string[]; construct?: string[] }): void

Documentation

  • User guide: Step-by-step configuration instructions with use cases
  • Developer guide: API reference with code examples

Example Usage

const yasr = tab.getYasr();

// Prefer raw response for SELECT queries, graph visualization for CONSTRUCT
yasr.setPluginOrder({
  select: ['response', 'table'],
  construct: ['graph', 'response']
});

UI Screenshot

Output Preferences Settings

The Output Preferences tab provides drag-and-drop lists for reordering plugins separately for tabular and graph query results.

Storage Format

{
  selectedPlugin: "table",
  pluginOrder: {
    select: ["table", "response", "error"],
    construct: ["graph", "response"]
  },
  pluginsConfig: { ... }
}

Backward compatible: absence of pluginOrder defaults to priority-based selection.

Original prompt

This section details on the original issue you should resolve

<issue_title>Allow user to set prefered yasr plugin for SELECT and CONSTRUCT queries</issue_title>
<issue_description>- [ ] The current behavior is a selection of the plugin based on the priority associated to the plugin. This should be made user configurable with the initial order being determined by the priority.

  • Investigate the current behavior, does the plugin selection depend on the type of output of the query (json vs turtle)? If so, then the user will need to order 2 lists.
  • Make the ordering based on an easy to use drag and drop system.
  • Part of Yasgui
  • Configuration in the settings window
  • Persistent
  • Make sure all UI elements adapt colors depending on theme
  • Add tests
  • Document the feature, integrate it in existing user and developer guide, don't create new files for the documentation</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 24, 2025 15:23
- Add pluginOrder field to PersistentConfig with separate arrays for SELECT and CONSTRUCT queries
- Implement getQueryResultType() to detect if results are from SELECT/ASK vs CONSTRUCT/DESCRIBE
- Update getCompatiblePlugins() to use user-defined plugin order when available
- Add getPluginOrder(), setPluginOrder(), and getAvailablePlugins() API methods
- Fallback to priority-based ordering for backward compatibility

Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
- Add "Output Preferences" tab in TabSettingsModal
- Create separate sortable lists for SELECT/ASK and CONSTRUCT/DESCRIBE queries
- Implement drag-and-drop using SortableJS library
- Add theme-adaptive CSS styling for plugin order lists
- Add visual feedback for dragging (ghost, chosen, drag states)
- Persist order changes immediately on drop
- Display user-friendly notifications on order updates

Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
- Update user guide with detailed instructions for configuring plugin order
- Add example use cases and workflow guidance
- Document new YASR API methods in developer guide
- Include getAvailablePlugins(), getPluginOrder(), setPluginOrder() APIs

Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
Copilot AI changed the title [WIP] Allow user to set preferred yasr plugin for queries Add user-configurable plugin order preferences for YASR output visualization Dec 24, 2025
Copilot AI requested a review from MathiasVDA December 24, 2025 15:32
@MathiasVDA MathiasVDA closed this Dec 25, 2025
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.

Allow user to set prefered yasr plugin for SELECT and CONSTRUCT queries

2 participants