Skip to content

Commit b03dc61

Browse files
committed
feat(yasgui): add a "How MatGUI works" quick start tour
Five pages with three items each, a small illustration and a short explanation. Opens on the first visit (remembered in local storage), stays available from the help menu and the Ctrl+K search, and links to the user guide. Embedders can set showQuickStart: false, or quickStartOnFirstVisit: false to only offer it in the help menu.
1 parent f4cb0d9 commit b03dc61

11 files changed

Lines changed: 1238 additions & 3 deletions

File tree

‎.changeset/quick-start-tour.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@matdata/yasgui": minor
3+
---
4+
5+
"How MatGUI works": a quick start tour of five pages, each with three things to know and a small illustration, opens the first time someone uses MatGUI and stays available from the help menu and the Ctrl+K search. It links to the full user guide. Embedders can leave it out with `showQuickStart: false`, or keep it in the help menu only with `quickStartOnFirstVisit: false`.

‎docs/developer-guide.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,13 @@ interface Config {
701701
// Search for saved queries, commands and settings in the top bar, also opened with Ctrl+K / Cmd+K
702702
showCommandPalette?: boolean; // default: true
703703

704+
// "How MatGUI works" quick start tour in the help menu of the top bar
705+
showQuickStart?: boolean; // default: true
706+
707+
// Open the quick start tour on the first visit in a browser (remembered in local storage under
708+
// "matgui_quickStart_seen"). Set to false to only offer it in the help menu
709+
quickStartOnFirstVisit?: boolean; // default: true
710+
704711
// Layout orientation: 'vertical' or 'horizontal'
705712
orientation?: 'vertical' | 'horizontal'; // default: 'vertical'
706713

‎docs/user-guide.md‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- [Common SPARQL Query Types](#common-sparql-query-types)
1515
- [Getting Started](#getting-started)
1616
- [Accessing MatGUI](#accessing-matgui)
17+
- [Quick Start Tour](#quick-start-tour)
1718
- [Running Matgui with Docker](#running-matgui-with-docker)
1819
- [Your First Query](#your-first-query)
1920
- [Saving Your Work](#saving-your-work)
@@ -149,6 +150,20 @@ This excellent resource covers:
149150

150151
Matgui is available at: **[https://matgui.matdata.eu/](https://matgui.matdata.eu/)**
151152

153+
### Quick Start Tour
154+
155+
The first time you open MatGUI in a browser, **How MatGUI works** shows you around in five short pages, with three things to know on each:
156+
157+
1. **Write and run a query**: pick an endpoint, write with autocomplete, run with `Ctrl+Enter`
158+
2. **Explore the results**: switch views, describe a resource, download the results
159+
3. **Keep your queries**: work in tabs, save to a workspace, share a link
160+
4. **Let MatGUI help**: insert snippets, look at the endpoint, ask the AI assistant (or hover an IRI, when the site has no AI assistant)
161+
5. **Find your way**: search everything with `Ctrl+K`, open the side panel with `Ctrl+B`, switch the theme and open the settings
162+
163+
Click **Next** and **Back**, the dots at the bottom, or use the `←` and `→` keys to move between the pages. **Read the full user guide** opens this guide. Close the tour with **Skip**, **Start querying** on the last page, the × or `Esc`. MatGUI remembers in your browser that you saw it and doesn't open it again by itself.
164+
165+
To see it again, click **Help** (?) in the top bar and pick **How MatGUI works**, or search for it with `Ctrl+K`. Sites that embed MatGUI can leave the tour out, or keep it in the help menu without opening it on the first visit.
166+
152167
### Running Matgui with Docker
153168

154169
You can run Matgui locally using Docker, which is especially useful when working with local SPARQL endpoints.
@@ -352,7 +367,7 @@ From left to right:
352367
- **MatGUI**: the name of the application (sites that embed MatGUI can hide it)
353368
- **Query tabs**: one tab per query. The active tab is raised. Tabs that hold a saved (managed) query show a small dot before their name; the dot turns amber when the query has unsaved changes. Hover a tab to show its close button (×), click **+** to add a tab
354369
- **Search queries and commands** (`Ctrl+K`, or `⌘K` on a Mac): see [Search](#search)
355-
- **Help** (?): opens the MatGUI user guide in a new browser tab
370+
- **Help** (?): opens a menu with **How MatGUI works** (the [quick start tour](#quick-start-tour)) and **Documentation**, the MatGUI user guide in a new browser tab
356371
- **Theme** (sun / moon): switches between the light and dark theme
357372
- **Settings** (gear): opens the settings of the active tab
358373

@@ -362,7 +377,7 @@ Click **Search queries and commands** in the top bar, or press `Ctrl+K` (`⌘K`
362377

363378
- **Queries**: the saved queries of all your workspaces, with the workspace and folder they are in. Pick one to open it in a new tab, or to go to the tab that already has it open
364379
- **Snippets**: the code snippets of the [Insert menu](#insert-menu), found by name, group or the code they write (`filter` finds the comparison snippets). Pick one to insert it at the cursor
365-
- **Commands**: Run query, New tab, Insert snippet, Insert PREFIX declarations, Switch endpoint, Explore endpoint, Show saved queries, Toggle side panel, Toggle side-by-side layout, Format, Share, Save, Download, full screen editor, dark mode and the documentation. Commands with a shortcut show it at the right
380+
- **Commands**: Run query, New tab, Insert snippet, Insert PREFIX declarations, Switch endpoint, Explore endpoint, Show saved queries, Toggle side panel, Toggle side-by-side layout, Format, Share, Save, Download, full screen editor, dark mode, How MatGUI works and the documentation. Commands with a shortcut show it at the right
366381
- **Settings**: every page of the settings (General, SPARQL endpoints, Workspaces, Prefixes, Editor, AI, Import / export, Keyboard shortcuts, About), for example type `prefixes` and pick **Settings: Prefixes**
367382

368383
Type `>` first to search commands and settings only. Snippets and settings show up once you type something. Use `↑` and `↓` to move, `Enter` to open and `Esc` to close.

‎packages/yasgui/src/CommandPalette.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,18 @@ export default class CommandPalette {
386386
},
387387
});
388388
}
389+
if (yasgui.quickStart) {
390+
const quickStart = yasgui.quickStart;
391+
commands.push({
392+
section: "commands",
393+
label: "How MatGUI works",
394+
icon: "compass",
395+
keywords: "help quick start tour introduction onboarding",
396+
run: () => {
397+
quickStart.open();
398+
},
399+
});
400+
}
389401
if (yasgui.config.helpUrl) {
390402
const helpUrl = yasgui.config.helpUrl;
391403
commands.push({

0 commit comments

Comments
 (0)