Version 8.8.0

All pages

Studio

Solid Memo Studio is a second app beside Solid Memo, in the same page, at https://solid-memo.com/#/studio. Users manage their decks there, and creators write decks and courses and publish them.

To manage, it edits and groups an instance's decks in a table, and a deck's cards one by one or at once, with their wrong options, schedules and answers. It shows a deck's schedule to come and everything wrong with a deck or the instance, upgrades copies of releases, exports and imports decks as files, and draws the instance's data as a graph.

To create, it keeps a creator's drafts of releases in the instance: decks and courses, with their metadata and provenance. A draft is checked by every rule a release is held to, previewed, tried, compared with the release it follows, and published in the pod or saved as a file for the library. A learner adds a published release in Solid Memo from its link (deck-library.md).

What it shares with Solid Memo

The Studio is its own package, @solid-memo/studio in apps/studio/, with its own screens, tests and router, on the same layers as Solid Memo's app (boundaries.md):

Both apps share one session and one login (authentication.md), and link to each other by hash. A login set off in the Studio, or a reload of one of its routes, comes back to the Studio: the session gateway puts back the hash the redirect drops. They share the use cases, their cached queries, and the browser's storage: the guest's pod, the language and theme chosen on this device, and the update journal. While a tab moves a guest's study into a pod, the others refuse to write to it (guest-mode.md).

The Studio's code is a chunk of its own, fetched the first time a Studio route opens (loadStudio, in apps/web/src/main.tsx). Its messages come the same way: English in its chunk, and each other language in a chunk of its own. The page adds them to its catalogs, and fetches the one for its language before it shows the Studio (addCatalogs, in apps/web/src/App.tsx). Meanwhile, under the masthead, the page says the Studio is opening, and if the chunk or its messages can't be fetched (offline, or after a new deploy), it says so.

Layout

The Studio is a workspace for authors, not a column to read (shell/StudioShell.tsx). It takes the whole window, and the window doesn't scroll:

Tabs. A deck's screens have the deck's tabs, under the trail (shell/ContextTabs.tsx, a navigation named Deck): Cards (a card in the inspector among them), Schedule, Health, About, and Export, which opens import and export with the deck checked. A draft's screens have the draft's tabs (named Draft):

The tab shown is marked aria-current="page", and on a page under a tab (a card, a chapter, a step or a question) that tab is marked aria-current="true"; both look bold and underlined. The card inspector's tabs and the release check's policies are tabs of the same kind. The sidebar and the tabs are links, each a Back stop; hiding or sizing a pane, or opening a drawer, isn't.

What each screen has around it comes from its route alone (shell/workspaceLayout.ts: sectionOf, deckOf, contextTabsOf, asideOf):

ScreensThe sidebar marksTabsThe asideThe dock's problems
the instancesno sidebar: no instance is opennonenonenone
HomeDecksnone (its views are its own)the deck at the table's cursor (Deck)none
the library copiesLibrary copiesnonethe upgrade of the copy at the table's cursor (Upgrade)none
groups, drafts, releases, the instance's health, import and export, name and catalogthat sectionnonenonenone
the graphGraphnonethe node selected (Node)none
a deck's cards, schedule, health and about screenthe deckthe deck'snonewhat the deck's health found
a cardthe deckthe deck's, Cards marked as the card'son a wide screen, the card (Card)what the deck's health found
a draft's overviewthe draftthe draft'snoneits release check's
a draft's other screens: its cards, check, preview, trial, changes and releasethe draftthe draft'sa course's outline (Outline)its release check's
a chapter, a step, a questionthe draftthe draft's, Overview or Cards marked as theirsa course's outline, the item edited markedits release check's

What is saved, and when. A draft's changes are saved as they're made (How edits are saved, below). Elsewhere a button, a menu's item or a drag changes the pod at once, asking first when something is lost. A form waits for its Save: a card's content, its wrong options, a deck's or the instance's about screen, a cell edited in place. A card's content or a cell not saved is asked about (Save, Discard or Stay) before anything leaves it. The layout is kept on the device, never in the pod.

Its look is calm: headings in the body's type, sections flat with a thin border, no tilt, stamp or pop, and Solid Memo's colors, theme and instance colors among them (theme.md).

Density. Rows and controls are about 28px high on every screen, touch too: above the 24px minimum target of WCAG 2.2 (glossary). The status bar's Comfortable makes them 44px; Compact goes back. The choice is kept on the device (shell/prefs.ts, key solid-memo:studioLayout.v1; storage that's missing or refuses gives compact), and changes no history entry. The same key keeps:

Each instance's own state is under another key (solid-memo:studioInstances.v1, by the instance's URL): the views saved of Home and of the workbench (Saved views, below), the decks and drafts pinned, and those opened last. A deck or a draft counts as opened once the instance is read to have it, never because a link names it. No URL longer than a term may be is kept, nor a saved view whose name or query is longer. The key as a whole stays far below what the browser lets the site keep, so other keys always have room. It holds the 20 instances noted last, the last first, with at most 100 pins and 50 saved views of each table each; one more pin or saved view isn't made. In all it holds at most 262,144 characters: an instance that doesn't fit after those noted later is left out, and the next is tried. An instance left out loses its pins, its saved views and the decks and drafts opened last on this device. What is past these bounds in a value stored before is left out as the key is read, and the key is written back without it then. Storage that refuses keeps them for the page's life only.

Keys. The Studio has one listener of keys, in its shell (shell/useShortcuts.ts). Its keymap is data (shell/shortcuts.ts), each key of one scope: anywhere in the Studio, or in a table (useRowKeys, shell/useRowKeys.ts). The key help lists them by their scope:

KeysWhereWhat they do
Ctrl+K, Cmd+Kanywhere, a field tooopen the palette (Quick open and commands, below), as Search or run… does
?anywherelist every key, as ? Keys does
/anywherego to the screen's search or filter: Home's, the workbench's, a draft's cards', the releases', the graph's
F6, Shift+F6anywhere, a field toogo to the next region, or the one before: the header, the sidebar, the main content, the aside, the dock (each while it's shown), the status bar
g d, g g, g r, g p, g h, g l, g twith an instance opengo to its decks (Home), groups, drafts, releases, health, library copies, or import and export
g ianywherego to the instances
Ctrl+Bwith an instance openshow or hide the sidebar; on a narrow screen, open or close the drawer
Ctrl+\Home, the library copies, the graph, a course draft's screens but its overview; a card beside its deck's cardsshow or hide the aside, or its drawer on a screen not wide; close the card
Ctrl+Jwith an instance openshow or hide the dock
F8, Shift+F8a deck's or a draft's screens, a field toogo to the field of the next problem, or the one before (The dock, below)
], [a deck's or a draft's screensgo to the next tab, or the one before, round from either end
1 … 9a deck's or a draft's screens, but the trialgo to the tab of that number; in the trial they're the learner's, a grade or an option
j, k, x, Entera table: the card workbench (a card beside it too), Home, the library copies, a draft's cards, the releasesthe next row (shown in the aside, where there is one), the one before, select it, open it (Card workbench, below)
Shift+J, Shift+K, Escapea table whose rows are selectedselect the row and the next, or the one before; clear the selection
.a table whose rows are selectedopen the first menu of the selection's bar, or go to its first button (below)
F2a table with cells to edit: Home, the card workbenchedit the cell the focus is in, or the row's first that can be edited (Editing in a cell, below)
Ctrl+Enter, Cmd+Entera text of several linessubmit its form, as Enter does a text of one line (ui's LangTextField); the key help leaves it out
Escapea drawer, a dialog, the palette, a cell edited in placeclose it, the cell unchanged

Single-key shortcuts are a character alone: ?, /, the g chords, [, ], 1 … 9, and a table's j, k, x, ., Shift+J and Shift+K. The key help can turn them off (WCAG 2.1.4, for speech input), and the device remembers it (characterKeys, Density, above). The keys with Ctrl, the F keys, Enter, Escape and the buttons still work. A character typed with AltGr, or with Option on a Mac ([ is AltGr+8 on a Swedish keyboard), is the character. On Windows, Ctrl+
can't be told from a \ typed with AltGr (Ctrl+Alt there); the aside's button or the palette shows or hides the aside instead.

A pair such as g d is pressed one key after the other, the second within 1.5 seconds; a key held down counts once. A g chord, and a tab's key, is a Back stop, except to the page already shown. A field being typed in keeps its keys, Ctrl+K, F6, Shift+F6, F8 and Shift+F8 aside.

A key goes first to what has the focus (a menu's arrows, say), then to the screen's own keys (useScreenKeys), then to the Studio's. While a dialog is open, keys are the dialog's, wherever the focus is, but Ctrl+K (Cmd+K) closes the dialog and opens the palette. While a menu is open (Columns, say), every key is the menu's.

A field or button with a key, the one / goes to among them, says so to screen readers (aria-keyshortcuts). The key help is a modal dialog, the browser's own (Dialog.tsx, shared with the deck list); Escape or Close closes it, and the focus goes back where it was. A saved view renamed keeps the focus; one removed gives it to + Save view.

A splitter (shell/Splitter.tsx) is a separator, as screen readers know one, that takes the focus. Its value is the pane's size in pixels, between bounds that scale with the text size over the browser's default 16px (theme.md). Left and Right (Up and Down, for the dock's) move it 16 pixels, Home and End to either end; the pointer drags it (shell/splitter.ts).

Filters and the selection. A table's filters (the workbench's, Home's, a draft's cards') are one row over it, wrapping only on a narrow screen, each label beside its field, and the counts at the row's end. Rows selected in a table (the workbench, Home, the library copies, a draft's cards) bring up a bar under it (shell/BulkBar.tsx), a group named for them ("Selected cards") at the foot of the main content. It stays in sight as the table scrolls, and it's there only while some are selected. It shows what can be done with them all at once (a few buttons, and menus of the rest), and Clear selection. A status line, there throughout, says how many are selected.

Questions and forms in a dialog. Whatever loses something asks first, in the Studio's own dialog, not the browser's (shell/ConfirmDialog.tsx, useConfirm): a heading, the question, the action (it has the focus) and Cancel; Escape or Close does nothing either. Deleting cards, decks, a draft or a part of it, forgetting progress, restarting a course, and removing data from the pod on the health screen ask this way.

The components the Studio shares with Solid Memo (removing a card, deleting a wrong option, deleting an instance, removing one from the list) ask through ui's AskFirst (askFirst.ts): the Studio gives it useConfirm, and Solid Memo the browser's confirm. Deleting a group, or a deck from the groups' tree, still asks in the browser's dialog: the focus afterward comes from the button the question leaves it on. A bulk edit that needs more input (a language, a day, a deck, a group) asks in a dialog too.

Editing in a cell. Some cells are edited where they are (shell/EditableCell.tsx): on Home a deck's direction and pace, on the workbench a card's front and back.

Saved views. Beside a table's own views (Home's and the workbench's), + Save view saves the table's query under a name, asked in a dialog (shell/SavedViews.tsx). Each is a tab, pressed while the table is in its query, which a press puts it in (no Back stop). Its menu renames it or removes it, once the user confirms. A view saved or renamed under a name taken replaces that view. The device keeps them for each instance, the workbench's for every deck. A view keeps the query as its URL has it (q=kanji&show=due; shell/views.ts), the workbench's without its page.

The dock

The dock (shell/BottomDock.tsx) has two tabs, a tablist (Left and Right go from one to the other):

F8 goes to the field of the next problem the Problems list shows, Shift+F8 to the one before, as a link does, round from either end. It counts from the problem gone to last while its page is shown, so two problems in one field are each gone to, else from the page shown (stepProblem in shell/workspaceLayout.ts).

Its stylesheet is studio.css, in the Studio's chunk, over the site's style.css, which holds none of the Studio's rules. Every rule holds under <html data-surface="studio">, which the shell sets while it's shown and removes after; the density is data-density beside it. The screens' rules come first, their scope in :where(), so the workspace's rules after them win. A test (studio.test.ts) checks the rules through the cascade, and that Solid Memo's screens are left as they were.

Quick open and commands

The palette (shell/CommandPalette.tsx, a dialog named Quick open) opens with Ctrl+K (Cmd+K on a Mac), or with Search or run… in the header. It finds, as the user types:

It lists what the workspace's cache held when it opened, reading nothing from the pod. The entries and their rank come from shell/commandIndex.ts:

The field is a combobox over the list: the focus stays in the field, and the entry picked is its aria-activedescendant. Down and Up pick the next entry or the one before, round from either end, and Enter, or a click, chooses it. Escape, or Ctrl+K (Cmd+K) again, closes the palette, and the focus goes back where it was. An entry that goes somewhere is a Back stop, except to the page already shown; a command runs once the palette has closed.

A screen adds the commands it can run at the moment (useScreenCommands, in shell/useScreenCommands.ts); beside a card, Close the card stands for the aside's. A screen's are:

ScreenCommandWhat it does
DraftsNew draftgoes to the new draft's form, while a draft can be made
Health, an instance's or a deck'sCheck againchecks again, while it isn't checking
Import and exportExport n decksexports the decks checked, as the form's button does, while some are and none is being exported

Routes

The Studio has its own hash router (src/ui/router.ts), on the same core as Solid Memo's (routerCore.ts in ui, routing.md). Its hashes all start with #/studio (STUDIO_PATH, isStudioHash in ui's router); Solid Memo's are the others.

HashScreen
#/studio/instancesthe instance picker. Its link for a new instance goes to Solid Memo's storage picker.
#/studio?instance=…[&q=…&sort=…&order=desc&show=…&deck=…]Home (below). q filters it, sort names the column it's sorted by, and order=desc sorts it the other way. show is the view: due, courses, copies or attention; every deck without it. deck is the deck at the cursor.
#/studio/groups?instance=…Groups (below).
#/studio/cards?deck=…[&q&field&lang&state&has&sort&order&page&size]the card workbench (below). The deck names the instance: its catalog's folder.
#/studio/card?deck=…&card=…[&tab=distractors|schedule|history&field=…][&q&in&lang&state&has&sort&order&page&size]the card inspector (below): its content (the default tab, left out of the URL), or with tab its wrong options, review state or answers. field opens it at one field: a text of the content (front, backNote…), or a wrong option by its id. The rest is the query of the workbench beside the card, but in for its field; without it, the deck's cards as listed.
#/studio/schedule?deck=…a deck's schedule (below).
#/studio/about?deck=…a deck's about screen (below).
#/studio/instance?instance=…the instance's name and its catalog (below).
#/studio/health?instance=…[&deck=…]the instance's health, or one deck's (below).
#/studio/library?instance=…the library copies (below).
#/studio/transfer?instance=…[&deck=…&deck=…]import and export, each deck checked (below).
#/studio/drafts?instance=…the instance's drafts (below).
#/studio/draft?draft=…[&field=…]a draft's overview (below). draft is the draft's release document, which names the instance.
#/studio/chapter?draft=…&chapter=…[&field=…]a chapter of a course draft, by its id (below).
#/studio/step?draft=…&step=…[&field=…]a step of a course draft, by its id (below).
#/studio/question?draft=…&card=…[&field=…]a card of a draft, by its id: a course's question, or a deck's card (below).
#/studio/draft-cards?draft=…[&filter=…&lang=…&sort=…&order=desc&page=…]a draft's cards (below): filter is unasked, askedTwice, fewDistractors or retired, lang a language, sort the column (front, back, place, distractors or id; by id without it), and order=desc the other way.
#/studio/check?draft=…[&policy=library]a draft's release check (below), for a pod, or with policy=library for the Solid Memo library.
#/studio/preview?draft=…a draft's listing preview (below).
#/studio/trial?draft=…[&chapter=…&part=review]a draft's trial (below): a course's page, with chapter (an id) that chapter's steps, and with part=review its final review; a deck's study.
#/studio/diff?draft=…a draft's release diff (below).
#/studio/release?draft=…[&field=…]the release's metadata and provenance (below), then its publishing (below).
#/studio/releases?instance=…the releases the instance published (below).
#/studio/graph?instance=…[&node=…]the graph (below). node is the node selected, by its IRI, a blank node by the number the graph gives it.

#/studio/ and its query count as #/studio. Anything else under #/studio, #/studio among them, is the default route: the only instance's Home, or else the picker. An unknown instance falls back to the picker, an unknown deck to its instance's Home, an unknown card (one removed, say) to its deck's cards, and a chapter, step or card a draft doesn't have to the draft's overview. A node the graph doesn't have counts as none. Like Solid Memo's fallbacks, these replace the history entry.

field opens a draft's screen at one of its fields, where the release check links (a field the screen doesn't have is left out):

These replace the history entry: Home's query and deck beside it, the workbench's query, the inspector's tab, the decks checked to export, a draft's cards' view, the graph's node selected, and the card beside the deck's cards. Opening a card from the list, or a deck from Home or a card from a draft's cards with Enter, is a Back stop.

Solid Memo links to Home as #/studio?instance=… ("Studio" in its masthead, "Open in Studio" in each deck's actions menu and on the deck page; routing.md). A deck's link opens its instance's Home too.

The trail starts Instances › Decks, then goes on by screen (crumbsOf, in shell/titles.ts, from the route and the deck, card or draft it names):

ScreenThe trail goes on
Groups› Groups
the workbench› Cards of deck
the inspector› Cards of deck › card
a deck's schedule› Cards of deck › Schedule
a deck's about screen› About deck
the instance's screen› Name and catalog
the instance's health› Health
a deck's health› Health › deck
the library copies› Library copies
import and export› Import and export
the drafts› Drafts
the releases› Releases
the graph› Graph
a draft's overview› Drafts › draft
a chapter› Drafts › draft › chapter
a step› Drafts › draft › chapter › Step 2
a draft's cards› Drafts › draft › Cards
a question› Drafts › draft › Cards › card
a draft's check› Drafts › draft › Release check
a draft's preview› Drafts › draft › Listing preview
a draft's trial› Drafts › draft › Trial
a draft's comparison› Drafts › draft › Changes
a draft's release metadata› Drafts › draft › Release

The document title is the trail's last step and "Solid Memo Studio". After a move, the screen's heading takes the focus (useScreenFocus). The link back to Solid Memo, in the header, the landing page and the Pod connection screen (headerLink in STUDIO), goes to the open instance's decks when there is one. The Studio's links into Solid Memo (a deck's page, its preferences, a new instance) are Solid Memo's own hashes.

The Studio's old address, /studio/, is a small page (apps/web/public/studio/index.html) that sends /studio/#/x on to ../#/studio/x. Its script runs under a Content Security Policy that allows only it, by its hash. A test (studioRedirect.test.ts) checks both.

Home

Home (DeckTableContainer) is a table with a row per deck. Its columns are:

Beside a deck's name are its problems (health), "3 problems", a link to the deck's health, and for a copy with a newer release out, "Release 2 out", a link to the library copies. Both are looked up only once the row is on the screen (IntersectionObserver): one read of the library's index for every copy (listLibraryUpdates), and for a copy from a link its creator's catalog. A deck with no problem gets no badge, nor does a copy that's up to date or whose newer releases can't be known.

With no decks yet, Home says to make or import them in Solid Memo.

The table starts in the order the user arranged the decks. A column's name sorts by it, then the other way, then back to that order; the sorted column says so (aria-sort). A figure not known yet sorts last, either way. The filter keeps the decks whose name, in any language, or whose groups' names hold its text, case and accents aside. The domain does both (deckTable.ts). The texts of a sorted column are ordered once, and again only when one of them or the reader's language changes. A title sorts by its first 200 characters, so titles that differ only past them keep the table's order. A render, as each deck's figures come in, doesn't compare them anew, and nor does a draft's cards table or Releases. Home's filter goes over the names again only when a deck, its groups or the filter's text change.

Views. Tabs above the table (a group named Views, the one shown pressed) each keep the decks of one kind, and count them:

Each is a preset of Home's query (shell/views.ts): it sets the view (show), and keeps the filter's text and the sort. No view keeps decks by their problems or a newer release. After them come the views the user saved, and + Save view (Layout).

Editing a deck in its row. A deck that may be changed has its direction, new cards per day and reviews per day edited in their cells (Editing in a cell, under Layout): a choice of directions, or a whole number. One left empty follows the instance's pace again. Each is saved as the bulk edits save it, for that deck alone ("Set the pace of 1 deck.").

The table is a DataTable (Card workbench, below): j and k move its cursor, x selects a deck, and Enter opens the deck's about screen. Its Columns menu shows or hides each column but the deck's name, as the device keeps. Every column shows until hidden. The workbench and a draft's cards have the menu too, each table its own.

The deck beside the table. The deck at the table's cursor is in the aside, named Deck (DeckPeekContainer): its groups, its cards, today's due and new cards, when it last changed, its health, and links to its tabs. It reads its cards at once, outside the table's turns, and takes the rest from the table's own queries. A deck the instance doesn't have shows none; before the cursor has moved, the aside says how to show one.

Decks are selected by their checkbox, or all those shown at once. The selection's bar offers Edit (a menu of the first three below, each asking how in a dialog), Export and Delete. A selected deck the filter hides stays selected, but is left alone until it's shown again. The selected decks shown can be:

Each is one write of catalog.ttl, made in turn with the other writes of the catalog, and the table is read afresh after it (data-model.md). A deck set aside can't be selected, nor can any deck until the data check is done (below). While the arrangement is set aside, no deck is moved into a group.

Card workbench

The workbench (CardWorkbenchContainer) lists a deck's cards in a table, a row each. The columns are the front (a link to the card), the back, when it's due, its interval and its ease, its lapses (below), when it was added, and its id. A retired card says so. A card studied both ways shows the direction that needs the most work: the earliest due day, the shortest interval and the lowest ease. A copy of a course says its cards are the course's questions.

The URL holds the query, which the domain applies (cardQuery.ts):

Views. Tabs above the filters (a group named Views) put the cards in one state: All (none), Due, New and Leeches, the one the query is in pressed, or none when its state is another. A view keeps the rest of the query, from the first page. After them come the views the user saved (Layout).

Editing a card in its row. A plain text card (not in Markdown) has its front and back edited in their cells (Editing in a cell, under Layout), a side only while its text is in one stated language. It's a bulk edit of that card alone (setText in cardBulk.ts), with Undo (below). A side left empty is refused; one unchanged writes nothing. Other cards are edited in the inspector.

The table is the Studio's DataTable (shell/DataTable.tsx). Its first column (the checkboxes and the fronts) stays in sight as it scrolls. Cards are selected by their checkbox, or a page's at once; a click with Shift held selects, or not, every card from the one checked last. The selection stays while the view changes. The keys are listed under the selection's bar:

The cursor's row is marked, as is each row selected. j and k work wherever the focus is, from the cursor's row, or the first. x, Enter and the Shift keys act on the row the focus is in, or the cursor's with the focus on the page's body; Enter on a row's link or button is the link's or the button's. The search and the filters keep the keys while focused. The selection, the sort, the cursor and the columns shown are worked out in shell/tableModel.ts.

Home, the library copies, a draft's cards, the releases and a card's answers are DataTables too, each with the keys and the marks it has use for. The workbench's Columns menu shows or hides each column but the first (Home). A row that can't be selected now (a deck set aside, a copy with nothing to upgrade) has its checkbox disabled, or none, and a range or a page's checkbox passes over it.

The lapses column counts each card's lapses, in either direction, in the answer log: reviews graded below 3, but not a first answer, an answer the same day after another, or a course answer (statistics.md). The row of filters ends with how many cards the query keeps and the month of the deck's first answer in the log ("since March 2025"). The workbench reads the whole log once (loadAnswerLog): its newest MAX_LOG_MONTHS months. Meanwhile the cards show without their lapses, and a query that needs them (state=leech, sort=lapses) waits. When it can't be read, the line says so, and such a query shows why.

A card opens in the card inspector, on a screen wider than 64rem beside the workbench, which keeps its query, selection and Undo. The workbench reads the cards and review states with Solid Memo's queries, and the instance's preferences for today's study day. A test keeps a query over 5,000 cards linear: timed on the same machine, eight times the cards take less than four times as long as an eighth of them eight times over.

Bulk edits

The selected cards the query keeps, on any page, are edited from the selection's bar (CardBulkActions), which groups the edits:

A selected card the query hides stays selected, but is left alone. While the deck may not be changed, the bar has only Clear selection. The edits are:

The domain plans each edit (cardBulk.ts, planCardEdit). A card it would change must pass the card editor's validation (validateCardContent), else it's left as it is, as is a card the edit doesn't change, and one whose side or wrong option a replace would leave empty. A note or a label left empty is removed, as in the card editor. Text whose language isn't stated can't be changed before its language is. A wrong option several cards share is edited once for all of them, and checked once for each text format among them, not once for each card.

The use case editCards plans the edit again on the cards as they are now, and writes it in one If-Match PUT of the cards document (data-model.md). Then it writes the review states of deleted cards in one write of the reviews document, then the deck's schedule in the digest. When the cards document changed meanwhile, or was made since it was read as absent, it reads it and plans again, three times in all. Once that plan isn't the one the user previewed, it stops with "changed elsewhere", writing nothing. When the reviews document changed meanwhile, or was made since it was read as absent, it writes the review states again, three times in all. The deck's catalog entry is untouched. The end-to-end tests hold this against real servers, a change made by another app during the edit included (cardEdits.integration.test.ts).

After an edit, the status line says what it did, and Undo undoes it: undoCardEdit writes the plan's inverse the same way, the deleted cards' review states included, only while the cards are as the edit left them. Undo is offered once the cards are written, even when the review states' write after it fails. An undo whose review states' write failed can be made again: a deleted card already back as it was counts as the edit left it, and isn't written again. Each undo writes all the deleted cards' review states, so it puts back the states from before the delete, even when a card it brought back was graded in between. The plan is kept in the page only, so Undo goes with the next edit, another deck, or leaving the page.

No edit takes a backup first: Solid Memo keeps none (migrations.md). Undo can't bring back triples another app put on a deleted card or its wrong options, or a second state of a card that was never read.

Card inspector

The card inspector (CardInspectorContainer) shows one card of a deck, named in its heading, with a link to its page in Solid Memo. On a screen wider than 64rem it's in the aside, beside the deck's cards (Layout); below that it's the main content alone. The card's row is marked (aria-current) and is the cursor's. A card opened from the list takes the focus to its heading; closed, the focus goes back to its row.

Previous and Next at its heading's end, or k and j, show the card before it in the list, or the one after, each at its page of the list, in the same tab, with no Back stop. At either end, or for a card the query doesn't keep, there is none. A card opened from elsewhere (the palette, a deck's schedule, a link) puts the list at its page, replacing the history entry.

Its four tabs are links, the one shown marked (aria-current):

The domain makes each change (distractors.ts):

In a copy of a library deck or a course, a card still as the release has it warns that an edit detaches it. A newer release then no longer updates it, but may retire it. A card already changed says so (migrations.md).

Solid Memo's own card page saves the wrong options with the card. Left as they were, they follow the card as it's read afresh (a change in the inspector meanwhile included), and its save doesn't state them, so the card keeps its own.

While the deck is set aside, or the data check is under way, every tab is shown but nothing in it can be changed (below).

Edits not saved. The content tab's card editor says while it holds changes not saved. Leaving them by any link, key, Close, another tab, Back and Forward, or a hash typed in, first asks, in a dialog (shell/ConfirmDialog.tsx). The answers are (shell/unsavedEdits.tsx):

A table's cell edited and not saved is asked about the same way, beside a card's edits; Save saves them all, and goes on only once each is saved.

Back or Forward is undone before the Studio's router hears of it, by as many entries the other way (the router numbers them, historyPosition in routerCore.ts). It's done again once the question is answered so, the entries after it kept for Forward. A hash typed in is undone as Back is. A card's edits are never saved unasked. Leaving the app (a reload, closing the tab) is asked by the browser (beforeunload). The edits are kept as the window crosses 64rem (keep, in CardScreen), until another card or tab is shown.

Opened at a field (field, as the health screen links to one), the inspector puts the focus there: on the text, or on the wrong option's Edit button (data-arrival, as useScreenFocus in ui takes it). Another tab opens at none. It reads the cards and review states with the workbench's and Solid Memo's queries.

Review state

The domain makes both changes (reviewStateEdits.ts):

The states are those Solid Memo reads (data-model.md), joined to their card by sm:reviewOf and sm:reviewDirection, the fragment rule only where a state leaves them out, so a state another app named its own way is edited in place. Only sm:sm2 and sm:fsrs6 states are touched.

Neither touches the answer log. The use cases resetCards and rescheduleCards write the change in one write of the reviews document (none when no card has a state), then the deck's schedule in the digest. The change is made of the states as that write reads them (editReviewStates), and made again of a fresh read when the document changed meanwhile: a card graded on another device keeps its grade, due on the day set. The screens then read the review states afresh and drop the deck's study queue. The end-to-end tests hold both against real servers (reviewStateEdits.integration.test.ts).

Moving and copying cards

Move to deck… and Copy to deck… open a form (TransferCardsDialog) that offers the instance's other decks and Keep their progress, checked to start with, and says what becomes of the cards' history. A moved card leaves the selection.

A deck whose cards or reviews document is one of this deck's isn't offered, as another app may point two decks at one document. Its cards are this deck's, so a move would remove them from both. The use case refuses such a transfer before reading anything, and the domain plans none. Two addresses name one document when a server may read them as one: written another way a request or a server resolves, such as a character encoded that needs no encoding, or with a user name and password in it. A server may decode each segment of the path and encode it again, so a character written encoded in one address and plain in the other (( and %28, + and %2B) is the same too. So are two spellings that differ only in case, in Unicode normalization (é, and e with a combining accent) or in a trailing dot or space, which a file system that ignores them stores as one file. An encoded slash, backslash or percent sign isn't, as decoded it would read as another path (documentKeyOf in instanceLayout.ts). The decks to offer are worked out once for each read of the decks and of the data check, not on each render of the workbench.

The source's cards and review states are copied into the target. So each of its two documents is read as the user only when it's the instance's, by the place rule of the next version of a release. That is, it's in the instance, or in one of the user's storages that the instance is in too. Any other is read as no one, so an instance in someone else's pod can't have cards, or their progress, kept from everyone copied into another of its decks. The target is the instance's own deck, read as its data is.

The domain plans the transfer (cardTransfer.ts, planCardTransfer):

The use case transferCards writes the target first: its cards document in one write, made only if it's still as read (If-Match), then its reviews document. For a move, it then writes the source's reviews document, and last its cards document, If-Match too. A document changed meanwhile, or made since it was read as absent, has the whole transfer planned again, three times in all, then it stops with "changed elsewhere". Then the decks' schedules in the digest are brought up to date, and both decks and the instance's counts read afresh.

A move stopped half way (the target written, the source not, or only its review states) leaves the cards in both decks, never in neither, and making it again finishes it. The plan names the same ids each time, and a card the target holds already under its id, saying the same, isn't written again (its state there is kept). Two cards of the source saying the same are never both found at one id. The source's states go before its cards. All four writes, of both decks' cards and reviews documents, are made and checked before the first is sent, so a card or a state one would refuse stops the move with nothing written. That's a card or a state a newer version of the app wrote that the move would rewrite: a moved card, or the state the app reads of one. Any other card's subject or state a newer version wrote, such as a distractor, stays where it is and doesn't stop the move. Each write is made only while its document is at the version the move was planned from, so a document changed since has the move planned again, nothing sent. A reviews document that changes once a cards document was sent can't have the move planned again: its changes, a card's states added or removed, are made of it read afresh (prepareReviewChanges). The end-to-end tests hold this against real servers, and include a move stopped before the source's cards were written (cardTransfer.integration.test.ts).

A deck's schedule

A deck's schedule (DeckInsightContainer) shows its study to come. The domain computes it (scheduleInsight.ts, cardHistory.ts), and the use case deckInsight reads what it needs, writing nothing.

The charts are the statistics' own (BarChart and StatTile in ui). A bar pointed at, tapped or reached with the arrow keys says what it holds, and each chart has its figures as a table.

A deck's about screen

The about screen (DeckAboutContainer) shows a deck's metadata and how it's studied, with a link to its page in Solid Memo. Each part has its own form and status line:

After a save the decks are read afresh, and the deck's study queue is dropped.

The instance

The instance's screen (InstanceAboutContainer) shows where the instance is, links to its study preferences in Solid Memo, and has two forms:

Both forms are held until the data check is done, and while the catalog or a group is set aside (below).

The meta document and catalog writes pass the shape check; the type index renames are If-Match writes only. Each write is made again from a fresh read on a 412, three times in all. A rename checks the catalog's write before writing anything: when a newer version of the app wrote the catalog, it's refused (writtenByNewerApp) with nothing written, and the name stays as it was in every document. The end-to-end tests hold these edits against real servers (metadata.integration.test.ts).

Health

The health screen (HealthContainer) shows everything wrong with a deck, or with the instance, for every user. "Check again" reads it all afresh.

A deck's health is the use case checkDeck (deckHealth.ts): a line counts the problems, then come four parts:

A deck can have any number of problems, so each of the last three parts shows at most PROBLEM_LIMIT (50) of them and says how many more there are. A group of cards that say the same names at most DUPLICATE_CARD_LIMIT (10) of its cards and says how many more it has. The summary and the line on unstated sides count them all.

Above them, on a deck's health and the instance's, a deck whose documents are unclaimed (they don't say they're the deck's, and are outside the instance's own folder, data-model.md) is named with its documents' addresses (UnclaimedDecksNotice). "These are this deck's documents" asks once more, then marks them as the deck's (claimDeckDocuments), and the checks are read afresh. Until then nothing in those documents changes. A deck with a document outside the instance's folder, and not in a storage of the user's found to hold the instance too (ReadScope.isInstances), has no such button: the notice says which document and why. It names at most 50 such decks, and says how many more there are.

The badge on Home counts every violation (warnings aside), side to settle, group of cards that say the same, and Markdown finding, those the health doesn't keep too (healthProblemCount).

While the deck is held (set aside, or the instance blocked: below), every place is named, not linked, and a line says why. The problems are then corrected in the pod by other means.

What the deck's check finds (as its screen opens, or on "Check again") takes the place of what the instance's check found of that deck (withDeckReport), in the same place in its list. That result is what holds it. A deck mended is let go without a reload or a check of the whole instance. A check overtaken by another (one still running when the deck is checked anew) is dropped.

The instance's health is the check run when it's opened (checkInstance, the same query as Home's), then every deck with its badge, a link to its own health, as is a result about a deck. A result is about a deck as the data check sets decks aside: through its entry only when it was found in the catalog, and otherwise through the document it was found in. The decks are indexed once for those links (deckOfSubjectsIn), so each is a lookup, not a search through them. A badge checks its deck once, and what it finds holds its deck too. The decks' checks read three decks at a time, the rest waiting their turn. So a long list scrolled into view never has all of its decks' documents read at once. A deck's turn ends only once all its reads have. The badges share the check of a document many decks name, and of the catalog, and the reads of that document for its cards and whether it's unclaimed, in any spelling of its address a request sends the same way. A spelling that percent-encodes a character needing no encoding is another address to a request, so it's checked and read on its own, as the instance's check does. Each is checked and read once, a read that fails too, until the instance's check or the deck's health is read afresh (validation.md). A deck whose cards document can't be read shows it as unreadable. The badges of one instance share one text check too, so the cards that say the same and the Markdown findings of a cards document many decks name are worked out once for them all. Reading the instance's check afresh reads every check of the instance afresh (their queries are under its key); "Check again" on a deck's health reads only the deck's, which is read afresh each time its screen opens too. The end-to-end tests hold checkDeck against real servers, the documents it checks again and what it leaves as it is included (deckHealth.integration.test.ts).

Library copies

The library copies screen (LibraryCopiesContainer) lists the instance's decks copied from a release (they have prov:wasDerivedFrom), from the library or added from a link. A row shows the release it came from, the newest one out, and what upgrading would change. The screen links to Solid Memo's deck library.

The use case listLibraryUpdates reads the instance's decks and the library's index once (library.ts, libraryCopiesOf). A copy of the current release, or of one the index lists as no older, is up to date (offersNewerRelease, as Solid Memo's offer tells it). A copy whose deck the index no longer lists says so. A release the index doesn't list is an unknown release.

For each copy with a newer release, the screen asks what upgrading would do (planLibraryUpgrade, the plan Solid Memo's deck page offers; migrations.md), with the copy and its series as found, reading nothing again. Each copy's cards are read in the same turns as Home's, six decks at a time. Copies that name one cards document share its cards by id, worked out once (libraryUpgrade.ts). Copies of a release the library's index lists share the plan of the cards too, as the library reads each release once: only what each deck's own entry changes is planned for each. A copy from a link reads its releases for its own plan, so each such copy compares the cards of the releases it read, which are within one release's limits. It says what the upgrade does in Solid Memo's sentence, or that it has nothing for the copy.

The table is a DataTable. The copy at the cursor is in the aside (named Upgrade), with the rest of its plan: what history is kept, the new releases' notes, and its cards. Those are added, changed, retired, brought back, removed, left as the user has them, or given what the release says they're about (about: every card of a release that changes only that). Each of those lists names at most 50 cards, and the notes at most 50 releases, and says how many more there are, as an upgrade can touch any number. That copy isn't in the URL: on another screen and back, none is shown until the cursor moves.

The copies that can be upgraded are selected by their checkbox, or all at once; a copy set aside can't be, nor any until the data check is done (below). Update 2 decks (as many as are selected), in the selection's bar, upgrades them one after another with Solid Memo's own upgrade (applyLibraryUpgrade), on the plan the user saw: a deck changed since is refused.

The end-to-end tests hold listLibraryUpdates and a batch of two upgrades against real servers (deckUpgrade.integration.test.ts).

A copy whose series the index doesn't list is looked up as a copy of a release added from a link (deck-library.md). Its release is read, and its row says "From <host>".

Import and export

Import and export (TransferContainer) saves decks as files and makes decks of files: Turtle or JSON-LD, one deck to a file (data-model.md).

Export lists the instance's decks, as they're arranged, those in the URL checked. The user picks the format and whether their progress goes too: the cards' review states and a course's completed chapters. Export saves each deck as a file of its own, named after its title (capitals.ttl), one after another, the screen naming the deck it's at. Export writes nothing to the pod. The use case exportDeckFile reads the deck's documents (DeckArchive.exportDeck) and hands the text to the browser to save (FileExchange.save). It reads a document as the user only when it's in the instance's pod, any other as no one, and the file holds only the deck's own cards and review states.

Browsers ask before a page's second download, and save none of the rest on a no. The app can't tell, so after several decks the screen says how many it handed the browser, and that the browser may ask.

Import asks for a file (openDeckFile, FileExchange.open): a .ttl, .jsonld or .json file, its format by its name, else by its text. The screen then says what the file holds: its deck, its cards, its progress, how many parts are brought up from an older format, and how many can't be read and are left out. A file in a newer format than the app reads is refused (as deckFileTooNew, not writtenByNewerApp, since nothing is saved over), as is one without exactly one deck, or one that doesn't parse. So is one whose deck has an address that isn't a URL, which its entry in the catalog can't hold. So is one with an address the import keeps, such as a card's picture or what it's about, that links to the guest's pod (deckFileLinksGuestPod, guest-mode.md). The deck's, its cards' and their documents' own addresses may: the import gives them new ones.

Import into the instance (importDeckFile) makes a new deck of it, with its progress when the file has some and the user leaves it checked. A course's completed chapters come as many as the app reads of an entry. A file may hold more than the app reads of one document outside the user's storages. A deck whose cards or review states would make a larger document is refused (deckFileTooLarge) before anything is written, wherever the instance is, as an instance in the user's storage may be read from outside it too. So is a deck with a card or wrong option whose id is longer than 256 characters (cardIdTooLong, data-model.md). The document is measured as the import writes it and, by its bytes, as a server may serve it back, one triple a line. Its cards document goes first, only if none is at its URL yet, then its review states, then its entry in the catalog, so the deck shows only once it's whole. When a write after the cards document fails, the import deletes the documents it wrote, which no entry names, unless the entry was written after all. A cards document left behind by an import cut off makes the deck take a fresh id, three times in all. Then the deck's schedule in the digest is brought up to date, the screen links to the deck's cards, and the instance's decks are read afresh.

The deck is written as any deck Solid Memo writes: wrong options named with sm:distractor and schema:suggestedAnswer, states naming their card in the new deck. A state's due day that isn't a real date is written as the day of its last review, as a move does, and a snapshot with such a day is left out. It needs no type-index registration: the instance's own leads to it (data-model.md). While the data check is under way, or the catalog is set aside, the import is held (below); a file can still be read.

Each write passes the shape check. Turtle and JSON-LD go through the Solid client library, behind client/resources.ts, and files through the browser's own Blob and file input: no new library (boundaries.md). Unit tests take a deck with Markdown, pictures, wrong options (one retired), text in two languages, a retired card and review states through both formats and back (solidDeckArchive.test.ts), and the end-to-end tests against real servers (deckFiles.integration.test.ts).

Drafts

A creator writes a deck or a course as a draft of a release, in the instance, before publishing it. The drafts screen (DraftsContainer) lists the instance's drafts, each with its kind (deck or course), the version it drafts and whether it's being written, was released, or can't be read. One is deleted, with its documents, once the user confirms. A draft is registered in no type index (data-model.md).

The drafts are read a few at a time (mapAtOnce in atOnce.ts), as are the documents the data check validates. A catalog is data anyone may have written, so the Studio follows at most MAX_CATALOG_LINKS (1,000) entries of each kind: decks, drafts and releases (catalogLinks.ts). Past that, it reads none of that kind and says why (catalogTooManyLinks), with a hint to remove the instance unless the user knows who keeps it. It reads at most MAX_DECK_GROUPS (1,000) deck groups too, each a row of the Groups screen (Deck groups). Past that, the screens built on the deck tree (Groups, the Decks table, Transfer and Drafts) refuse the whole tree, its decks included, with the same message and hint. Groups nest up to 16 deep, and the Studio names a deck's groups as a path in the Decks table's Group column (its sort too), the bulk Move's list of groups and the deck peek. A path shows at most 200 characters of each group's title, cut between characters with an ellipsis as the last (groupPath in deckTable.ts), so it's at most 16 short names, however long the titles. The filter, which keeps a deck whose groups' names hold its text, searches each group's title once for a text, not once for each deck below the group. A deck, draft or release the catalog has no room for is refused before it's written (catalogFull), so the Studio never takes an instance past what it reads. A draft's folder may list at most MAX_DRAFT_DOCUMENTS (1,000) documents, and the drafts at most MAX_DRAFT_DOCUMENTS_IN_ALL (5,000) together; past either, they aren't read (draftTooManyDocuments). Making a draft, or an edit that adds documents, that would take the draft or the drafts together past their limit is refused before anything is written, the release document counted. An edit that fails partway may still leave them past. The refusal suggests deleting drafts the user no longer needs, and removing the instance only when its drafts aren't the user's own. A draft past its own limit can't be opened, but it can be deleted, on its own or with its instance. Deleting lists the draft's folder without the limit, for any instance: each delete stays inside that folder, and only the user starts one. The instance's data check and graph read only the release document of such a draft and go on with the rest. A draft's own documents are read a few at a time too (solidReleaseDraftRepository.ts).

Each draft that can be read links to its overview, where a draft made opens, the activity saying so. A draft of a deck copied from a release stays on this screen instead (below).

A new draft starts from

In both cases, the draft keeps nothing the release states of its default place (unplaced in releaseDrafts.ts). That's the instance's releases/<name>/v<M>.ttl, by the draft's name, with M its version or higher: where the draft and its next versions are published unless the creator picks another folder. That place is the draft's wherever the release is, in the library, in another pod or in a file. Publishing the draft or a next version of it there would otherwise be refused (releaseForeignStatement).

Either way, the draft doesn't keep a statement that one of its documents is dcterms:isPartOf anything, which to a deck would say the document is that deck's (data-model.md).

A release is made a draft only if its version is 1, 2, …, small enough that it and the next one are safe integers in JavaScript (a draft's address names its version). Every id in it must have letters A to Z, digits, ., _ and -, starting with a letter or digit (unsupportedIdOf). A chapter's document is named after its id. Else it's refused (releaseIdUnsupported). Every card, chapter, step and wrong option must be a fragment of the release (<release>#id), as the draft holds only those as its parts. One anywhere else is shown by no editor and checked by no rule, but would be published with the draft, so such a release is refused too (releaseForeignPart). So is one that links to the guest's pod by an IRI (releaseLinksGuestPod): a guest's draft of it couldn't be kept (guest-mode.md). For a next version, the draft as it's made is held to this too. It takes what the documents its series and publisher are described in say, such as the earlier versions the series lists (dcat:hasVersion). It's refused, with nothing written, when it links to the guest's pod by an IRI other than its own URL or its own subjects' (<draft>#id). Its text may name any address.

A draft, however it's made, is refused (unwritableTerm), with nothing written, when it names an IRI that looks like a prefixed name, such as <dc:license> or <dcat:Catalog>. An edit writes each document whole, and that IRI would be saved as the term it looks like (data-model.md).

Of a release's other statements, the draft keeps those of the release, of its own subjects, and of what they name, at any depth: a source, a license, a blank node. A statement of what none of these leads to is dropped, with nothing said. So is any statement of a creator (dcterms:creator) with no agent record in the draft, wherever its address is: outside the release, or one of its subjects with a second class a record is of. For a next version, so is what the documents its series and publisher are described in say of it, or of an agent the draft has a record of. The draft keeps only that the release names it. When such a creator is the release's publisher, its series or a source, its statements in the release are dropped too. The Studio shows such a creator by its address, and so do learners. The shape check wants an author described as an agent, and the Studio has no way to remove such a creator, so a draft that names one can't be published to a pod. A statement that the release itself is an agent or a distribution is dropped as well, from the release and those documents, with any foaf:name of it. A release holds no such record, so the Studio would show no such name.

A draft in the pod can still hold statements of such a creator: one made before they were dropped, or written to by another app. The release check names that creator among the parts the draft doesn't hold (strayParts) when the draft states it's an agent or gives it a foaf:name, so the draft can't be published. A copy of the draft drops those statements, as a new draft does.

Also dropped is a statement of, or naming, an address in the new draft's folder, its own release document's too, before the release's subjects are moved there. Read back from the pod, that address would be one of the draft's subjects, with statements no editor shows. A record's link to such an address is dropped the same way (withoutLinks in releaseToDraft.ts): a card's subject, picture or wrong option, a step's or chapter's question, the release's license, source or earlier version. Read back, it would name one of the draft's subjects, perhaps by an id no draft can have. A link its record can't be without, a distribution's address, stays. Copying a draft drops them the same way, and so does making a draft of a deck. One that is kept can still be of the address the draft is later published at, or of a fragment of it. No editor shows it, so publishing there refuses the draft (releaseForeignStatement, Publishing a release). In the pod, another folder is the way out; for the library, whose address is fixed, a new draft that doesn't state it.

A draft whose documents (perhaps written by another app) name a subject by another id isn't opened, and no change gives a draft one (draftIdUnsupported). Nor is a new draft made with one, whatever it's made from, since it couldn't be read back. That check reads the new draft as the pod would give it back, with each address in its folder named as a fragment of its release document. Each is refused with nothing written, as is a draft at an address no draft has (draftPlaceOf).

A draft is named after its title, or its release's name, unlike the instance's other drafts of that version. Only a draft's place taken meanwhile (its release document made there first) gives it the next name. Any other failure, such as the catalog's link refused on 412 a few times, takes back what was written and is thrown, so no draft is left that the catalog doesn't link.

The use cases are listReleaseDrafts, createReleaseDraft, copyReleaseDraft (a guest's draft, as the guest's study is added to an instance, guest-mode.md), checkReleaseDraftCopy, getReleaseDraft, editReleaseDraft and deleteReleaseDraft (releaseDrafts.ts), over the ReleaseDraftRepository port. checkReleaseDraftCopy tells, with nothing written, whether such a copy can be written there.

A draft changes by DraftChanges (releaseDraft.ts, UseCases.editReleaseDraft), covering:

A blank node only the statements a change took out named goes with them. A change keeps each statement it leaves alone as it was, so what it took out is found by identity, without comparing every statement by its value, and only the blank nodes those name are looked at. Whether it rewrites an activity carried from an earlier release is asked only of the activities among the subjects of what it took out or put in. What a change still does over the whole draft is a few cheap passes over its statements, so a keystroke in the release's notes or contact grows with the draft only by those.

A change is refused, writing nothing, for:

A check informs, and a source is used by, the draft's own activity that generated the release. A next version, generated only by activities carried over, is given one when it first needs it, #revision-<N>. A check is recorded only as a machine's or an AI's, in words that say it was no human review ("Scope: …; an AI check, not a human review."). The release screen makes these changes (below). A creator names the ids, the way courses.md says.

Writing a draft

A draft is written in six screens: its overview, a chapter, a step, a question, its cards, and its release metadata and provenance. They share the draft as one query, read once (getReleaseDraft), and change it by DraftChanges. Four more read it: its release check, its listing preview, its trial, and its comparison with the release it follows.

How edits are saved

Every edit is made at once on the screen, then written in the pod (editReleaseDraft), by the editor's hook (draftEditor.ts, useDraftEditor):

A draft released is frozen, its next version started from the drafts, its release screen or the releases (below). Nothing is changed either while the instance's data check is under way, or blocks the instance (below).

A draft's overview

The overview (DraftOverviewContainer) names the draft, its kind and version, and edits its title and description. For a course, it shows the outline, adds a chapter (its title, and its id), and lists the chapters retired, to restore, 50 at first and 50 more at a button. It counts the draft's cards, with a link to their table (a deck's cards are added here), and the problems the release check finds (for a pod, the shapes left out).

The outline

The outline (DraftOutline, a list named Outline) is a course's chapters in their order, each with its steps ("Step 1.2"), each step with the questions that check it, in the order of their ids, each linked to its editor. Chapters and steps are arranged as the deck list's groups and decks are, with the same code in ui:

Each move is a moveChapter or moveStep change (outlineMove in draftOutline.ts). A drop the draft no longer has a place for (it changed under the drag) comes to nothing, and says so.

A chapter, step or question the release check finds problems in has a badge beside it ("2 problems"), a link to the check.

A draft started from a release can have any number of chapters, steps and questions, so the outline is cut short (outlinePart). It shows 50 chapters at first (OUTLINE_LIMIT), and a button shows 50 more. For each 50 chapters shown it shows at most 500 steps (OUTLINE_ROW_LIMIT), at most 50 of a chapter, the first chapters' first, and at most 500 questions, 10 of a step (OUTLINE_QUESTION_LIMIT), however long the chapters are. A course as long as the project's longest shows in full. The rest of a chapter or a step is a link to its screen ("12 more steps"). The chapter, step or question the page shown edits is shown wherever it is, a step past those shown last of its chapter's. A question is shown under the first step that asks it. For one asked only in a chapter's final review, which the outline lists no questions of, that chapter is shown. A step dropped after the last step shown of a chapter cut short goes to the chapter's end. One dropped on a chapter's header goes to its end when none of its steps are shown, and to its start otherwise. One dropped right after the step the page edits goes there.

On a course draft's other screens the outline is in the aside (OutlineAside, above), where it navigates and arranges too. The one the page shown edits is marked (aria-current="page"; currentOutlineKey in shell/workspaceLayout.ts), and each badge links to where its first problem is fixed, as the check's links do (targetRoute). The overview keeps the outline in its main content, with its new chapter and its retired ones, and has no aside.

A chapter

A chapter's screen (ChapterEditorContainer) edits its title, always plain text, and its description, with "Format with Markdown" (sm:textFormat of the chapter). A preview shows it as the course's screen does, beside the field on a screen 80rem wide or more, else under it. The screen orders the chapter's steps, up or down, adds one, and restores one retired. It lists the questions asked only in the chapter's final review, and adds one. Each of these lists shows 50 at first (OUTLINE_LIMIT), and a button shows 50 more.

A step

A step's screen (StepEditorContainer) edits its theory, in each language it has, with "Format with Markdown" (sm:textFormat of the step). In Markdown, each text is hinted at where it wouldn't show as meant, by the rules of prose (PROSE, markdown.md). A preview, beside it on a screen 80rem wide or more, else under it, shows the theory as the course player does (ProseField in ui, with the player's DataProse). The screen lists the questions that check the step, 50 at first and 50 more at a button, and adds one: its front and back, its id, and the question it's asked before, if not after the last.

A question

A question's screen (QuestionEditorContainer) says where the card is asked: a step, a chapter's final review, or nowhere yet; choosing another moves it there (moveQuestion). The place is chosen in two parts (PlaceChoice): a chapter, then a place in it, its steps by their numbers and its final review, so every step of every chapter can be chosen. The chapter select lists 50 chapters at first (OUTLINE_LIMIT), the place select 50 of the chapter's steps, and a button beside each shows 50 more; each lists the place chosen wherever it is. While another chapter is chosen, the place select says the question isn't in it. A chapter is named cut short when it's long (chapterTitles, which numbers two chapters that would then read the same). The choices are listed again when the draft's chapters or steps change, not as the user types. As the closed select shows only the step, its name for a screen reader (aria-labelledby) is its label and the place chosen, with its chapter. Its content is Solid Memo's card editor (CardContentFields), saved by Save; its wrong options are the inspector's (DistractorFields, each change saved as it's made: distractorChanges). A wrong option belongs to one card, as in a deck (data-model.md). One that another card names too, as an imported file may have, is only taken off this card when deleted here (unlinkDistractor), and stays on the others. A preview asks the card as the course does (CourseQuestion, with MultipleChoice), as typed, to answer and ask again: beside the form and in sight as it scrolls on a screen 80rem wide or more, else under it. As a question offers the back and at most five wrong options (courses.md), the preview shows at most five of them.

A draft's cards

A draft's cards (DraftCardsContainer) are a table, a row each, by id: its front (a link to its editor), its back, where it's asked (its chapter's title cut short, as above), its wrong options in use, and its id. The URL holds the view (above).

The table is a DataTable. Retire 2 cards or Restore 1 card, in the selection's bar, retires or restores those selected the filter keeps, in one edit. Nothing is selected while the draft may not be changed. Enter opens a card's editor. A new card is added under the table, asked nowhere yet.

Ids

The id assistant (courseIds.ts) suggests each new subject's id, the way courses.md names them:

A number of more than 15 digits in an id already there isn't counted, and a number already taken is skipped.

An id is taken when a subject of the draft has it, a release before it published it, or anything in the draft names it. That's a statement, one of the release's own fields, or a record's: a step's questions and chapter, a chapter's review questions, a card's wrong options and subjects. Only a field that holds an IRI names one: a name, a text or a date doesn't, whatever it starts with. So an id the draft points at, though no subject has it, is never suggested or accepted. A new question given it would join the step that asks it, and a new chapter would take in the step that names it as its chapter.

The forms suggest and check an id on each keystroke, and typing in a chapter's, a step's or the course's text beside them makes a new version of the draft each time. So the ids taken are gathered once for each version of the draft. A version that keeps every id of the one before it and every IRI of the draft its fields name, as an edit of text does, keeps its ids taken too. Each id suggested is found once for those ids. Gathering them again on each keystroke would go over every statement of the draft as the user types.

The question editor draws again on each keystroke in its card form, too. The ids a release before the draft published, which its wrong options are checked against, are gathered into a set once for that release's ids (publishedIdSet), which every edit of the draft keeps, not once for each keystroke. A draft read again gathers the set once more.

The user may write an id other than the one suggested. The field says at once when an id is none a subject can have, or one the draft or a release before it has or names. A new question's id sorts after the step's last; past z, it's the last's id with a number after it.

A new question may instead be asked before one already asked ("Ask it", questionIdBefore), one of the place's first 50. Its id then sorts between that one and the one before it: a free letter when there is one, else an id from idBetween. Before the first, the place's own name (q-<topic>-<n>, q-<topic>-r00) is the lower end. When no id sorts there, the form says so, and the user writes one. An id the user writes is asked where it sorts, and the form says when that isn't where "Ask it" says.

idBetween finds a free id that sorts between two others, by code unit: a number after the first when one fits, else one made code unit by code unit. A seeded property test checks that it keeps the order and never gives an id taken.

Nothing an earlier release published is deleted, a wrong option among it: its Delete is held, and the screen offers to retire it instead.

The release check

The release check (ReleaseCheckContainer) runs every rule a release is held to on the draft, as the release it becomes: the rules npm run library:check runs on decks/ (deck-library.md), from the domain's (release/). The use case is checkReleaseDraft(draft, markdownCheck, policy). It finds:

The library's index, or the release the draft follows, that can't be read is a problem of its own (libraryUnread, previousUnread), and the rest of the check stands. When whether the release the draft follows is the instance's or the library's can't be told, as its catalog or the index can't be read, it's previousUnread. Such a check isn't kept: the screen checks again when it's opened again, when its window is focused, or by its button, as after a check that failed.

The draft checked is the editor's, changes not yet written included, each version once; the release a draft follows is read once.

The policy is a pod's by default, its data's rules only. policy=library adds the Solid Memo library's curation (repoPolicy) and its place among the library's decks. The curation asks:

Neither policy names a series, author or host: a library is its index, and a policy is data.

Problems are codes, never text (problems.ts), worded in the reader's language (studio.problem.<code>, problemText.ts). They're listed by severity, then by what they're in, in two lists, Errors and Warnings. Each subject links to its editor, and each problem to its field there (problemTarget), focused; a wrong option's problem opens its question at it, and counts under it in the outline's badges. A draft can have any number of problems, so each list shows at most PROBLEM_LIMIT (50) and says how many more there are; the counts and badges count them all. A problem's text names at most ID_LIMIT (20) of the subjects or values it lists (the ids a draft drops, the steps that ask one question, the values stated), and how many more there are.

Not every problem can be fixed in the Studio yet, so a new draft's problem count may not reach zero:

The listing preview

The listing preview (ListingPreviewContainer) shows the draft as learners see it in the library: its row in the library's list (LibraryDeckRow) and its own page (LibraryDeckScreen). They're over a library deck built from the draft alone (draftLibraryDeck in draftListing.ts), each source's title and authors read as learners read them, plain text only, and no more of its metadata and sources than learners' listing keeps (withBoundedListing, boundedSources). Both are inert: nothing in them to follow or press.

The trial

The trial (TrialContainer), the draft's Trial tab, plays the draft as learners play the release it becomes: a course with Solid Memo's own course screens (its page, a chapter's steps, its final review), a deck with Solid Memo's study. Its pictures, and a question's preview's, stay hidden until the author chooses to show each host's, for as long as the page stays open (privacy.md).

It's played in a sandbox, set up by openTrial(draft, instanceUrl) with startTrial, both in trial.ts:

A draft that can't be played is refused, with what blocks it (trialProblems), each a link to its field: the course's rules, and what the player needs of a release (its title, and each chapter's and step's fields). The release's publisher, version, series, distribution and theme don't block it. A draft can have any number of these problems, so the list shows at most PROBLEM_LIMIT (50) and says how many more there are.

The course's screens link to the trial's routes, by CourseLinks in ui (courseLinks.ts), which is Solid Memo's course routes unless a provider says otherwise. Each trial has its own query client too.

Its controls (TrialControls):

After each control, what is shown is read again. Leaving the trial's screen, or reloading the page, forgets it.

The release diff

The release diff (ReleaseDiffContainer), the draft's Changes tab, compares a draft with the release it follows (its dcat:prev). A draft of a first version follows none, and the screen (still at its address) says so. The use case is diffReleaseDraft(draft) (releaseDrafts.ts), which reads the release once and fails when it can't be read. It compares the draft only with a release the instance published or the library's, as the release check's Drops do. Any other can change after the draft was made from it, so of that one it says what the check says (previousElsewhere) and reads nothing. Whether it's one of those is told from the instance's catalog and the library's index: when either can't be read, the diff fails, where the check's Drops say previousUnread instead. It shows:

The learner's copy is built in memory from the release and the draft (draftLibraryContent in draftListing.ts), reading and writing nothing. Each version of the draft is compared once, as the editor keeps it, changes not yet written included.

The release's metadata and provenance

The release screen (ReleaseMetadataContainer), the draft's Release tab, edits the release's metadata beyond its listing, who made it and how, and what it was made from, written as the library's releases are (deck-library.md). Each change is a DraftChange, saved as the other screens save theirs (above). Its parts:

What the check asks of a release's provenance

The release check warns of what a reader of how the release was made would miss (provenanceProblems in provenanceRules.ts), each a warning that links to the release screen:

The library's command reads a release alone, and can't tell which of its making is an earlier version's, so it doesn't run these rules; the Studio does (quadsToReleaseModel marks no making carried).

Publishing a release

Below a draft's metadata, the release screen (ReleasePublishContainer) releases it, two ways.

Publish to my Pod (publishRelease in releasePublishing.ts):

A pod that has no access control the app can write, refuses the write, or names another access control than the release's own (the folder's, say) keeps the release written and listed, readable by its owner alone. The draft is released anyway. The screen says so ("Only you can read it"), with Make it public, which tries the access again (makeReleasePublic; publicAccessRefused when it still fails). It asks first, in a ConfirmDialog that names the release and says the Studio can't make it private again, both on the release screen and in the releases screen's table.

A public release's screen has Copy a link to try it. It copies Solid Memo's link to the release for anyone, #/try?url=…, on the page the Studio shares with it (routing.md). Someone not logged in opens it as a guest, ready to add.

Make it public acts only on a release that meets all of these, and Start the next version reads one as the user only when it meets the last, as a draft of a deck reads the deck's cards:

So a link in the catalog, which anyone may have written, opens nothing else to everyone, nor a release of the user's own that an instance in someone else's pod lists. Nor is such a release copied into that instance as its next version, nor a deck's cards into a draft there or into another of its decks (moving and copying cards). The releases screen lists only links at an http(s) address named as a release is, …/<name>/v<N>.ttl, as a request sends it, with no empty segment (//) and no user info (isPublishedReleaseUrl, data-model.md). Whether a release is public is asked without credentials (isReleasePublic).

A guest's draft offers only the download.

A released draft shows where its release is, a link to copy, whether anyone can read it, and Start the next version, which makes and opens a draft of version N + 1 (above). Deleting a released draft leaves the release.

Download .ttl (downloadRelease) saves the draft as a release file, <name>-v<N>.ttl, to propose it for the library, at the address the library would publish it at (libraryReleaseUrl, by the library's index). Nothing in the pod changes, and nothing's checked: the library's own check does that. The screen lists the steps of a pull request, in a copy of the repository:

  1. Put the file in decks/ as decks/<name>/v<N>.ttl.
  2. npm run format:turtle && npm run library.
  3. npm run library:check -- --base main.
  4. npm run check && npm run crosscheck.
  5. Open a pull request with the new file: the site's build makes the index (deck-library.md).

It links to the draft's release check for the library first (above).

Releases

The releases screen (ReleasesContainer, listPublishedReleases) lists the releases the instance published, as its catalog links them. Each shows:

It changes no release. The table is a DataTable, a column's name sorting it, then the other way, then as the catalog lists them, and Enter opening the release at the cursor. That opens the address its link does, as the URL parser has it, or nothing when it has no link: j and k then leave the focus on the page's body, and go on from that row. A filter keeps the releases whose name or address holds its text in its first 200 characters, case and accents aside. A column sorts by the first 200 characters of its text, as every Studio table does (sortedRows). The sidebar and the drafts screen link to it ("Published releases" there). A learner adds a release in Solid Memo by the link copied here (deck-library.md).

Graph

The graph (graph/GraphContainer.tsx, readInstanceGraph) draws what Solid Memo keeps in the instance: every folder, document and resource is a node, and every link between them an edge.

Its nodes, each drawn in a shape of its own, its color only helping:

NodeWhat it isDrawn as
folderthe instance's folder, or a folder in it that holds a document reada rounded square
documenta document read; one that wasn't there, or couldn't be read, tooa square, dashed when it wasn't there or couldn't be read
resourcea subject a document defines: the catalog, a group, a deck, its distribution and its authors, a card, a wrong option, a review state, an answer, a receipt, schedule or month summary of the digest, a draft, a chapter, a step, a releasea dot
vocabulary terma class (sm:Card), a concept (sm:frontToBack), a license, a topic or theme, a media type, an EU authority table: one node for each, however many link to ita small square
"in your Pod"an address in one of the user's storages that isn't Solid Memo data: the WebID profile on many servers, a release published to another foldera diamond
"outside your Pod"any other address: a library release a copy came from, a picture, a source, a mailto: addressa hollow dashed ring
found in no documentan address in the instance a link names and no document read defines: an answer to a card since removed, saya crossed ring

The last four are leaves, and a leaf is never fetched, in the pod or out of it (privacy.md). Which folder holds a document, and which document defines a subject, comes from their addresses, with no request. A link between documents is drawn as the statements say.

Edges. They're in three kinds, each in a color at 3:1 or more on the background: links green, a folder's or a document's own gray, and those to a vocabulary term amber, paler where bundled. A folder's or a document's own edges start at its square, those to a term end at a small square, and the table of edges names each.

Filters. Above the graph is a row of filters:

Then come how many nodes and edges are shown of all, and how many edges go to terms while they're shown. The filters are kept for the page's life, for each instance.

Names. A node is named by its address, never by its text. The instance's folder is named by the instance's name, a folder by its own name (decks/), and a document by its path in the instance. A vocabulary term is named in short (sm:Card), a blank node by its label, and any other by its fragment, else the last part of its path. Two folders named the same are told apart by their parent folders (capitals/v1/, verbs/v1/), else by their paths in the instance. Two nodes of documents named the same are told apart by the file (korean-verbs#card-7), else by its path in the instance (decks/capitals#sweden, reviews/capitals#sweden), with no extension. Each is drawn cut at 24 characters, in the middle, for its end to show.

Drawing it. The layout is a radial tree, its links bundled along it (hierarchical edge bundling), in graph/layout.ts, plain arithmetic with no library. Every node hangs in one tree: under what holds it (a folder its documents, a document its resources), or under what it's about when it says so, by the first of these it has:

A leaf hangs by the first node that links to it. A choice that would make a cycle falls back, at the first node of the cycle (by address) that can, to what holds it, else to the first node that links to it. If none can, that first node goes under the middle. Where the cycle is broken doesn't depend on nodes unrelated to it: blank nodes are in order by their document, then their label. No node hangs more than 16 steps from the middle: one that a chain of links (each part of the next, say) would hang deeper hangs beside its parent instead. So no edge's path is longer for a long chain, and laying it out takes no longer than for as many nodes in a short one.

The instance's folder is in the middle.

An edge of the tree is drawn along it, a curve a step.

The same graph is laid out the same way every time, every node at a point of its own. The layout runs in steps, 4,000 edges' paths a step, in batches of up to 12 ms, the page drawing between them, under a bar that says how far it is (Placing the nodes). A layout done is kept for the page's life, so coming back to the same graph draws it at once. It's kept with the whole graph it was made of, every node's id and kind and every edge. It's used only for a graph the same in all of these; any other graph, however like it, is laid out afresh. The two are compared entry by entry, not as one text, which long IRIs could make too long for the browser to hold. A node the drawing has no position for is left out, with its edges, rather than drawn nowhere. An instance of the library's ten largest decks with a hundred answers each (about 14,500 nodes and 50,000 edges) is laid out and routed in about a tenth of a second.

It's drawn in SVG: dragging moves it, the wheel zooms about the pointer, as Zoom in, Zoom out and Whole graph do. Either changes one transform and one CSS property for the edges' width, and draws no node again.

Keys. The drawing is one tab stop, as a chart is (statistics.md):

KeysWhat they do
Arrowsgo to the nearest node that way (within 45 degrees of it); the first, from none
Home, Endgo to the first node, or the last
Enterselect the node, and open it in the aside; on a screen not wide, its drawer opens, with the focus in it
Escapelet go of the node gone to
+ (=), -, 0zoom in, out, or to the whole graph

The line under the drawing names the node pointed at or gone to ("catalog, resource"). A node gone to by a key is read out in a status line, and brought into sight.

The aside (Node) shows the node selected:

Its values and each list of links show 50 at first and all on asking, the focus moving to the first new one, so a node with a great many of them still opens at once.

A leaf says why it wasn't read; a document that wasn't there, or couldn't be read, says so. A node selected opens the aside's drawer on a screen not wide. The aside shares the screen's query.

Show as a table shows the nodes and the edges the filters show as two DataTables, 100 rows a page. A node row has its name and address, its kind, the document that defines it and its first 3 classes, with how many more it has; an edge row, where it's from, its link and where it goes. A name, or Enter on its row, selects its node.

Data set aside

Every Studio screen holds to the check Solid Memo runs when an instance is opened, and to the user's invalid data policy (validation.md). useDataCheck in ui reads both with Solid Memo's workspace's queries, once (health). Each screen asks its hold about what it writes (the instance, its catalog, a list of decks or one deck), which holdOf in the domain answers, and its line names the same kind (ReadOnlySubject):

A held form is a disabled fieldset (ReadOnlyScope): links still lead on, and what is typed in it stays.

Groups

Groups (GroupsContainer) is Solid Memo's deck list without the study: the same screen (DeckListScreen) and the same edits, kept by useDeckTreeEditor in ui, which Solid Memo's DeckListContainer uses too. Decks and groups are dragged, moved from their menus, grouped, renamed and deleted there. What isn't arranging (a deck's page, its preferences, a course, a new deck, the library) opens in Solid Memo. As in Solid Memo, a deck set aside says so, and nothing is rearranged until the data check is done, nor while the arrangement is set aside. Unlike in Solid Memo, a deck held (above) can't be renamed or deleted (deckHeld), a line saying why, with a link to the instance's health.

How it is built and served