Skip to content

§13. Plugins

[[[plugins]]]

Overview

[[[plugins#overview]]]

Resource types (tutorial, reference images, Daz3D, and future types) are implemented as plugins, loaded per .rehuco declaration ([[mounts-and-storage#rehuco-scope]]). The core app provides default plugins for tutorials, reference images, and Daz3D, but the architecture doesn't assume these are exhaustive.

§13.1 Split between core and plugin-owned responsibility

[[[plugins#core-vs-plugin]]]

Core (same for every resource type) Plugin-owned (varies per type)
UUID, checksums, the save path and its locks Schema extension — custom fields beyond the common set ([[data-model#rehu-format]])
Tasks/job queue, the file notifier, the node's web plumbing Viewer layout and behavior
Permissions/access grants Editor layout and behavior
Dedup detection mechanics Web rendering and interaction
.rehuco parsing and plugin loading Custom actions with their own side effects (e.g. Daz3D install/uninstall)
The field toolkit (a shared library of reusable field widgets: text, switch, tag-list, date, rating, duration, size, choice, path, image-count, unknown, …) that plugins compose from Browser columns + cover/shelf rendering for this type ([[plugins#browsers]])
The generic resource browser (common columns) and the viewer dock shell Search/index contributions (e.g. per-image tag search)

A resource whose plugin isn't installed/loaded on a given machine should still degrade gracefully — at minimum showing the common fields — rather than failing outright, since .rehuco (and therefore plugin availability) is per-machine.

A plugin is two layers, and the lower one is non-GUI

Every plugin has a non-GUI core layer, loaded by agent and node alike, plus an optional GUI layer the agent alone loads. This isn't a concession to testability — a node needs the lower layer anyway, since plugins own web rendering ([[plugins#core-vs-plugin]]'s table) and a node has no widgets to render with. The split also keeps rehuco-core non-GUI, the same rule the field toolkit follows in reverse ([[plugins#field-toolkit]]).

  • Core layer (non-GUI) — the plugin's identity (below), its block's schema and format version ([[plugins#plugin-blocks]]), and eventually its web rendering and its observers on core-field changes (the hook seam, [[daz3d-personal-database#authors-urls]]). Importable by rehuco-node with no Qt widgets in sight.
  • Agent layer (GUI) — viewer/editor composition over the field toolkit, custom widgets, and custom actions (the Daz3D install action, [[plugins#daz3d-plugin]]).

Identity is declared, not derived. A plugin declares an ordered key list: the first entry is its main key, the rest are aliases accepted on read and rewritten to the main key on write when that key is unoccupied — a rename/migration path for free (an alias block whose main key is already taken is left under its own spelling, #137). Deriving a key from a type name instead (e.g. snake-casing ReferenceImages → reference_images) cannot express a key like daz3d, which is the snake_case of no type name at all; TutCatalog5 reached the same conclusion and declared key lists in config (base_item.py's KEY, defaults.toml's [types]).

A resource's type is its block's key ([[plugins#plugin-blocks]]), so one key list serves both — it resolves a legacy type spelling and the legacy block key it named, because they are the same token. tc4's capitalized Tutorial / ReferenceImages ([[acquisition-tooling#tc-to-rehu]]) are therefore aliases, and normalize on write.

How this build knows a plugin exists is a registry: the set of declared key lists installed here. It answers only identity questions ("is this key a plugin I have, and what is its main spelling") — never which block is active, which follows from type alone. The common core declares its identity the same way ([[data-model#rehu-format]]), which is what reserves the name core: the registry already refuses two declarations claiming one spelling, so a plugin cannot call itself core without a rule being written for it.

Plugins span a spectrum from declarative to code. Two earlier ideas — a code-plugin model, and a TutCatalog5 experiment where a user-editable TOML/JSON file declared each type's fields and editor/viewer pages from a fixed toolkit — are unified by layering rather than choosing:

  • Declarative type — a type defined purely as a field list over the shared field toolkit (text/switch/tag/date/rating/…), no code. Cheap to add (config, not programming), safe (zero code execution), but limited to what the toolkit offers. Good for simple types (e.g. a basic "3D object" with title/tags/format).
  • Code plugin — a type that uses the same toolkit fields plus its own custom widgets and actions (the Daz3D install action, refimages redaction overlays, the sketch slideshow). Maximally flexible; the only thing that needs real code.

Both produce the same on-disk block ([[plugins#plugin-blocks]]) — whether a block's fields came from a declaration or from plugin code is purely a rendering detail. This also answers a trust question ([[appendices.open-questions#still-open]]): declarative types carry no code-execution risk; only code-plugins are a trust/distribution surface. "Add a simple new resource type" is a config task; code is needed only for behavior beyond the toolkit.

A plugin declares its own badge colors

[[[plugins#badge-colors]]]

Identity carries presentation too: a plugin may declare a badge background and badge text color, each a plain hex string (#1E88E5) rather than a Qt object, so they stay in the non-GUI core layer and travel with the declaration from wherever the plugin comes from — built-in today, an external package later (#83). The agent's type badge paints a resource's type chip with them; a node ignores them entirely. Keeping the colors on the declaration rather than deriving them in the agent is the same "a plugin owns how it presents" rule the two-layer split rests on: the agent renders, the core declares.

Either color is optional, and an undeclared one resolves against the live theme, not a hardcoded default — an absent background falls back to the palette's selection background (Qt's Highlight role), an absent text to the selection text (HighlightedText), re-resolved on every palette change so a badge stays legible when the OS flips light/dark. A plugin that declares nothing still gets a sensible, theme-consistent badge; declaring only a background (the common case) lets the theme own the text color. A type whose plugin isn't installed here has no declaration to consult, so its badge takes exactly that theme fallback — the not-installed path ([[plugins#plugin-blocks]]) reuses the same None-resolution rather than inventing a placeholder color.

The built-in declarations (background only; every one takes the theme's selection text):

plugin badge background
tutorial #1E88E5 (Blue 600)
reference_images #8E24AA (Purple 600)
collection #00897B (Teal 600)
asset #D84315 (Deep Orange 800)

daz3d ([[plugins#daz3d-plugin]]) has no declaration at all — it is future work — so a daz3d: block exercises the not-installed fallback for real rather than hypothetically. These per-type category colors are independent of the app's brand palette: a badge names which resource type this is, not the product.

§13.2 Field toolkit and the viewer / editor / both surfaces

[[[plugins#toolkit-surfaces]]]

The field toolkit named in [[plugins#core-vs-plugin]] is a shared, non-plugin library the agent owns; plugins (and declarative types) compose their viewer/editor from it. This section is its architecture and the per-resource viewer / editor / both surface model that hosts it.

§13.2.1 Field toolkit

[[[plugins#field-toolkit]]]

A field binds one logical value (a common-core field, or later a plugin sub-field) to the widgets that show and edit it:

  • Field — the base: a type selector ([[field-schema#field-types]]), a name, a display label (derived from the name when not given), a viewer/editor FieldsTab (the surface each belongs to), and two factories — make_viewer() and make_editor(). Each returns a widget bundle (FieldViewerWidgets / FieldEditorWidgets: the tab, a name label, an optional editor-only misc control, and the viewer/editor widget), any slot of which may be None. Viewer and editor are deliberately separate objects, not one widget in two modes ([[plugins#core-vs-plugin]]'s editor/viewer split). Each field maps to one editor; the multi-surface split (different fields in different docks, LocalEdit2.6/#26) is the assembler's job — see FieldsForm — not a per-field list.
  • FieldRegistry — maps a field type string to its Field subclass, so a type's field list resolves declaratively ([[plugins#core-vs-plugin]]: a declarative type is a field list over the toolkit). An unregistered type falls back to the unknown-field surface (LocalEdit2.8/#28).
  • FieldsForm — composes an ordered list of fields into per-tab 3-column grids (a QGridLayout laid out label | misc | content, with header-pinning), asking each field for viewers or for editors depending on which surface it builds. It also routes the fields' outward-facing signals to the owner, matched by structural protocol rather than by field type: StatusReporter (the authors viewer's hovered-link URL) and ImageActivator (the images strip reporting a clicked screenshot). This is the toolkit's standing rule — a field decides that something happened, never what the app does about it: it does not reach for a status bar, a window, or a settings value it doesn't own. The owner (DocumentSubDocks) collects such fields on every form it builds, rebuilds included, and acts.

The toolkit lives in the agent (packages/rehuco-agent/…/fields/); rehuco-core stays non-GUI. Which fields a type has is declared by its plugin ([[field-schema#resource-types]], #195) — names only, so the declaration stays non-GUI and a node can read a block's shape from it; the agent maps each name to a toolkit type. A type whose plugin isn't installed here declares nothing, which is already the fallback path ([[plugins#fallback-editor]]). Where each type's ordered list is authored is still not decided — see the open question ([[appendices.open-questions#still-open]]); the order is a hardcoded Python list spanning every type, filtered per type.

Content fields vs. the location control — two different categories. Almost every field is a piece of content: a value stored inside the .rehu payload, bound bidirectionally to its editor. These follow a value-widget contract — a value property, a value_changed signal, and a set_value slot (as DurationEdit / SizeRow / DateEdit already do) — and a scalar-or-list value fits it directly (a multi-choice field is just value: list[str] + value_changed). Consolidation of the remaining content fields onto this contract (e.g. text's inline QLineEdit becoming a value widget that owns the echo guard) shipped in LocalEdit2.8/#28. The path field is not content: it controls the resource's identity — the .rehu's file name and possibly its parent directory — not anything written into the payload. It rides the same FieldsForm purely for layout convenience (label + middle control column + row alignment), which is why its owner constructs it out-of-band as a leading field rather than from the type's field list. Its interface is therefore not a value: it is a command out (a chosen name — suggestion_clicked(str)) plus display-only inputs (the suggestions to show and the current name); its location display is a read-only projection of the path that only changes when a rename actually succeeds. So the value-widget contract is the default for content fields, and the path field is not an exception to it but a different kind of object outside its scope. The suggestions it displays are still derived from content fields (title / publisher / …), so the naming domain logic belongs in a dedicated suggestion source, not in the widget — the three roles stay separate: compute (a name-suggestion model) → present/command (the path field) → execute (the view-model's rename).

Fields compose — groups, lists, and nesting. Beyond leaf fields (text, switch, …), a group field is an ordered set of subtype fields, and a list field is a repeatable group. A composite is configured declaratively: the admin names a group and lists the subtypes that make up each item. A list renders each item as its subtypes stacked with their labels, plus per-item controls — [+] (insert a new item after this one), [trash] (delete this item), and a [grabber] handle for drag-to-reorder. Because a subtype may itself be a group or a list, fields nest to arbitrary depth. Example: the multi-source editor ([[plugins#viewer-editor-both]], [[field-schema#sources]]) is a list whose item group has three text subtypes:

Publisher: [publisher edit]
Title:     [title edit]
URL:       [url edit]

The record-list machinery ships as ItemListEditor (borco_pyside.widgets): a view over a model plus the insert/duplicate/delete/reset and top/up/down/bottom action columns, with the keys armed on the view alone (an edit has a key, F2, and no button). Its two clients are the settings pages' StringListEditor and the authors record rows (#97). Declarative group/subtype config — a composite an admin describes rather than one a field builds — is still unbuilt, as is nesting past one level. Drag-to-reorder ships in the card list (CardListEditor, #390), which the sources editor uses (#391). A composite field returns one editor widget from make_editor() — a container holding its stacked subtypes — so owning child fields needs no base change, and never a list of editors.

A field may bind more than one model field. Field.names lists them (just its own name for nearly every field); the assembler resolves one binding per name and hands the field all of them, so a field still never sees the model. That is what lets the two sizes be one composite over original_size and current_size sharing a single scan (#232), and the two durations be the same over original_duration and current_duration (#233) — each merge exists because both halves are the same scan, differing only in when the user accepts it, so two independent rows meant running it twice for the same answer. The editor is one widget holding its own grid, per the rule above; the viewer is not bound by it — a viewer row carries no internals to align — so such a field still contributes one plain labeled row per name. A pair spec whose type declares only one of its names is narrowed to that name rather than refused.

§13.2.2 Reactive view-model

[[[plugins#view-model]]]

The surfaces never touch RehuDocument ([[data-model]]) directly. A thin view-model — a QObject wrapping the pure document — exposes each field as a reactive property with a …_changed signal plus a dirty flag; setting a field writes through to the document, marks dirty, and emits. This is what makes live "both" work: an edit in the editor surface updates the view-model, whose signal the viewer surface is bound to, so the viewer re-renders without the two surfaces knowing about each other. Keeping the reactive layer in the agent preserves the core's non-GUI purity ([[plugins#core-vs-plugin]]).

One view-model per open resource, app-wide (#375). The same bindings that keep two surfaces of one document in step keep two hosts in step: a resource shown both in a Documents dock and in the Documents preview, or in two docks, ([[plugins#browsers]]) is one view-model held by both, so an edit in either shows in the other before anything is saved. A registry keyed by path owns the view-models and hands the same one to every holder; a view-model lives until its last holder lets go, and the unsaved-changes prompt belongs to that last release, not to closing one of several views. A rename relocates every held view-model at or beneath the renamed paths ([[mounts-and-storage#out-of-band]]).

Common-core title / publisher / url are attributes of a source record ([[field-schema#sources]]), and sources is a list; the view-model exposes it top-first, the top entry being the primary, and the Main Editor edits it as one card per source (Title, URL, Publisher) on the reusable card list (borco_pyside.widgets.CardListEditor, #390, #391). The viewer keeps its Title, Publisher and URL rows, showing the primary.

§13.2.3 Viewer / editor / both surfaces

[[[plugins#viewer-editor-both]]]

Each open resource has viewer surfaces and editor surfaces, every one built by a FieldsForm over the same view-model and toggled independently:

  • Two viewer surfaces — Main View (the location, the type-declared record fields, and the unknown-field / inactive-block fallback rows; the type badge is not a field surface at all but the lead item of the document's own toolbar, so it reads whichever docks are open) and Description View (the image strip, then the rendered Markdown description filling the rest of the height). They were one surface holding all of it until the two tall, scrolling halves were split apart from the record fields they sat around.
  • Three editor surfaces — Main Editor, Description, and Images.
  • viewer only, editor only, or both — chosen by toggle actions; "both" is the live case above. A typed resource opens as a reader: the two viewers are shown side by side, Main View left and Description View right, and every editor starts hidden behind its toggle. A resource with no type — brand new, about to be filled in — opens the other way round, on the Main Editor alone. A user who prefers otherwise saves the arrangement they want as that type's default layout, "(no type)" included, which every document of the type with none of its own then opens into.
  • The surfaces are hosted as docks inside a per-resource nested dock area ([[plugins#dock-shell]]), so "both" is arrangeable docks, not a fixed split. See [[component-decomposition]] for the containment hierarchy this produces.

§13.2.4 Document-dock shell

[[[plugins#dock-shell]]]

The agent hosts open resources in a document-dock shell: a MainWindow holding a Documents dock — an ordinary QtAds dock the user hides and shows like the Log and Tasks docks, not the central widget — whose own nested dock manager holds one dock per open .rehu. Opening a file shows the Documents dock if it is hidden and raises it, then adds the new dock to the currently focused document's area (tabbed) and makes it current — what was just opened is on screen whatever the layout was; opening a file that is already open focuses the existing dock rather than opening a second. Each document dock is itself a nested dock area holding that resource's sub-docks — the word for a dock inside a document dock, three managers deep ([[appendices.qt-ads#focus-highlighting]]). The sub-dock set is declared per resource type — [[plugins#core-vs-plugin]] applied to docks: the common shell every document has — the two viewers, main view and description view; the main editor, the description and the images editors; plus the hidden-by-default inspection set — save preview, on disk, log, checksums, files ([[plugins#files-subdock]]) — and then the type's own: a reference pack adds content images (the browse over its archived and loose images, [[reference-images#modes]]), a tutorial adds its player, its video tree and its notes ([[plugins#in-app-player]], [[plugins#video-tree]], [[plugins#video-notes-dock]]), an asset adds its license text ([[assets#licenses]]), a collection adds nothing. The images sub-dock doubles as the drop target of [[acquisition-tooling#drag-drop-aids]]. The surfaces are the viewer/editor pair ([[plugins#viewer-editor-both]]). This replaces the LocalEdit1 per-file window (#7) and is the same shell the catalog browser later opens viewers into ([[plugins#browsers]]). See [[sequence-open-document]] and [[activity-open-document]] for this flow traced end-to-end.

A layout follows the type: the default layout is saved per type with no inheritance across types, and a document opened with no stored layout of its own gets its type's — a session-restored document gets what was stored, and only if that cannot restore does the type's current layout step in. The set follows the type: built when the type is first known — at open, or at a session-restore placeholder's deferred first read — and swapped by a later type switch in the editor, which closes and removes the outgoing type's own docks, their toolbar toggles with them, and adds the incoming type's hidden. A switch applies no layout — the docks the user is switching from stay as they are; the layout button afterward applies the new type's default. The one exception is leaving (no type): the empty type is a type like any other here, with its own saved default and an as-built layout of the Main Editor alone, and that layout only ever meant "no type yet" — so picking a type for a type-less document applies the new type's default (saved, else as-built). A session-restored document's stored layout still wins over this: its type arriving from the deferred first read is not a switch. A layout restores onto a dock set other than the one it was written against: a dock it names that isn't built is skipped, and a built dock it never names is put back hidden where it always lives ([[appendices.qt-ads#structural-layout]]). That tolerance is what retires the hand-bumped layout version: adding a dock to one type no longer resets anyone's layouts. Each dock's persisting widgets ride in that dock's own entry of the layout, so a dock the layout drops takes nothing else with it.

The open-and-forward and single-instance semantics this shell realizes are owned by [[nodes#local-vs-swarm]] (local-file mode) and [[nodes#single-instance]] (single-instance / file association); session persistence and the close guard are a later slice (LocalEdit2.1/#21). A nested surface toggle must carry the [[packaging-deployment#qml-regression]] closed-dock-size workaround (stash splitterSizes on viewToggled(False) — closeRequested never fires on a toggle-hide — reapply on viewToggled(True)).

The sub-docks are one reusable piece. The document sub-docks, the document toolbar and the layout button are built into whatever dock manager hosts them and can be torn down and rebuilt there for another resource (#380), not something only a Documents dock owns. A host names its own namespace for the per-type default layouts it keeps, so a layout saved in one never changes how another opens that type. Today the Documents dock is the only host; the browsers and the Roots view show a selected resource through its preview, below, and hold no document sub-docks of their own (#381).

The preview dock. Documents holds at most one preview dock (#39), the way an editor's file explorer opens a file in a preview tab. Showing a .rehu open in an ordinary dock focuses that dock; showing one the preview already shows does nothing; showing any other puts it in the preview, made if there is none. The preview switches in place: the same dock, the old document's sub-docks torn down and the next one's built into the same manager, the old model released — the rebuild above, inside a document dock. It is promoted to an ordinary dock, in place, by a double-click on its title, or by being asked for another .rehu while it has unsaved changes — nothing is lost or asked, and the other .rehu goes to a new preview. An edit alone does not promote, nor a saved one. Its title is the document's label in italic; its object name is Preview-<n>, numbered per preview because a promoted dock keeps the manager registry entry it was added under ([[appendices.qt-ads#dock-registry-keys]]). It is in Open recents only once promoted, and it is restored with the session as its own entry ([[plugins#session-restore]], #576). Each type's preview remembers its own layout under preview_layout/<type>, captured whenever the preview stops showing that type (a switch, a promotion, its close, app exit) and written at exit; a type with none opens with its default layout. That layout is implicit: the Layout button in a preview acts on the type's default layout, as in any document dock.

§13.2.5 The files sub-dock

[[[plugins#files-subdock]]]

Every document dock carries a Files sub-dock, hidden by default beside the inspection set: a browsable table over the resource's own folder — name, a checksum verdict, what the file is to the resource, size and modified — so what the app's own renames, conversions and drops did to the folder can be read without leaving it.

It is confined to the resource's own folder. The root is the record's directory, and there is no way above it: a .. row appears only while the reader is below the root, and both it and the toolbar's up action stop there. Going up would leave the resource entirely, and a general file manager is not what this is — the neighboring folder a reader wants is reached by opening the resource that owns it, which is what the foreign-record rows below are for. The toolbar also carries home, the one-click jump back to the record's own directory from any depth; it and up take the same condition and are both grayed at the root, and grayed together for a document with no folder to go home to. Up and the .. row wear one glyph, being one act reached two ways, and deliberately not the glyph the folder rows wear.

What a row lets you do is decided by what the file is to this resource — the roles [[data-model#resource-scoping]]'s coverage rules already name, asked one directory at a time rather than as the recursive is this content the size scan and the checksums ask. Three kinds are shown but not actionable, each a deliberate refusal: the resource's own record, because that is the document already on screen; a foreign record's sidecar; and content a foreign record covers, because its screenshots are curated in its images dock and its content is covered by its checksums, so there is nothing here to do with either but see that it is there. The refusal lives in the model's own item flags, so such a row cannot be selected or activated at all rather than being activated and ignored.

The four things a double-click can do are each routed out of the sub-dock rather than done in it, since it knows what a file is and none of what to do about it:

  • a folder — walked into, unless the listing is covered by a directory-scoped record that is not the browsing document's, in which case everything beside it is that record's wholesale (#254) and its own row is the way in. The predicate is deliberately directory-scoped rather than any record, which settles three cases at once. A directory-scoped resource browsing its own folder always keeps its subfolders: it covers that ground, so nothing sitting beside it can take them — not a file-scoped foo.rehu, which claims only its same-stem siblings, and not a legacy info.tc a conversion left behind, which is the same resource under its old name. A folder holding several file-scoped records and no info.rehu keeps its subfolders too, for the same reason read the other way: no record there claims the ground. And a file-scoped foo.rehu sharing a folder with an info.rehu does not cover it, so its subfolders belong to that record — as do those of any subdirectory holding a record of its own.
  • another resource's record — opened, or focused if it is already open, through the window's ordinary open route, so it is resolved, the documents area is revealed and the file joins Open recents exactly as a menu open would ([[plugins#dock-shell]]).
  • this resource's checksum record — a Verify All over this resource, the same action its own toolbar carries ([[data-model#checksums]]), so there is one definition of what that checks. Inert where the document was built with no queue to enqueue a run on.
  • an image — opened maximized through the same owner-routed activation the strip uses ([[plugins#tutorial-plugin]]), but against every image in the browsed folder, curated or not: this is a view of the folder rather than of the lightbox's set, and a screenshot someone curated out is exactly the one they may want to look at here ([[data-model#image-meanings]]).
  • a video of a tutorial — played in the document's player ([[plugins#in-app-player]], #317): the player dock is shown and made current, and jumps to the clicked video in the tutorial's whole playlist, whichever folder the table is in, and plays it from where it was left. The table reports the video's key alone. A second double-click points the one player at the other video rather than opening another.

Anything else is handed to the system's default handler — a video of a resource that records no progress included.

A tutorial's rows end with what its user has watched ([[field-schema#watch-progress]], #316). A video's row ends with its percentage — 100% once viewed, else its position over its length, nothing for a video never opened or whose length is not known — and a folder's with the duration-weighted share of every video beneath it, which shows none, with a tooltip saying why, while any video beneath it has no known length: a share of a total nobody knows would be a wrong number. The videos whose files are gone but whose progress is kept are listed in the folder they were in, as missing rows that open nothing.

What can be done to the selected row is on its context menu and on the toolbar, behind a separator, each action shown only where it applies rather than disabled elsewhere: Favorite and Viewed, toggles ticked as the video is, on any video of the resource, and Forget, the only way a kept entry is ever removed, on a missing one. A row with none of them opens no menu and shows no separator. There is no Measure button here: a video's length is known from the main editor's duration Compute, which probes every video once, fills the total and writes each video's length into the record, or from a player recording the file's length as it plays — so a video shows a percentage once it was measured or viewed, and nothing before. Everything redraws when the document model says progress changed, from what was already read, and listing the files is also when a renamed video takes its progress with it.

The checksum column reports what this record claims, and nothing else. Six verdicts and an empty cell: nothing at all for the record, a sidecar, a folder, content another record covers, or every file at all when this record cannot be read — this record makes no claim there, which is different from a claim of ignorance, and reading the neighbor's record to answer for it would make a glyph mean somebody verified this. Content this record holds no hash for says so (whether the resource has no .checksum at all, that record skips the file, or lists it with no hash — all are nothing is recorded about these bytes, and the remedy for all is the same generate; #467). Four are matched-or-not crossed with fresh-or-stale, and the fresh/stale split is the run's own staleness rule rather than an opinion formed in the GUI: a current glyph means exactly a verify would skip this file, and a stale one means exactly it would not. A claim moved in from another record — a hash with no date and no verdict — is stale and not yet verified at this location, never a mismatch (#467). The last is an entry resting at malformed (#303), its own glyph with no stale pair: this build has made no claim about the bytes — drawing it as a mismatch would assert a check that never happened, and drawing it as missing would invite a generate that overwrites a neighbor's entry. The mapping from an entry to a glyph is one function the checksum dock (#244) reads too, so a file's verdict looks the same in both. One .checksum read per refresh, whatever the folder holds.

It refreshes when shown and on demand — F5 and a refresh button, each refreshing only this sub-dock — plus whenever the app itself changes something beneath the resource's folder: a rename, a save, a conversion, a screenshot moved or deleted, a checksum run finishing ([[mounts-and-storage#out-of-band]]). Never in between. Each read is applied in place, so a selection and the scroll position survive it, and a rename or convert keeps the reader in the same subfolder rather than sending them back to the top. Deliberately not QFileSystemModel: that model installs a file-system watcher that holds handles open on Windows, and a held handle is exactly what makes a rename or a delete of the resource's own files fail — the app would be locking what it is about to move. The same reasoning already keeps a watcher out of the node ([[mounts-and-storage#out-of-band]]). A plain listing costs one scandir per refresh and holds nothing between them, and it runs off the GUI thread: neither that nor the record read is slow, and either blocks for the share timeout when the mount is away ([[mounts-and-storage#offline-mounts]]) — an unreachable folder says so rather than drawing an empty table over it (#245).

§13.2.6 Session restore

[[[plugins#session-restore]]]

Quitting and restarting brings the app back as it was closed. The open documents and their layouts have been restored since #21; what was still lost at every start is restored too. What is restored waits for what it needs, and is not lost while it waits: anything not applied yet is saved again unchanged if the app quits first, so a document never viewed, a catalog on a server that is off or a root that did not answer costs nothing.

  • The preview ([[plugins#dock-shell]]) joins the session as its own entry — path, layout and the dock's name, which the saved layout knows it by — rebuilt at startup as a pending placeholder like every other document, read when its tab first reaches the screen. It is still not in Open recents. It is what brings the current record back, with its layout and its maximized view: a preview closed stays closed.
  • Each browser's selection and the Root Catalog's current row are remembered with the catalog's other per-machine state ([[plugins#browsers]]). A browser selects its rows again at its first read of every row. The Roots view walks back down its one path as each folder is listed, which QColumnView has only one of; a root that is offline ends the walk on the root's row, and the path is kept for when it answers. Neither moves the preview, which the session restores on its own, and the reader selecting anything overtakes both.
  • Maximized views, and there can be several at once — one per document, since each lightbox and each maximized player ([[plugins#player-maximized]]) belongs to its document. A document's entry records the kind, the image or video key, the surface it was opened on and, for a lightbox, the set it navigated — the curated strip, a folder from the Files sub-dock, the content images or the images editor, which comes back curating — and whether its info and its strip were shown. It is restored once the document's deferred first read has loaded it and its set has arrived, against the set as it is then — a key no longer in the set restores nothing. A video comes back paused where it was left, never playing.
  • Which document is read when. A view over the document alone waits for its tab. An app-window or full-screen one shows whichever tab is in front, so a local document with one is read at start, and they stack in session order, the focused document's on top, whatever order their reads answer in.
  • A document still waiting for its storage ([[mounts-and-storage#offline-mounts]], #698) cannot open its view: it is not read yet. A surface in the view's mode stands in for it from the start, saying what is being restored and what it waits for, so the window comes back as it was left and nothing opens over the reader's work when a slow share answers. It says so while the storage does not answer, which is asked again every 10 s while the view is up. A double-click or Esc on it leaves the maximized view, which is then no longer remembered; otherwise the view takes its place once the storage has answered and the document is read, at once for an app-window or full-screen one, with its tab for one over the document alone.
  • A maximized dock. Layouts are captured unmaximized, since a capture taken while maximized is poisoned ([[appendices.qt-ads#area-maximize]]); the maximized dock's name is therefore saved beside the layout at each manager — a document's sub-docks, the documents area, the main window, the Browsers dock, the Tasks dock — and re-applied after the layout restores, once the manager is on screen and has laid out.
  • What a tutorial shows. The player's video and which of its I, T and N panels show ([[plugins#player-maximized]]); each tree's selected row, a video, a folder or a note line, and the rows closed; each notes panel's note and whether it edits, which the player loading its own video does not take away, and which leaves the keyboard where it is.
  • The Files sub-dock's folder, and the sort of the Files and Checksums tables. Their columns are sized by their contents, so a sort is all a table has to remember; a folder gone since goes back to the top.

Quitting captures first. Each document's maximized view is recorded and put back before its state is taken: a player lifted onto a surface has left its dock, whose state walk would miss what its stage holds, and the docks are to be measured as they are under it. This happens before the players stop, which is what lets go of a video.

Every addition keeps the state files' lenient read ([[appendices.settings-pages#state-files]]): a field that is missing or malformed costs only itself, so a session written by an older build restores as it did.

§13.3 Plugin blocks: keyed, versioned, single-active-type

[[[plugins#plugin-blocks]]]

Note

Implement the block save invariant with Opus, not the auto-switched Sonnet. The active/inactive distinction, and especially the claim-then-abandon-drops-but-never-claimed-foreign-carries rule (the worked example below), is the subtle logic most likely to be implemented as the wrong-but-plausible "save the current type" — which silently deletes foreign blocks. Override to /model opus for this and check all four steps of the worked example.

Plugin fields are stored in separate, uniquely-keyed blocks (e.g. tutorial:, reference_images:, daz3d:), one per plugin, each carrying its own independent format version (the per-plugin refinement of [[data-model#schema-version]] — a plugin can evolve its block's schema without touching the common-field version or any other plugin's). A plugin reads/writes only its own block and never needs to know the shape of another's. Each block's key is its plugin's declared main key ([[plugins#core-vs-plugin]]); an alias spelling normalizes to it on write only when the main key is unoccupied — if a block already holds the main spelling, the alias block stays foreign under its own key and its type normalizes only together with its block (#137).

Exactly one type, exactly one active block. A .rehu declares a single type, whose value is the key of the one block that is active (authoritative, editable by its plugin) — they are the same token, which is what lets a reader classify blocks with no registry at all. Every other block in the file is inactive, regardless of whether a matching plugin exists: a reference_images: block inside an audiopack-typed file is inactive and treated as unknown even when the reference-images plugin is installed, because the file's type isn't reference-images. Conversely an audiopack: block is active in that file even though no audiopack plugin is installed anywhere — what is installed never enters into it. Plugin-installed-ness only affects whether the active block can be rendered richly or must fall back to the generic editor; it never promotes an inactive block to active.

Note

Why "active", not "live". This document already uses live for real-time — "live both" ([[plugins#view-model]]), live-updating viewers — and so does the code. A block that is authoritative and a widget that updates as you type are unrelated ideas, so the block model says active / inactive and leaves "live" to mean only "reacting now".

Block persistence invariant (the rule that governs save): on save, a block is written iff

  • it is the current active type's block, or
  • it is foreign payload that has never been made active during this editing session (carried verbatim, never silently dropped — a file is a custodian of blocks it doesn't own).

A block that was made active this session and then abandoned (the user switched to it, then switched away) is dropped on save — by making it active and leaving it, the user asserted "this file is no longer that." All inactive blocks (both kinds) remain resurrectable from memory until the file is closed, so switching type back and forth within a session is non-destructive until save.

One thing a switch does write, deliberately: the newly-active block is normalized on activation, the same normalization the block a document opens at receives — a JSON null under a known optional scalar is dropped, since null is the on-disk spelling of absent and the active block must never carry one into a save ([[field-schema#deferred-items]]). Normalizing earlier would edit payload the document has no standing over — activation is what gives it that standing, so the normalization attaches to the same moment as the claim. Nothing readable changes: the key read as None before and reads as None after, and revert re-reads the file.

Worked example (type starts at audiopack, file also contains an untouched reference_images block):

  1. Switch to tutorial: audiopack hidden + kept in memory but dropped on save (former active type, abandoned); reference_images shown as unknown, carried (never active). Save writes tutorial + reference_images.
  2. Switch back to audiopack: in-memory audiopack revives; tutorial hidden.
  3. Switch to reference_images: it becomes active — the plugin reconciles it (known sub-fields populate their editors; unknown sub-fields get the migrate/drop UI within the reference-images area). Save writes only reference_images.
  4. Switch away to tutorial/audiopack: reference_images is now a former-active-and-abandoned block — no longer shown as unknown, just hidden, and saving deletes it entirely (contrast step 1, where the same block key was carried because it had never been active).

The same block key (reference_images) thus has opposite fates in steps 1 and 4, determined solely by "was it ever active this session." Making a block active "claims" it; claiming-then-abandoning discards it; never-claiming carries it.

Safety net: because making a block active arms its deletion-on-abandon (a user might switch to a type merely to preview it), a save that drops a previously-foreign claimed block records the discard in the log — "reference_images block discarded on date X" — so the fact of the drop is traceable even though the values are gone, consistent with the document's "never silently lose reasoning" principle. The editor visually distinguishes "former-identity, will drop on save" from "foreign, will carry" blocks (one of the four provenance flags it labels, [[plugins#fallback-editor]]).

§13.4 Generic fallback editor for inactive / unknown blocks

[[[plugins#fallback-editor]]]

Inactive blocks (and an active block whose plugin isn't installed here) are shown via a generic fallback rather than failing:

  • Unknown block (whole plugin not the active type, or not installed): a labeled, collapsible section marked with why it's flagged — "not the current type" vs. "plugin not installed here" are different situations the user resolves differently. Default is carry-verbatim, with an explicit drop option.
  • Unknown field inside a known active block (e.g. the installed plugin is an older version than the file's block): per-field UI to drop or carry verbatim (carry is the default). A stray field that is really a renamed known one is repaired by a migration-chain step, not an in-editor remap (#85's interactive "map to a known field" was closed not-planned — renames go in migrations). Undropped fields are carried untouched.
  • Flagged items stand out in the viewer, labeled by provenance (newer-version-of-installed-plugin vs. plugin-absent vs. not-the-current-type vs. claimed-then-abandoned-this-session) so the user knows whether the fix is "upgrade the plugin," "install it," "this is just inactive payload," or "switch back to this type before saving to keep it."

§13.5 Resource browsers (per-type, with shelf/table modes)

[[[plugins#browsers]]]

The catalog is presented through browsers, which are the catalog-level counterpart to the plugin block model ([[plugins#plugin-blocks]]): just as a .rehu has common fields plus a type-specific block, a browser has common columns plus type-specific columns.

  • Generic resource browser — a table of all resources, columns = the common core ([[field-schema#resource-types]]: the primary source's title/publisher/url, released, current_size, updated). The type-agnostic baseline, and the fallback for any type whose plugin isn't installed (mirroring the generic field-editor fallback, [[plugins#fallback-editor]]).
  • Per-type browsers — extend the generic browser with plugin-contributed type-specific columns: tutorials add duration / view-progress; reference-images adds image-count; etc. Contributing browser columns (and cover rendering) is a plugin responsibility ([[plugins#core-vs-plugin]]).
  • Two display modes — tabular, or cover/shelf view (Calibre-style), per browser.
  • Clicking a resource opens its viewer dock ([[nodes#local-vs-swarm]]).
  • Click-to-filter (restored from TutCatalog4): tags, author, and publisher render as links in the viewer; clicking one sets the corresponding filter on the active browser (clicking an author shows all that author's resources, etc.). This couples the viewer dock to the browser's filter state — natural under the dockable-UI model — and was the primary filtering affordance in the usable older version.

§13.5.1 The Root Catalog dock

[[[plugins#rehuco-dock]]]

Two top-level docks, first on the action bar and tabbed beside Documents, show one opened .rehuco — a root catalog ([[data-model#local-file-trio]], #377, #461): the Root Catalog dock holds its roots and the Browsers dock its browsers, each named as its menu is, each with its own View toggle, and both revealed when a catalog is opened. The word collection is not used for it: that is a resource type ([[plugins#grouping-entities]]). Neither dock has a toolbar. The Root Catalog dock's title bar holds Refresh and the Browsers dock's New Table Browser; Scan all roots, Add Roots and Remove Root are entries of Root Catalog and Rename Browser of Browsers, the rare actions being the menu's ([[appendices.code-conventions#command-surfaces]]). One object owns the open file and its cache — the catalog — and both docks read it and hear from it when it changed; neither holds the file. A third, the Tag Browser, lists the values its records share ([[plugins#tag-browser]]).

  • The Root Catalog dock (#378) — a column view: the first column is the .rehuco's roots by label ([[mounts-and-storage#rehuco-scope]]), each further column one folder's listing, drawn like the files sub-dock ([[plugins#files-subdock]]) but with no .. row, which a column view has no use for. It is navigation, not membership: what the catalog holds is still decided by records, never by the tree ([[plugins#grouping-entities]]). The Root Catalog menu holds Scan all roots, Add Roots and Remove Root; a root's context menu holds, in four groups, the folder filter, Open in file explorer, Scan root (that root alone; disabled on a root this machine does not map), Balance Buckets... on one it does (#681, in Root Catalog too: [[mounts-and-storage#bucket-rebalance]]) and Refresh (#644); the four moves — top, up, down, bottom, with the ordering icons the settings lists use but not their list editor, whose inline insert, rename, duplicate and reset have no meaning for a root; Remove Root, apart; and, last, the catalog's own Scan all roots and Add Roots, which the empty part of the roots column offers too, with Refresh, enabled alike — the roots can fill the column and leave none (#543). Refresh sits under Open in file explorer on every row's menu, F5 working in every column (#644). A root row is two lines, its name and under it its folder, smaller and fainter and elided to fit, with its storage glyph centered beside both. Its details pane has no move buttons, the grip being the way to move one. A folder's menu holds the folder filter and the folder's rehu: Open associated rehu when its info.rehu (or info.tc) is there, Create rehu — a new unsaved record, opened in Documents — when it is not ([[data-model#resource-scoping]]). A checksum file's menu also offers Verify checksums, which queues a verify of the .rehu that shares its name — the same job the Checksums dock queues — and is off while there is no such .rehu. A file's menu offers Open in external app and the same pair for the .rehu that shares its name, and a .rehu or .tc file's offers Open. An image, and a zip the cache knows as reference images (#456) — a record of that type manages it, its own foo.rehu or its folder's info.rehu; a record not scanned yet makes it no pack until Scan runs, and the pane says so — have Open first, which shows the images in the lightbox with no document in the way: a zip's images in pack order from its central directory, an image with the images beside it in the column's order, starting on it. The surface follows the image-viewer settings, with Shift, Ctrl and Ctrl+Shift picking another as in a document; Ctrl+Alt+double-click hands the image or zip to the system's application instead, which Open in external app also does. A zip under an info.rehu has no associated-rehu entry of its own, being that same record. The first entry of a menu is the row's default action, drawn bold: what a double-click runs. A rehu is never created by a double-click, so a folder with none has no default. A details pane beside the columns shows the current row, whatever it is: name, type, size, when it changed, how much a folder holds and where it is (elided to fit), from what the listing already read, and a thumbnail for an image read off the GUI thread; for a zip, what it is made of (#456), from its central directory without inflating a member: how many files and how many are images, the size unpacked and packed, the compression method — stored, deflated or mixed, with a warning for one slow to read (bzip2, LZMA) or one zipfile cannot read (deflate64, encryption) — and whether it is a reference pack. Below the details is a button for every entry of the row's context menu, in its order, the default in bold; below the buttons, for a .rehu or .tc row or a folder that has one, what the record says: its URL as a link (elided, opened in the system's browser) and its description, rendered as the Description dock renders it and scrolling in the height the pane has left, under a line — read from the file off the GUI thread on each selection, never from the cache, and dropped if the row has changed by the time it lands; a field the record lacks is left out, a record with neither shows no line; a folder's menu and buttons also hold Open in file explorer, and its create entry is named for what it would start, Create info.rehu. QColumnView's own preview column is collapsed. A root can also be dragged to another place by the grip band of dots at the left of its row — the same handle a card list has, with its open-hand cursor and its Drag to reorder tooltip — and only by it, so a click anywhere else on the row just selects. It is dragged as a card of a card list is, by the same shared code: the root leaves its place, which becomes a shadow; the one shadow follows the pointer to where the root would land, the other roots closing up around it; leaving the list puts it back at the root's place. The drop is saved at once, like a move. The root edits act only while a root row is current, and Remove Root asks first, saying the files stay on disk and how many cached entries go. Add Roots (#578) adds many roots at once, folders and existing .rehuroot files ([[mounts-and-storage#rehuroot]]) alike, from one dialog with no dialog over it. On the left, a file browser opening in the .rehuco's folder shows folders and .rehuroot files, many selectable with Ctrl and Shift; the row under the pointer, and the current one, show a +, which stages that row -- or, when it is selected, every selected row in the tree's order -- and a path already staged is passed over without a word. On the right, the staging list, planned again off the GUI thread at every change (Checking… until it is, OK waiting for it): a .rehuroot shows its file, its label and location, its layouts, and the folder this machine finds it at -- or that it joins unmapped, to be mapped later; a folder shows its editors, always open: its Label (the folder's name as the placeholder), its Root file (the one planned beside the .rehuco, named after the folder's location (ryzen-5600--d--__DOWNLOADS--TUTORIALS.rehuroot), unique-suffixed, as the placeholder, whatever the label, while left empty; typed or browsed to, it may go anywhere both catalogs reach, such as the NAS) and its Layout, a combo of the default root layouts kept in the settings ([[appendices.settings-pages#category-groups]]) whose last entry, New layout…, asks for a preset and saves it with the others at once. Each row has an × that takes it out. A folder that a staged .rehuroot is the root of is shown only as the file, whichever came first. A row that cannot be added says why in the warning color -- a root file unreadable or already listed, a location already a root, a folder inside or around a root or a row above it (through links too), a root file already there -- and is left out; OK adds the rest in order with one save, maps each one this machine reaches, its storage detected, never asked, makes the first current, and, with Scan after adding on (by default, remembered however the dialog closes), scans each one (#542). A line the file refuses by the time OK is pressed adds none of them, says why, and leaves the file as it is on disk. When a root is current the details pane shows, in place of a type line, its Name, its Storage as detected — a local folder, a network share, a removable drive or a CD or DVD, each with its own glyph — its location, its Root file (the .rehuroot's path) and its Layouts and Fallbacks, one type → template line each, all read-only, above an Edit button. Edit (also F2, from anywhere in the Roots view, the pane's tables included) turns the edit mode on and off (#578): the name, the layouts and the fallbacks become editors, and the mode stays on from one root to the next, each shown in the editors, until it is turned off. The Name is the label, which nothing on disk follows: saved as typed when the field is left, even empty -- the column then shows where the root is -- and shown in the column while it is typed; a button beside the field gives the root its default name, the one it was added with, which is also the empty field's placeholder. The Layouts and Fallbacks are two tables (#637); each edit is written to the root's file at once. In Layouts the type is picked from * and the installed types or typed, a type may repeat (#638) and the order of the rows is the order the path row offers them in, which the table's move up / down buttons change, and a row with no type, no template, or alike in type and template to an earlier row, is flagged and left out; the Path template is an editable drop-down of * and the Root Layout Templates of the settings ([[appendices.settings-pages#category-groups]]) that the row's type accepts -- * standing for any type, so only the placeholders every type has, and {buckets} ([[mounts-and-storage#buckets]]), which any type's may name -- or typed. A template the row's type cannot use is shown in the warning color with the reason as its tooltip, and saved as typed; the file keeps the template's text, so editing the library later changes no root. Fallbacks is a fixed table, one row for each placeholder naming a field -- title, publisher, authors, author_0, year, count, site, site_id; {buckets} names none -- only When empty editable, no row added, duplicated or removed, an empty one not written, and with no buttons, the full width. The same editor serves the New Root Presets page and the Add Roots dialog's New layout…. A root whose file cannot be read, or a catalog open read-only, offers no edit. A root this machine has not mapped is listed in its place, grayed, with one row saying so, never read; its Map… action (the root's menu and its details pane) asks for the folder, and the Map roots question opens with the catalog for the roots nobody has answered for ([[mounts-and-storage#rehuco-scope]]). F5 re-lists the visible columns: a folder deleted outside the app disappears, and the selection falls back to its nearest surviving ancestor. The cache follows what the columns show (#645): a cached record a listed folder no longer leads to loses its row, even one deleted while the app was closed, and a folder that appeared is walked for records ([[data-model#cache-schema]]). A root that cannot be listed says so by what it lives on: a local folder that is gone is struck through, a share, a drive or a disc that is merely away keeps its glyph grayed out, and either way its column holds one row saying what is wrong. The model lists off the GUI thread, holds no handle between listings and never uses QFileSystemModel — the files sub-dock's reasons, plus that browsing must never block a rename ([[mounts-and-storage#out-of-band]]). A node is root, folder, file, loading or unreachable, so an offline root is a state the model already has ([[mounts-and-storage#offline-mounts]]). Every folder is read through one function keyed by root id and relative path, which is what Release 0.4.0 swaps for another node's listing.
  • The Browsers dock (#396, #379) — a nested dock manager whose every sub-dock is a browser, closable, and the first kind is the table browser: the generic resource browser above as a table over the cache ([[data-model#cache-schema]]), every .rehu under the roots and every .tc no .rehu covers. A browser has a name, a filter and a set of visible columns, and several browsers exist at once, each with its own filter. The shell is written for more than one kind: the image browser (#403) is a second. Rename and Clone are on the browser's title bar and its tab's context menu, above QtAds' own Detach; the Browsers menu's Rename Browser acts on the current one. Clone asks for a name and starts with the same filter and columns. The browser's [x] deletes it, without asking — a browser is only a view. Browsers are the agent's, not the catalog's: each is remembered with where the browsers' sub-docks sit, per catalog on this machine, in a file of its own named by the rehuco id (so a moved .rehuco keeps them) — never in the .rehuco, which rehuco-core reads and which would carry view state to boxes that have no use for it. They are written when the catalog is closed, replaced, or the app quits. A catalog with none remembered opens with one default table browser.
  • Columns (#379). Every column the cache can show exists on every view, and the header's context menu lists them all, checked where visible — the only control over columns: the filter line never names one. The choice is kept in the browser's header state with the widths, order and sort, and a clone copies it. A plain browser shows authors, title, type, path, publisher, tags, released, size, updated and format; the URL and the type-specific columns — a tutorial's durations and level, a reference pack's image counts, the fields the cache stores that the type's plugin declares ([[data-model#cache-schema]], #399) — start hidden, for a preset to show. An asset's thirteen (#678) are appended after the others, so a header state saved before them is unchanged: kind, license, formats, compatibility, the two dates, the two versions, the advertised size and ranges, and the measured counts. A preset shows only the one the library is sorted by, Acquired; the rest are ticked in the header menu. A header state saved before a column existed shows that column at its default. A cell holds its value (a size in bytes, a duration in seconds) and a delegate says how it reads, so two sizes that read alike still sort apart; the exact size is the cell's tooltip. A missing value sorts as the smallest — first ascending, last descending (#466) — so one click on a header brings the rows lacking it to the top. Format says which file format a resource is in: the .rehu's own version as a number (0 for an unstamped one), tc for a legacy .tc — a format of its own, not version 0 — and ? for a .rehu whose version the cache does not know (unreadable, or not read since the cache began storing it). It sorts by number, with tc below them as the oldest format and ? as the missing value.
  • The current resource (#379) is the one selected row's, named by its root's id and root-relative path; none or several selected name none. Every browser is multi-select.
  • Copy paths (#646). With rows selected, the table's context menu offers Copy paths and Copy paths as JSON — after the author entries and a separator on an Authors cell; with none selected, only an Authors cell has a menu. Each puts the full path of every selected row's resource on the clipboard, in the table's order: a directory-scoped record's folder, a standalone record's .rehu (resource_path), resolved through the catalog's resource_key, so a row whose root is gone from the file is left out. Copy paths is for people — one path per line, every path in double quotes as Explorer's Copy as path writes them, with a newline, a carriage return and a quote written \n, \r and \" and nothing else escaped, so it reads, not reverses (C:\Users\new already holds \n). Copy paths as JSON is for scripts — a list with an object for each resource, one key per line, that reads back exactly: its path and, for an asset that has a .rehuterms, its license: that file (#688, [[assets#licenses]]); that one waits for a worker that asks the disk which assets have one. Both copy plain text only, never a file list, so a paste into Explorer copies no folders.
  • Refresh License (#688, [[assets#licenses]]). With rows selected, the entry between Open in Web Browser and the copies reads the selected assets' licenses again and compares them with the texts saved in their records; it is disabled while no selected row is an asset. A record with no text gets one, and the user is asked, in a dialog that does not block the window, which licenses' differing texts to replace.
  • Open in Explorer (#720). With rows selected, the first entry of the selection's group — Open in Finder on macOS, Open in file manager elsewhere (borco_pyside.FILE_BROWSER_NAME) — reveals each selected record in the system's file browser through reveal_in_file_browser, in the table's order: a directory-scoped record's folder opened, a standalone record's .rehu selected in its folder (resource_path, as Copy paths). A row whose place this machine does not reach — its root gone from the file, or offline, or the record and its folder gone from the disk — opens nothing and is named in the log at INFO; the entry is disabled while every selected row is under an offline root. More than ten places asks "Open N places in Explorer?" first, Cancel the default, as Open in Web Browser does.
  • Open in Web Browser (#679, [[assets#install]]). With rows selected, the entry above the copies opens each selected record's primary source URL in the system's browser, from the cache alone, so an offline root does not matter: the table's order, an address shared by several records once, and only http and https addresses naming a host (web_pages.is_web_page, the rule of the Roots preview's link). It is disabled when no selected record has one. More than ten pages asks "Open N pages in the web browser?" first, Cancel the default.
  • The filter line (#398) is GitHub-style: free text plus field:value or field:"quoted value" tokens (folder, authors, tags, publishers, type, and an asset's kind, licenses and formats), all ANDed. Free text is one term per word, each found in a title, a path, or part of any author, publisher or tag name (any one of them), so foo bar finds "bar then foo"; a "quoted run" is one term, the phrase (#475). in: says where free text looks (#647), as GitHub's search does: a comma list of title, path, authors, publishers, tags (ann in:authors,publishers), several in: words adding up, an unknown place reported like an unknown field. There is no title: token: in:title is how a search is kept to titles. Field tokens stay exact — authors:ann finds an author named Ann, never Annette. A repeated field must match both values. An asset's two advertised ranges are compared (#678) with <, <=, > and >=, written with no space: advertised_triangles<15, advertised_texture_size>=2048. A range matches when any value of it does ([[assets#ranges]]). kind:unknown finds an asset with that kind or none, kind:"" one with none ([[assets#kind]]). It picks the rows by query, not by proxy: as the text settles (or on Enter) it is compiled to a CatalogQuery and the browser is handed the rows that match, so the table and its status line only ever hold what matches. The rows are read off the GUI thread and filtered in memory (#455): a read costs about 21 µs per row it returns (#407), so every row is read once per change — an open, a scan's end, a rename or a write (just the rows it touched) — on a worker, one read at a time, and keyed there into a CatalogSnapshot; each browser then filters that snapshot, at once, per keystroke (6–17 ms at 100k rows; a three-word search over every place, about 30 ms, since each row's title, path and names are joined into one text to search once). The in-memory matcher is the cache's WHERE implemented twice, and a contract test runs both. The cyclic collector is paused while a read builds its rows, since it otherwise walks them all holding the GIL; what a refresh does with the rows — a status total, a sort, whose keys a model works out once per row — must not call back into Qt once per row. Case and diacritics: free text and authors, tags, publishers values ignore both, either way round — "jose" finds "José" and "José" finds "Jose" — through one fold (borco_core: NFKD, casefold, combining marks dropped; ß is ss), applied to the terms and to the text searched. The cache stores the folded title, path and value names (schema v5, written again whenever fold changes), since folding every row in a Python SQL function per read measured 10–30× slower (a rare word at 30k resources: 864 ms against 44 ms). type and a folder's root label fold ASCII only (SQLite's NOCASE); the path beneath the root folds as the filesystem does (os.path.normcase), the rule Roots navigates by — so folder:lib/FÖLDER finds Földer on Windows and not on Linux, where folder:lib/G03 does not find g03. The status line totals what the model holds, never what a row's None hides: the size and the image count each say how many rows they leave out, and cover the .rehu rows only: a legacy .tc's size and image count are old claims, often a literal 0, so those rows are counted apart (1,240 resources / 188 legacy .tc / 1.2T (37 unmeasured) / 18,400 images (3 unmeasured)). The image total is shown only where a .rehu row has a count or is of a type that declares one. The selection follows it after —: how many rows are selected and their sums by the same rule (CatalogTableModel.totals_of, one pass over the selected rows, so Ctrl+A costs no call per cell), e.g. — 3 selected / 4.1G / 120 images; nothing selected shows nothing. The line is an elided label: the selection part shortens first, then the totals, and the whole line is its tooltip (#462). An unknown field is reported on the line, never silently dropped, and the rest of the line still applies. The text is the browser's remembered filter; a columns: word an earlier build saved in it is dropped as it loads. A folder's context menu in Roots — Show only rehu in this folder — sets folder:"<root label>/<relative path>" on the current browser, click-to-filter links set the same tokens on it ([[plugins#filter-urls]]), and an Authors cell's context menu (#460) offers Filter by \<author> for each author of its row, read from the record rather than split from the cell, or Clear the filter by \<author> for one the line already names; each replaces that field's token and keeps the rest of the line. The current browser is the focused one, else the one focused last, and a link with no browser open opens a default one to carry it. Roots and the browsers are otherwise independent.
  • A saved search narrows a browser beside its line: a dropdown under the filter line names one, and the rows are those matching both ([[plugins#saved-searches]]). The Tag Browser sets the line as a link does ([[plugins#tag-browser]]).
  • New Table Browser offers presets on its menu (#400) — a click on it is Default (the common columns); then one \<Type> Columns entry per type that contributes columns (catalog_type_fields), today Tutorial Columns, Reference Images Columns and Asset Columns: that type's columns shown, except those that leave themselves to the header menu, every other type's hidden, a type: token on the line, and the browser named after the type. A type with no column of its own is not offered. A preset only picks the starting header state, filter and name; the browser is then an ordinary one and remembers no preset.
  • A covered file shows its checksum state in the Roots view (#457). A file's state comes from its own record only: a same-stem foo.checksum beside foo.rehu, else the nearest directory-scoped info.checksum at or above its folder, so a covered subfolder shows states too; an entry an older info.checksum still holds for a file foo.rehu now owns is ignored (#467 moves it). The lister reads the record where it lists the folder, on its worker and inside the rename coordinator's hold, and carries it as DirectoryListing.covered; the model turns it into a RowChecksum with checksum_verdict_for, so the rows and the Files dock age a result by one rule.
  • A file reads two ways: No checksum (not listed, listed with no hash, or no record covers it) or a checked result, Matching or Not matching, drawn old when the check has expired or was made at another location. A record, a checksum file and a screenshot have no state (Not applicable).
  • The row shows the state's icon right-aligned in its column, the name eliding before it; a file that did not match has its name and icon in red, one whose mismatch is old in orange. The details pane shows the icon beside a one-line title, and two fixed rows after Modified -- Checksum: the verdict, Last check: the date and, in brackets, how long ago -- or expired, or at another location when that is why it may not count -- so the block never changes size from one file to the next. A picture is the last thing in the pane, below the buttons, so what sits above it stays put.
  • A verify refreshes the rows in place through the app's changed announcement of the record it rewrote.
  • A checksum file's default action is Verify old checksums (a double-click, the bold entry): it leaves a check that is still valid alone, checks the files whose check has expired and records the ones with no checksum -- the Checksums dock's Verify Old. Verify checksums beside it checks every file whatever its last check was. A screenshot or a checksum file never offers Create rehu: it belongs to a record already, and its associated rehu is that record.
  • Automatically preview the current rehu (the Root Catalog menu and the Roots › Root Catalog settings page, one setting) lets the Roots view's current row drive the Documents preview. Off, the preview stays where it is; the table browsers' selection is not governed by it.
  • A selection shows in the Documents preview (#381). The browsers and the Roots view get no document sub-docks of their own: selecting a resource shows it in the preview dock ([[plugins#dock-shell]]), the one place a selected resource is shown, through the one model any Documents dock of the same file holds ([[plugins#view-model]]). Only a different .rehu changes it. No row, several rows, a Roots node with no record, the same resource again, the same resource under a new name (a rename re-keys the current row) and a scan's reset of the table all leave the preview as it is; a resource open as an ordinary document is focused there instead.
  • What a selection names. A browser row names its record by (root_id, relative). A Roots node names what opening it would open: a record itself, a folder's info.rehu, a file's same-name .rehu, the .tc of either when that is all there is. A selection never creates a record: where opening would offer Create, nothing is shown. RootCatalog.resource_key is the one place a row's (root_id, relative) becomes the ResourceKey it is reached by ([[nodes#access-seam]], #414) -- for the preview and a browser's double-click alike.
  • Which view drives it. The one the reader is in: the Browsers dock's current browser, or the Root Catalog dock, while it is the current outer dock. A selection that moves on its own in a dock the reader is not in does not move the preview.
  • It stays cheap. A selection is shown once it has stood for 250 ms, like the filter line, so the arrow keys load one document per resting row. Showing it does not bring the Documents dock forward — it can be a tab behind the dock being selected in — unless the reader closed it.
  • A double-click is unchanged: it opens an ordinary document, and when the preview shows that .rehu it is promoted instead of opened twice.
  • What a session measured belongs to the record it measured (#470). The count, size and duration readouts a Compute filled are cleared when the preview moves to another .rehu, and a measurement still running then reports into nothing — judged on the GUI thread after the switch, so an answer posted a moment before it is dropped too. The stored values are the file's and are reseeded from the new file as every other field is. A revert or a rename is not a switch: a measurement running through either still lands.

The menu bar is the complete index (#402, #465): File, Root Catalog, Browsers, View and Tools. File and Browsers are twins — the verbs that open or create, the verbs on the open set, then the open list, A–Z, with the focused one checked; File ends with Settings and Quit. Root Catalog is the same shape without a list, there being one catalog: New, Open, Open Recent, then Scan all roots, Add Roots and Remove Root, which are the dock's own actions and so are enabled as the dock enables them. Browsers leads with New Table Browser and Save Search… ([[plugins#saved-searches]]); the image browser (#403) adds its own entry and kind icon when it lands. View is what is visible — themes and the dock toggles — and Tools holds the catalog-wide maintenance operations.

Every browser here updates in place when the app moves or changes files — rows and nodes are renamed, moved, inserted or removed, never reset — by the in-process announcements of [[mounts-and-storage#out-of-band]].

§13.5.2 Click-to-filter URL convention

[[[plugins#filter-urls]]]

Click-to-filter links share one wire format, so every linkified value uses the same parser:

filter://<field>?name=<percent-encoded value>

filter://authors?name=Foo%20Bar
filter://tags?name=foo%20bar
filter://publishers?name=Example%20Publisher
  • One scheme, one query key. The field is the URL's host part (always lowercase ASCII, so host normalization is harmless); the value always rides the name query parameter, percent-encoded, so any character a name can contain survives — including / and ,, which a path- or delimiter-based encoding would trip over. The value is never encoded into the path or a bare query string: one name= parser serves every field.
  • Field set: authors, tags, publishers — the three values [[plugins#browsers]] linkifies — and collections, learning_paths, which the Tag Browser's rows set ([[plugins#tag-browser]]) once the cache indexes them ([[data-model#cache-schema]]). advertised_tags and extra_tags share the single tags domain: clicking a tag filters on the tag regardless of which list it came from; the two-list split is an editing-side concept, not a filtering one.
  • Authors first (#398), then tags and publishers. Each author name in the viewer is a filter:// anchor, beside the external http(s) link an author entry's URL adds ([[field-schema#authors]]). Every tag, of either list, and the viewer's Publisher row are linked the same way, and a Tags or Publisher cell's context menu offers what an Authors cell's does (#460). Link handling never enables the label's own external-link opening: one handler dispatches on scheme — filter:// internally, validated http(s) to the system browser — so a filter:// link can never leak to the OS, and no other scheme is ever followed. A clicked link travels up to the window like a field's status message, and the window brings the Root Catalog forward; with no catalog open, its status bar says so.
  • A link is a filter-line token. Dispatching filter://authors?name=Foo%20Bar sets authors:"Foo Bar" on the current browser's filter line in the Browsers dock ([[plugins#rehuco-dock]]) — one filter grammar, reached by typing or by clicking.

§13.5.3 The Tag Browser dock

[[[plugins#tag-browser]]]

A third top-level dock beside Root Catalog and Browsers, the Tag Browser, lists the named things the open catalog holds — the values its resources share, rather than the resources — with its own View toggle, revealed when a catalog is opened. It is what TutCatalog4's tree dock was (history/tutcatalog.md): who and what is in here, how much of each, and the place to describe, filter on and rename them.

  • The tree. Six branches, in this order, each grouped by first letter:
Authors (123)
  A (12)
    Abcd (5)
    …
  C (2)
    Cdef (1)
    Cxxx (7)
  123 (4)
Publishers (…)
Tags (…)
Collections (…)
Learning Paths (…)
Searches (…)

A value sits under the first letter of its folded name (fold, so Émile is under E); one starting with anything but a letter — a digit, a symbol — is under a single 123 group, last. Groups and values sort by folded name. A branch or group row counts its children — Authors (123) is 123 authors, A (12) twelve of them — and its tooltip adds the resources they cover (12 authors, 345 resources); a value row counts the resources that carry it. An empty group is not shown; an empty branch is, at (0). - Where the values come from. Authors, tags and publishers are the cache's value tables, collections and learning paths its membership titles ([[data-model#cache-schema]]). A value is one per folded name, as the cache keys it, so Foo and foo are one row, shown in its most common spelling, and its pane lists every spelling. Learning paths are the current identity's own and the reserved public scope's, as the viewer shows them (#189) — never another user's private path. A search row counts the rows its filter matches. Counts come from the browsers' in-memory snapshot ([[plugins#rehuco-dock]]), never from a query of their own, and follow it as rows change; a search's count is worked out off the GUI thread. - Genuine and discovered. An author, publisher, collection or learning path with a document of its own ([[plugins#grouping-entities]]) carries its type's icon; one known only from the resources naming it carries none. A document no resource names yet is listed at (0). A creator with both roles is listed under Authors and Publishers. - Selecting shows; the default action filters. Selecting a row shows it in a details pane under the tree: - an author, publisher, collection or learning path: Name, Description (the Markdown editor the Description dock uses) and URLs, one per row, a row that is not an http(s) URL flagged; for a creator, its Author and Publisher roles; - a tag: Name alone — a tag has no description and no URLs; - a search: Name and Filter — a search's description is its filter, and it has no URLs.

Under the editors, a button for every entry of the row's context menu, the default in bold: Filter by (the default), Open document for a genuine entity, Create document for a discovered one, Delete for a search. A branch or group row shows its counts and nothing to edit. - Filtering replaces; Ctrl adds. The default action — a double-click, Enter, the bold button or the menu entry — sets the row on the current browser in the Browsers dock as a click-to-filter link does ([[plugins#filter-urls]]) and brings that dock forward, except that the line becomes <field>:"<value>" alone, replacing whatever it held. With Ctrl (Ctrl+double-click, Ctrl+Enter) the token is added to the line instead and the rest kept. A search row picks itself in the browser's saved-search dropdown ([[plugins#saved-searches]]) and empties the line, which Ctrl keeps. Filter on selection, a checkbox on the Root Catalog settings page, off by default, makes every selection change the default action, so walking the tree with the arrow keys walks the browser along; Ctrl held while moving adds instead. - Editing writes the document. An edit of a genuine entity's description, URLs or roles is saved to its document as an edit in its own Main Editor would be, and a document of it open elsewhere follows as any open document follows its file. A discovered entity has nothing to write to: its editors are enabled, and the first edit asks to create its document in its kind's home ([[plugins#grouping-entities]]) — creating one is deliberate, never a side effect of browsing — with the name, the edit, and for a creator the role of the branch it was created from, filled in. - Renaming is editing Name and committing it (Enter, or leaving the field), after a confirmation saying how many records change. Every record naming the old value is rewritten ([[sync#value-rename]]), open documents included, without touching their unsaved edits. Renaming onto a name that already exists: - an author, publisher, collection or learning path merges into the existing one ([[plugins#entity-merge]]); - a tag disappears into the existing one: every resource that carried the old tag carries the other, once; - a search is refused — two filters do not merge.

A rename to the same name in another case or with other diacritics is a rename, not a merge: it corrects the spelling everywhere. - New Author, New Publisher, New Collection and New Learning Path are on the branch rows' context menus: each asks for a name and creates the document in its kind's home, opened in Documents. - A filter line above the tree narrows the values by the shared matcher (every word found, case and diacritics ignored, #475), keeping the branches and groups that still hold one. - No toolbar ([[appendices.code-conventions#command-surfaces]]): the context menu, the pane's buttons and the View toggle are the dock's surfaces.

Saved searches

[[[plugins#saved-searches]]]

A saved search is a name and a filter line's text. Save Search… — beside each table browser's filter line and in the Browsers menu — asks for a name and keeps the current line. Under every table browser's filter line a dropdown names the browser's saved search, (none) by default, and the rows shown are those matching both: (saved) AND (line), so a search can be narrowed by hand without being edited. The grammar ANDs everything today, so this is the two texts' tokens together; once OR arrives (#476, #477) it is the two parsed as parenthesized groups, which is why it is stated as AND and not as joining the text. Click-to-filter links and the Tag Browser write the line, never the saved search. A browser remembers which search it shows, and a clone copies it.

  • Names are unique, compared folded; a rename onto an existing name is refused. Editing a search's filter in the Tag Browser applies at once to every browser showing it; deleting one sets those browsers to (none).
  • Where they live is a setting. A catalog's searches are a file of their own, by default beside the browsers' state in the app's own folder; the Root Catalog settings page's Saved searches file points it elsewhere — typically one file on the share that every machine names. The setting is per machine, like the browsers. The file is read again whenever the Tag Browser or a dropdown is shown and before every change is written (read, apply, write); two machines changing it at the same moment means the last write wins, which a list this small and this rarely written affords.

Completion from the catalog

[[[plugins#value-completion]]]

The editors that take a catalog's values offer them: the authors, the tags, a source card's publisher, and the collections and learning-paths editors. After two typed characters a popup lists the known values containing them, case and diacritics ignored, from the snapshot the Tag Browser counts and the names of the entity documents; picking one inserts it as the catalog spells it. In a comma-separated line it completes the item under the caret. With no catalog open there is nothing to offer and nothing pops up. Completion only suggests: a value the catalog has never seen is kept as typed.

§13.6 Tutorial plugin

[[[plugins#tutorial-plugin]]]

The tutorial type's four surfaces, composed over the shared field toolkit ([[plugins#field-toolkit]]):

  • Viewer (triggered by double-clicking .rehu in File Explorer), split across two docks ([[plugins#viewer-editor-both]]): read-only field display on the main view; on the description view, a horizontal image strip with click-to-maximize, prev/next navigation, hideable thumbnail strip, ESC to close, over the rendered Markdown description. The record's URL is a line on the main view, on the description view (under the strip, unlabeled, full width), or both -- two checkboxes on the Descriptions settings page, both on by default (#620). Where a clicked screenshot maximizes is a user preference (the "Images / Display" settings page, [[appendices.settings-pages#category-groups]]), not a fixed choice: an overlay over the open document's own client area (the default — the surrounding dock chrome, menus, and toolbars stay visible), an overlay over the whole main window's client area, or a frameless full-screen window. The strip itself only reports which screenshot was activated; the document surface owning it decides what opens ([[plugins#field-toolkit]]'s owner-routes-it shape). A maximized screenshot opens against the whole curated set ([[data-model#image-meanings]]), which it navigates in strip order and which stops at both ends rather than wrapping — a wrap makes a short set feel endless, and the ends are where its shape is legible. Three affordances, all one step: LEFT/RIGHT (with HOME/END for the ends), the wheel over the screenshot, and a prev/next glyph that fades in while the pointer is within a band along that edge — min(50 px, an eighth of the viewer), so a band never swallows a narrow viewer. A click steps only inside a band, never on the open screenshot: half the viewer is far too large a target for a step the user did not necessarily ask for, and it hid where the affordance actually ended. At the end it would point past, the band is hidden outright, so a click there can never step where there is nowhere to step to. The screenshot itself carries no margin — it fills every pixel the thumbnail row leaves, and only the corner controls hold themselves off the edge. That row is the same widget the document's strip is, with the current screenshot framed and scrolled into view and a click jumping straight to it. Whether it is showing is per document, remembered in the document's own saved layout beside which tabs it has open, so one document's toggle never decides another's; the settings page holds only the starting point a document that has never been told otherwise opens with, plus the thumbnail height on each side and how tall the curation editor's preview pane opens on a document whose split has never been dragged. Applying any of those four reaches what is already on screen — open strips resize, open viewers resize and show or hide their row, open editors re-split — so the effect is visible where the user is looking rather than promised for next time ([[appendices.settings-pages#save-drop-actions]]). Neither strip ever paints a scrollbar, and a strip with nothing to show — no screenshots, or every one curated away — hides itself rather than leaving an empty band. The document's own strip has a second layout to offer, picked in the same settings ("Viewers > Images"): wrapped, folding the thumbnails onto as many rows as the width needs instead of running them off the right edge, with the strip then as tall as that takes and the document's own scrolling reaching the rest. It applies to the strips already on screen like the heights beside it. The maximized viewer's row is never wrapped — there it is an index alongside the screenshot, not the content itself. The set stays live: a curation edit or a scanner swap ([[acquisition-tooling#tc-to-rehu]]) re-points an open viewer through the same owner, which keeps the current screenshot if it survived, falls back to whatever took its position if it did not, and dismisses the viewer when the set empties — a maximized screenshot is never one the strip no longer offers. The curation editor on the images tab is the write side of the same set: every screenshot as a checkable row (checked = in the lightbox) under a sized preview, with buttons — the shared item-list ones, so they look and behave like every other list in the app — to move one up, down, to either end, or delete it. Because a screenshot's order is its numbering ([[data-model#image-meanings]]), all of those are renames on disk: they take effect immediately rather than waiting for a Save, a delete renumbers everything after the hole it left, and a set arriving numbered from 01 is renumbered from 00 the first time it is rearranged. A delete is confirmed first — it is the one edit here that cannot be undone. Deliberately single-select: every ordering action names one file. A resource nothing can rearrange — one not yet saved anywhere, or a legacy .tc, which refuses every screenshot edit as it refuses the drop ([[acquisition-tooling#drag-drop-aids]]) — keeps the list and grays the buttons, both row kinds alike. A locked document ([[data-model#write-integrity]]) goes further and grays the check boxes with them, since curating a screenshot writes to a record that may not be written; the rows, their metrics and the preview all stay. That is the whole point: a .tc is locked, and its images are exactly what the conversion about to run is going to act on, so the dock is where that is looked at first. It is the one editor surface a lock leaves enabled — every other one is disabled whole, as before.

Un-converted pattern-matched images are the dock's second row kind, listed after the numbered set: an image the screenshot name patterns match ([[acquisition-tooling#screenshot-schemes]]) but that a conversion has not renamed into the numbered set — left there by a legacy .tc not yet converted, or by a rename collision a conversion left untouched under its own name ([[acquisition-tooling#tc-to-rehu]], [[data-model#image-meanings]]), in natural-sort order. Both row kinds carry the same enabled checkbox, moved to its own first column so the two align: it is the curation checkbox above (checked = in the lightbox, the hidden_images list) on either kind, and an un-converted row starts checked — shown until the user says otherwise, since a picture the patterns recognize is a screenshot whether or not it has a slot yet. The strip and the lightbox show every checked row, numbered first, then the un-converted ones (#281). The ordering buttons stay disabled on a pattern-matched row — it holds no position in the numbered set to move. Two actions are offered on such a row, single-select like every other action here: Convert takes its own legacy number as its new <stem>NN when that slot is free, and appends it past the current end of the numbered set otherwise — the free-slot-or-append rule of #265 — after which the row re-lists among the numbered set with its checkbox state carried across the rename by the same remap the curated-out list already follows; and Delete, to the Recycle Bin if possible, with a permanent delete confirmed unless Delete images without asking is on ([[appendices.settings-pages#category-groups]], #291, #312). Moving or deleting renumbers files and never rewrites the description — an embed pointing at a name that moved or vanished is left exactly as the user wrote it — and a one-line hint in the dock says so.

In a multi-record directory ([[data-model#resource-scoping]]) each record's dock shows everything except the other stems' <stem>NN: its own numbered set, and every pattern-matched image in the directory, since a loose cover.jpg carries nothing naming whose it is and either record may claim it with Convert. A delete from either dock therefore deletes it for both, and the confirmation says so.

On a legacy .tc only, a column right after the filename — After conversion — says what the whole-directory conversion ([[acquisition-tooling#tc-to-rehu]]) would do to each pattern-matched row, read from the same dry-run scan the conversion itself runs rather than re-decided here, so the column can never disagree with what Convert then does. Every cell is a filename — the one the file has afterward: the <stem>NN a row is renamed to, or its own name again for a row the scan leaves alone, so the column reads the same way down its length. Why a file keeps its name is the cell's tooltip, in the scan's own vocabulary and nothing else — its slot is taken by an earlier name, by an earlier extension of its own name (the larger one wins), or its own number is at or past the highest slot a conversion will write. No image is ever backed up to an .orig, so no fourth outcome exists here. Hidden on a .rehu, where every row already has its name and there is nothing left to convert. - Editor: field editing including the Markdown description; rename from the predefined-candidates list ([[data-model#rehu-format]]), which renames on disk. Each scope moves what its own naming convention owns ([[data-model#resource-scoping]]): a directory-scoped info.rehu renames its parent directory, one atomic operation carrying everything inside it; a file-scoped foo.rehu renames every file named after it — the record, the fooNN screenshots, the .sfv/.md5 manifest, and the content itself, whether that is one foo.zip or a foo.001/foo.002 multi-part set. Until a .rehu carries an explicit manifest of the files it describes ([[data-model#resource-scoping]] names that gap), being named after the resource is the association, so renaming only the record would break the very thing tying the set together. What counts as named after it is decided by a separator, not a bare prefix: what follows the stem must be nothing, a ., or a digit. More letters make a different name that merely starts alike, so foobar.zip is left to whoever it belongs to. Two further exclusions: directories (a file-scoped .rehu describes files) and anything owned by a sibling record whose stem extends this one's — with foo.rehu and foo2.rehu side by side, the digit rule would otherwise sweep foo2's whole set into foo's rename. A resource whose .rehu is not on disk is refused outright: a missing record's remedy is a re-read ([[data-model#write-integrity]]), and with the record gone there is nothing left to establish what its set was. Names compare case-folded on every platform (#629), so FOO.zip beside foo.rehu is one set, and a destination differing only in case is the resource itself unless the disk shows a second file there. The set is collision-checked whole before the first rename runs and rolled back if one of them fails, so a resource is never left split between two names ([[data-model#write-integrity]]) — and the one case a rollback cannot fix says so by name. Both scopes rename within a single directory and so are same-filesystem by construction. The suggestion list is two groups (#579, #339). First the current names: the type's Locations templates rendered into a name, a rename within the record's folder as above. Then, under a separator, the roots' places ([[mounts-and-storage#rehuroot]]): where each root's layout puts the record, labeled by the root's name and the rendered path — one place for each of its templates for the type that renders, in the table's row order, a place two templates render offered once (#638); the root holding the record first, then every other root this machine maps and reaches, in the catalog's order. A record under no root (opened from outside every root) is offered every root's place, which is how a stray record joins the catalog. Choosing a place on the record's own volume is a move by rename — the destination's missing parents made, the folder or the file set moved in one plan — through the same coordinator and with the same collision check and rollback, the folders it made removed again if it fails; it runs at once unless the Files page asks for it to be verified, when it is a task that verifies before and after. A place on another volume is the checksum-gated verified move, always a task ([[mounts-and-storage#safe-move-rename]]: verify, copy, verify at the target, delete); its failure reaches the document's banner as a rename's does. A bucketed place ([[mounts-and-storage#buckets]], #680) is drawn with its buckets as the disk has them now, and shown occupied by what is there (#681); the record is there when its folders are the place's with any chain of its buckets; and choosing it is always a task, which reads the buckets and splits what it crowds. A name chosen for a record whose own name is bucketed is such a move too, into the new name's bucket, where it is asked whether it is taken. A place whose path leads into a split folder its layout does not bucket is shown as an occupied one is, with the reason, and so is every name offered a record lying in one. A name starting with a dot is never offered, and a typed one is refused (#680). Only a place that can be built is shown: none for a root this machine does not map or cannot reach now, a layout naming neither the record's type nor *, or one needing a placeholder the record leaves empty with no fallback on the root — and none at all for a record whose own root cannot be reached. A host with no task queue offers only the record's own root's place. A place something already occupies shows disabled with the same blocked icon as an occupied name below, and the place the record already sits at disabled and plain, as the current name is: under its own root it is a row of its own, first, whenever the layout puts the record somewhere else or cannot place it (a * layout puts it at the root's top, #643); when the layout's place is where it sits there is one row. Hovering a place shows the path rendered for the record, then grayed the full path it would land at (the root's folder on this machine, joined with it) and the path template that produced it, * included (#639). A place that can be chosen carries icons after its text (#649), each saying what choosing it involves, in this order, and the tooltip adds a line for each: network when the record's folder or the place is on a share, so the move is slow, a move from a share to a local disk and one inside a share alike; copy when the place is on another volume, so the record is copied rather than renamed; verified when the move verifies the record's checksums — a copy always, a rename when the Files page's box for the storage it lands on is ticked, so the icon follows an Apply at once. The place the record is at and an occupied one show none of these. The folders a move leaves empty stay, unless the Files page's Remove the left-behind folders says otherwise ([[appendices.settings-pages]]); a record under no root has no root to stop at, and its folders always stay. A record that is its root's folder (<root>/info.rehu, #641) is neither moved nor renamed from here, under every layout: its own root is the one place shown, by the root's label alone, disabled and plain; no other root offers a place, since a move would put a whole root inside another; and no name is suggested or marked as the wrong one, since a rename would rename the root's folder. A candidate something already occupies — another folder for a directory-scoped resource, another .rehu for a file-scoped one — is offered disabled, with a trailing blocked icon rather than as a click that could only fail. An icon rather than a color: the disabled palette fights a hue, and a colorblind reader may not separate one. It is an icon, never a Unicode character, whose glyph depends on the platform's font fallback. The editor holds no path and reads no directory: it asks its owner through a predicate, the same field-decides-that-never-what rule the rest of the toolkit follows. The check is one existence test on the resource's own destination, not the whole plan — it is re-asked per keystroke behind a live suggestion list, and measured at ~15 µs against ~24 ms for a sibling sweep. It is deliberately uncached: a memo table would go stale under the app's own rename, under a new document's first save, and under anything done in a file manager while the editor sits open, and the OS attribute cache already supplies the speed with invalidation this layer cannot see. A rename that fails anyway — a collision on a sibling the cheap check does not cover, or any other refusal — reports as an inline banner row on the document, not a modal: the resource is untouched and the candidate list that produced the name is still on screen. - Follow (a distinct mode from viewer/editor): sequential playback of the tutorial's files, recording watch progress and duration ([[plugins#in-app-player]]); the tutorial's videos as a tree with their progress and favorites ([[plugins#video-tree]]); notes per video and for the tutorial, with timestamped lines as the bookmarks ([[plugins#video-notes-dock]], [[field-schema#video-notes]]). Progress — per file, a resume position and a viewed flag — is [[field-schema#watch-progress]]; its sync follows [[sync#overview]]/[[mounts-and-storage#node-handoff]]. - Web: search/browse tutorials the user has access to; follow a tutorial from the browser, with the same progress/notes/favorites behavior as the desktop "follow" mode, over the same core functions.

The in-app player: libvlc or Qt Multimedia

[[[plugins#in-app-player]]]

Two players can fill Follow's dock: libvlc from the user's own VLC, set up through the Tools page (#521), or Qt Multimedia, whose FFmpeg backend ships inside PySide6. The spike (#315) measured both on Windows 11 at 125 % scaling — VLC 3.0.23 with python-vlc 3.0.21203, PySide6 and PySide6-Addons 6.11.1 — in a dock inside a nested dock manager, as a document's sub-docks are; macOS and Linux are the open half. The dock is Qt Multimedia by default (#317): nothing to install, every signal on the GUI thread, and its two gaps explained in the dock rather than shown black or combed. The user's own libvlc is the other engine (#319): chosen on the Videos › Player page, loaded into the same dock through python-vlc once the Tools page has a VLC with its shared library, and speaking QMediaPlayer's language (VlcMediaPlayer) so the view drives either without knowing which; the choice applies to the next video selected, in every open document, the engine rebuilt in place. It closes both gaps, and it draws inside the dock, which is what lets the maximized player ([[plugins#player-maximized]]) carry it with its panels. A VLC launched as a window of its own was built and dropped in #319 for that reason: another process's window can be neither drawn over nor moved with the player ([[appendices.vlc]] keeps what was measured of it).

libvlc Qt Multimedia
Comes from the user's VLC; its GPL plugins are never shipped 20 MB bundled: Qt's multimedia modules and LGPL FFmpeg DLLs
Dock moves the picture survives every one the picture survives every one
Keyboard Qt's, with libvlc's mouse input off Qt's
Player events libvlc's thread, plus some on the GUI thread the GUI thread
stop() 80–115 ms, joining libvlc's thread returns at once
The codec matrix below every file every file, AV1 only with hardware
AV1 without an AV1 decoder in the GPU decoded in software sound and no picture, with no error
Interlaced video deinterlaced by default shown combed
Not installed the dock plays through Qt Multimedia and says why cannot happen

The codec matrix is every file the iPad refuses ([[nodes#web-playback]]), cut from one 1080p60 tutorial with imageio-ffmpeg. Both players decoded, showed, played the sound of and seeked in each:

Container Video Audio
MKV H.264; HEVC 10-bit; AV1 10-bit AAC; MP3
MPEG-TS H.264, progressive and interlaced; HEVC MP2; AAC
MP4 HEVC tagged hev1, 8- and 10-bit; AV1 10-bit; interlaced H.264 MP3; MP2

With libvlc the agent converts nothing; with Qt Multimedia, AV1 on a machine with no AV1 hardware and interlaced video are the gaps.

A native window survives every dock move, in both. libvlc's surface is a plain QWidget with WA_NativeWindow and WA_DontCreateNativeAncestors, handed over once with set_hwnd(int(winId())) before play(); a QVideoWidget holds a native window of its own. Floating, re-docking, tabbing behind another dock and back, pinning to a side bar and sliding it out, unpinning, resizing and minimizing all kept the picture with no call at all: Qt re-parents the same window rather than recreating it, so its id never changes. Calling set_hwnd again, or stopping and replaying, is never needed. Playback runs on behind a tab.

The keyboard stays Qt's. With libvlc, Win32 focus stays on Qt's top-level window, never on libvlc's child: a real click on the picture gives the surface Qt focus, and the arrows, Space, F and Ctrl+Right reach the surface's and then the dock's keyPressEvent, whether video_set_key_input is on or off. video_set_mouse_input must be off: with it on, libvlc's window takes the click and Qt never sees it. Both are turned off, so the dock's keys are the only ones. A QVideoWidget takes no focus; the same keys reach the dock.

libvlc's events cross to the GUI thread through a queued signal, never a blocking one. MediaPlayerTimeChanged, MediaPlayerLengthChanged and MediaPlayerEndReached arrive on libvlc's input thread, a new one per play(), except that set_time() and stop() raise a time change synchronously on the thread that calls them, the GUI thread. A QObject re-emitting each as a signal on the default connection is safe: 160 stop() calls under a stream of time changes took 80–115 ms each and never hung. With BlockingQueuedConnection the first stop() deadlocked in three runs of five, since stop() joins the input thread while that thread waits on the GUI thread. QMediaPlayer's positionChanged and mediaStatusChanged arrive on the GUI thread already, and its stop() does not wait.

Qt's FFmpeg build decodes AV1 only in hardware, and fails silently without it. The dev PC's GPU decodes AV1, so both AV1 clips played; with hardware decoding switched off (QT_FFMPEG_DECODING_HW_DEVICE_TYPES=,) they played sound and advanced with no frame at all, and errorOccurred never fired. Every other clip decoded in software. QMediaFormat.supportedVideoCodecs(Decode) lists no AV1 even where hardware plays it, so it cannot predict this. On an M1 or M2 Mac, an iPad-class chip, an Nvidia GPU before the RTX 30 series or Intel graphics before the 11th generation, an AV1 tutorial would show a black dock unless the player reads the codec from the file and says why.

libvlc deinterlaces by default; Qt Multimedia does not. Measured on a moving test pattern whose two fields come from different instants, as a mean second vertical difference over the shown frame: 3.3 under Qt against 1.4 for the same pattern progressive, with the combing plain on every moving edge, and 0.8 under libvlc, which shows the fields at their own rate.

python-vlc is unsafe to import blind, so the agent never does ([[appendices.vlc#python-vlc-import]]): import vlc resolves libvlc at import time, raises for a DLL in the working directory when no VLC is found, calls sys.exit(1) on a bad PYTHON_VLC_LIB_PATH, and changes the whole process's working directory while loading a VLC it found by itself. rehuco_core.VlcLibrary is the one place that imports it: by the full path of the library the Tools page resolved, inside a guard that turns anything the import does into a reason, and only after a child process (--probe-libvlc) imported the same library and got an instance of it. Without VLC the proxy is simply unavailable, with the reason, and the dock plays through Qt. The Tools page lists only usable installs: a static or sandboxed VLC (no libvlc to load), one too old or one that does not run is logged at WARNING when Detect runs, not shown.

Qt's FFmpeg can be replaced by a user's, of the same major version. Qt 6.11.1 ships FFmpeg 7.1.3 as five DLLs (avcodec-61, avformat-61, avutil-59, swresample-5, swscale-8), and its FFmpeg plugin binds them by name. Loaded by full path from another folder before Qt Multimedia is imported — avutil, swresample, swscale, avcodec, avformat, in that order — they are the ones the plugin uses, and Qt's own copies are never loaded. So a user's shared FFmpeg 7.1 build, found through the Tools page (#521), can stand in for the bundled one; a build with a different major version (FFmpeg 8's avcodec-62) cannot, until a PySide6 release built against it. This closes the AV1 gap: BtbN's ffmpeg-n7.1.5-…-win64-lgpl-shared-7.1 carries libdav1d ahead of FFmpeg's own av1 decoder, and with hardware decoding off it played both AV1 10-bit clips at their full 30 fps in software, where Qt's own build gave no frame at all (its av1 decoder logging Get current frame error per frame, and Qt raising nothing). The build must be shared and for the machine's architecture (win64, not winarm64); a plain lgpl build holds only executables, which serve conversion and the duration probe (#520, #521) and any recent version does.

The major moves with PySide6. PySide6 6.12.0 bundles FFmpeg 9.0.1 (avcodec-63, avformat-63, avutil-61, swresample-7, swscale-10), still without software AV1; BtbN's ffmpeg-n9.0-…-win64-lgpl-shared-9.0 swapped in the same way and played both AV1 clips at full rate. Its PySide6-Addons installs to 100 MB rather than 6.11.1's 437 MB, the playback keep list to 21.6 MB. So the FFmpeg the Tools page accepts for playback is whichever major the shipped PySide6 bundles, read from its own DLL names, never a version written into the code.

The dock as built (#317). It is the tutorial's own sub-dock ([[plugins#dock-shell]]), hidden by default like the inspection set, and opens when a video is double-clicked in the Files sub-dock ([[plugins#files-subdock]]) or its toggle is pressed. One player per document: a QMediaPlayer and its QAudioOutput drawing into a QVideoWidget, built on the first video, so opening a tutorial never loads FFmpeg. Its transport bar is previous, back, play/pause, forward, next, a seek slider that follows the position and seeks on a click or a drag, and a speed combo from 0.5 to 2. Its keys are commands in the catalog, armed while focus is anywhere inside the player and nowhere else — Space plays and pauses, Left and Right jump five seconds, Ctrl+Left and Ctrl+Right load the previous and next video, Ctrl+Home plays from the start and Ctrl+End goes to the end -- which finishes the video and loads the next paused -- Up and Down change the volume, and Ctrl+Up and Ctrl+Down, or ] and [, change the speed — and the slider, the combo and the buttons take no focus, so an arrow is never theirs.

The speed is the document's (#697): one for all its videos, whether one is chosen, double-clicked, stepped to or reached by the end of the one before, docked or maximized. It is kept in the player dock's saved state, as the subtitle choice is, so it comes back with the session ([[plugins#session-restore]]); a speed the combo does not offer is ignored.

Dragging the slider's handle shows the frame at the handle in the main picture (#613; no second decoder, so no thumbnail above the bar, owner). The bar reports the handle at most four times a second, each report a seek, and the clock follows it. A video that plays is held paused and silent for the drag, its button still offering to pause, and plays on from where the handle is let go. A paused one stays paused there: under Qt, which has let go of its file, the drag opens the file for frames and the release lets it go on the frame of that place, as a paused load does; under libvlc one paused while playing holds its file and seeks in place, and the still follows, since the frame after every seek is announced (a seek to the very last millisecond gives libvlc no frame, measured, so the picture stays on the one before). Only the release is recorded, as a click on the groove is: nothing the player reports during the drag is progress, not even the end of the video. A press with no move opens nothing, and a rename during the drag lets the file go for good, leaving the rest of the drag to the bar.

Subtitles are libvlc's alone (#618; Qt gets none, owner). libvlc shows a subtitle file beside the video, blended into the frames, and lists its tracks, so no loading code is needed. Three more commands of the player's: V shows the next track, Alt+V the previous one and Shift+V turns the subtitles off, or back on. Under Qt the three actions are disabled; a video with no track the cycle visits makes them do nothing, as does one loaded and not yet played, whose file the player does not hold. A dropdown on the transport bar, beside the clock, says which subtitle is on and picks another (owner): Subs: off, then Subs: English, Subs: Unknown and so on, with the track's place -- Subs: English 2/3 -- when the video has several of that name. A silent stretch of a video shows no subtitle even with one selected, so it is the only sign a key did anything. It lists every subtitle track the video has: those the keys visit first, in the color of any other entry, then the others, in the disabled color. The keys skip those, but the reader may pick one with the mouse, and the keys carry on from the start of their cycle afterward. A pick is a choice like a key's, and is remembered the same way -- by language, so a pick the keys would not visit gives way to the cycle's first at the next video. The dropdown takes no focus, as the speed combo does, so the keys stay the player's. It is VLC's alone, hidden under Qt. libvlc lists a video's tracks only while its file is open, and a video loaded paused has its file let go at once, so until the video has played the dropdown is there but disabled, reading Subs: …; a video libvlc listed nothing for in ten seconds reads Subs: none. A focused notes editor takes these keys like the player's others ([[plugins#player-maximized]]).

Which tracks the keys visit is the Subtitles frame of the Videos › Player page ([[appendices.settings-pages#category-groups]]): a list of languages, the most preferred first, with an Unknown entry that stands for the tracks whose file names no language (a bare .vtt), and a choice between show only selected languages and show all languages. A track's language is the one libvlc prints in its description, Track 2 - [Romanian] ([[appendices.vlc#subtitles]]); a known language that is not in the list, French say, is not Unknown. The cycle is none, then every track of each listed language in libvlc's order, Unknown wherever the list puts it; with all languages, what the list leaves out follows -- Unknown if it was not listed, then the other known languages -- so no track is out of reach. V and Alt+V walk the cycle and wrap; Shift+V shows the track that was shown last, except after the cycle reached none, which forgets it and sends Shift+V to the cycle's first.

What shows when a video starts is the rehu's own choice -- on or off, and the language of the track shown, or unknown -- which rides in the player's entry of the document's layout like the stage's split ([[plugins#session-restore]]), or, for a rehu where none was made, the page's Show subtitles when a video starts. The choice is a language, not a track, since a track's id means something only within one video. libvlc's list is empty as a video starts and fills in steps over the first tenth of a second, a sidecar's tracks after the video's own ([[appendices.vlc#subtitles]]), so the engine reads it every quarter second and applies the choice once two reads agree; a key pressed before that settles the matter, and a video that lists nothing is given up on after ten seconds. A language the video lacks gives the cycle's first track, and a video with no track in the cycle gets none. A change made while paused refreshes the picture (owner): libvlc draws a subtitle on a paused picture only once the position is sought again, so the engine seeks to where it is and the frame that answers replaces the still.

The playlist is the whole tutorial's videos, every folder, in natural path order. Showing the dock loads the video this user watched last (last_video, [[field-schema#watch-progress]]), the first when none was or it is gone, paused where it was left: the seek bar and the clock show that position at once, before anything plays. Previous and next stop at both ends, as the image lightbox does, and load their video paused by the same rule. A video starts from where it was left, or from the beginning when it was watched to the end -- viewed, or left within a second or so of its length -- so it can be watched again without dragging the bar back. A double-click is the only thing that plays at once, and the end of a video while continuous play is on. Reaching the end records the video's whole length, which is what marks it viewed when the setting is on. Continuous play is a checkable button on the bar, checked by default and kept as one app-wide setting with no key of its own (#693): checked, the next video starts playing from its beginning, even when it has a recorded position; unchecked, the video stays selected, stopped at its end on its last frame with its file let go, as a pause leaves it, so the bar can take it back anywhere in it, and play starts it again from 0. The last video stops at its end the same way, whatever the button says. Ctrl+End records a video that is not at its end as watched too, but loads the next paused; on the last video it leaves it selected with the bar at its end, the picture it had kept. The end of a video never closes the player. Ctrl+Home moves to 0, playing or paused.

A video that is only loaded records nothing. Progress, the video watched last and the Files dock's percentages change only once a video has played, so looking through the videos leaves the record as it was.

What it records goes through the document's one recorder, which writes about every five seconds ([[mounts-and-storage#node-handoff]]) and is flushed at the moments that matter: pause, a seek, switching video, stopping, closing the document, the preview moving on to another record — before it does, or the old record's video would be recorded into the new one — and quitting, which waits a moment for the write itself since the thread that makes it is a daemon.

A video's file is open only while it plays. The OS refuses to rename a folder with a video open in it, and even a stopped player holds its source until it is cleared (measured on Windows, where it is an access denied), while renaming a resource's folder is something the app does from the editor's path row. So paused and loaded are the view's own states -- the video, the position and a still frame on screen -- with the player's source cleared: pausing records the position, keeps the frame on screen and lets go; a video loaded without playing is opened for as long as it takes to buffer and give one frame at its position, then let go (with a three-second limit for a video that gives none); playing opens it again and seeks to the position once it buffers, under Qt the player decodes into a sink of the view's, which hands each frame on to the video widget: a pause stops handing them on and the widget keeps its last frame, drawn by the same renderer -- a still painted by Qt's own scaling shifted the picture by about a pixel and flashed as the native window went (seen by the owner, #574) -- and playing again hands frames on only from one of that position (stamped within a second of it, or any frame once the player reports it there, for a file whose frame times run on another clock than its positions, or every frame three seconds after play for one that gives neither), since the file takes about 200 ms to open again. An open Player dock therefore never blocks a rename. Closing the dock stops the player and lets go the same way, as does the last video's end. It is the reason the Content Images dock lets go of its archives when it is hidden (#355).

A rename that starts while a video plays pauses it first. The player asks the rename coordinator to be told, ahead of any wait, which resource is about to be renamed; for its own resource it pauses into the released state, and the rename proceeds with the video paused where it was. Every surface that renames goes through the one coordinator, so this covers them all. Pressing play afterward opens the video at the new path.

Behaviors of Qt Multimedia found by playing real clips, each in a test: stop() reports the position it resets to, 0, ahead of the state it ends in, so a position reported while the player still says playing is no progress; replacing a source reports LoadedMedia from inside setSource, for the video it replaces, so a video is ready at its own first BufferedMedia, and a resume seek made earlier is lost; a source as long as the one before it reports no durationChanged, so the length is read as the video buffers; and the sink reports an empty frame whenever it is cleared, and the last frame of a video being replaced can arrive after the new one is opened, so only a valid frame of a ready video counts as a picture.

What the dock says about a video Qt shows badly ([[plugins#in-app-player]]'s two gaps) is decided from the file, not from Qt: its codec and scan type are read through MediaInfo off the GUI thread (rehuco_core.read_video_format, kept out of the videos map, since they are about the file as it is now). An interlaced video is noted at once; an AV1 one when it has played for a second and a half and shown no frame, since whether the hardware decodes it cannot be asked beforehand. A banner in the dock carries the notice, and an error from the player. Where the FFmpeg libraries can be set up (Windows) and this run is not using them (#580), the AV1 notice adds that an external FFmpeg's libraries with dav1d would play it, and carries a Set up in Tools button, which travels the document's usual hops up to the window that opens the Tools page. Neither notice is made under libvlc, which deinterlaces and decodes AV1 in software.

Under libvlc ([[appendices.vlc#python-vlc-events]]) the same rules hold with the engine's means: libvlc's events arrive on threads of its own and cross to the GUI thread through a queued signal, never a blocking one, since stop() joins the thread that raises them; Playing is the moment the view calls a video ready; after EndReached libvlc stays Ended, so a replay stops first. A paused video is a stopped player here too: a folder rename fails while libvlc plays or pauses, and succeeds after stop(). A pause under libvlc holds the file, paused on its frame: reopening and seeking landed a few frames off, so the player stays where it stopped and resumes there, and the rename -- the one case the release exists for -- lets the file go through the rename coordinator when it is about to happen. A load for a still (libvlc decodes no frame without playing) opens the file already at its position with :no-audio, so libvlc decodes no audio at all, plays until the first frame, keeps it, and pauses, after which the view stops it as it would after a frame from Qt's sink; played before then, the file is opened again with its audio, where the load had got to. Seeked only once open, a busy restore kept the file's first frame instead, often black, under a bar at the right place (#613). Nothing is ever muted: libvlc takes a mute or an unmute only while its audio output lives, so a load muted around it let sound out at the start, and an unmute after the stop was lost, leaving the next video silent (both seen by the owner, #574). libvlc renders into memory ([[appendices.vlc#memory-rendering]]): it decodes into a buffer of the app's (VlcFrameSink) and each frame is painted by an ordinary widget (VlcSurface), so there is no native window, any widget can be drawn over the picture, and the engine is the same on every OS. Audio, the clock and subtitles stay libvlc's. Measured at 1080p60 in a window the size of a 3440x1440 monitor: 60 fps, about one and a third cores for the whole process since the surface scales smoothly (#574), as the still a pause shows does; two thirds of one core unsmoothed, which drew some rows and columns twice.

The build keeps 20 MB of a 105 MB to 460 MB wheel. The agent depends on PySide6-Essentials; Qt Multimedia is in PySide6-Addons, which is named again for it. Playback needs about 20 MB of that wheel: QtMultimedia and QtMultimediaWidgets (module and library each), the FFmpeg plugin and FFmpeg's five libraries, avcodec alone 13 MB. A PySide6 folder holding Essentials and only those files played the whole codec matrix. Between briefcase build and briefcase package the build removes every other file the Addons wheel's RECORD names — bar what Essentials owns too — so a module a later Addons release adds is never shipped, which Briefcase's own cleanup_paths, able only to name what to remove, could not promise. How, and what it was measured to cost on each platform, is [[packaging-deployment#qt-multimedia]].

The video tree

[[[plugins#video-tree]]]

A tutorial's third own sub-dock ([[plugins#dock-shell]]), Tree, hidden by default like the player and toggled from the toolbar: the whole tutorial's videos as a tree — every folder, natural path order, the playlist the player walks — with each video's progress, its favorite glyph and its length, and the video loaded in the player marked and kept in view as it changes. The Files sub-dock shows one folder at a time; this is where the tutorial's shape and what is left of it are read at a glance. The progress text is the Files rows' rule exactly ([[plugins#files-subdock]]: 100% once viewed, else position over length, nothing while the length is unknown; a folder's share duration-weighted), from one shared formatter, redrawn when the document says progress or notes changed — in place for progress, which the player writes every few seconds, so what the reader closed stays closed; a rebuild, keeping the closed rows and the selected video, for a change in the rows themselves. A video reads as its file's name without the extension. Missing videos are listed in their folder as the Files dock lists them, in italic, with their notes beneath them.

A folder's length (#704): a folder's row reads in the Length column the total length of every video beneath it, subfolders at any depth included, worded as a video's is (clock_text). It is the length of the folder's watch_totals entry, so nothing is read from disk and it follows the progress's own refresh. A folder holding a video of unknown length reads the sum of the known ones with a + (1:23:45+), the tooltip saying some videos are not measured; one with no known length reads nothing. The Files sub-dock shows no length for a folder (owner).

A line under the tree (#694) reads the whole tutorial's watched and remaining time as a player's clock does, 3:20:15 / -5:05:40 (owner), with the seconds every other time in the player shows (one formatter, clock_text), short enough for the narrow T panel. Its tooltip says the same in words. The sums are the folder rows' own (the "" entry of watch_totals), redrawn with every refresh of the model, so it follows the progress the player writes. A video of unknown length is in neither time, and the tooltip says how many there are. It shows nothing while the videos on disk are not known or there are none. The view is one, so the player's T panel carries the line too.

A video's bookmarks are its children, sorted by time ([[field-schema#video-notes]]): one row per line of its note that carries a time, with the markup taken off — - [12:34](rehuco-video:…#t=754) the smudge trick reads 12:34 the smudge trick. The note is the user's to edit and may be in any order, so the tree sorts what it finds; a line with no time is not a row, and is read and edited in the notes dock (#573). The row is elided to the dock's width; its tooltip carries the line wrapped at 80 columns and cut after eight lines with an ellipsis, so a long note never covers the screen. A double-click on a video loads and plays it in the document's player, showing the player dock as the Files route does; on a bookmark it plays the video its link names from the link's #t. A missing video plays nothing.

The row's actions, shown only where they apply and also on the dock's title bar: Favorite (a toggle), Viewed (a toggle), Forget on a missing row — one set of commands, and one object, with the Files dock's. One tree model serves this dock and the player's T panel ([[plugins#player-maximized]]). No layout version bump: a layout that never names the dock restores and puts it back hidden ([[appendices.qt-ads#structural-layout]]).

The notes

[[[plugins#video-notes-dock]]]

A tutorial's fourth own sub-dock, Notes, hidden by default: the current video's notes above the tutorial's, in a splitter whose sizes ride in the dock's own layout entry; the video part follows the player's loaded video, and with none loaded only the tutorial part shows. Both are rendered markdown by default — the Description View's renderer — with one Edit action on the title bar that swaps in the markdown editor for both parts and back. What is written is [[field-schema#video-notes]], writer-owned: the text goes to the user's sidecar through record_notes the moment editing ends — leaving edit, focus leaving the editor, the player switching video, the dock or the document closing, quitting — never dirtying the record, never asking for a save, and the notes stay editable while the video plays. Only a part the user changed is written. A video with no data yet is looked for among the renamed ones first, and until that search answers its notes are not safe to edit: the editor is disabled, and a bookmark asked for meanwhile is added once the search answers, so nothing typed over an empty note replaces the one the search finds.

Which video's notes show. The player's video drives them: they change when the player loads another, previous and next included. A single click on a video in the Tree or the Files sub-dock — or on a line of its notes in the Tree — shows that video's notes without loading it, a missing video's too; a click on the player's picture, or a double-click on a video, a note or a bookmark, or a followed link, ties them to the video it names again. Add note always acts on the player's video, so it ties them to it first. The player's T and N panels ([[plugins#player-maximized]]) behave as these docks do: they are the same views, shown differently.

Links seek the player. A rehuco-video:<key>#t=<seconds> link is a seek of the document's player — loading the video paused first if another is loaded, the rule previous and next follow — and without #t loads the video. A link to the video already loaded goes to the time and leaves it playing or paused as it was. Any other link opens in the system's browser. It is the first custom link a markdown view handles in the agent; the filter:// links of the viewer's fields ([[plugins#filter-urls]]) are the precedent for the dispatch.

Add note at sits on the player's transport bar and in the player's commands (B, armed in the player like its other keys), so it works while the player is maximized too ([[plugins#player-maximized]]): it adds a line - [mm:ss](rehuco-video:…#t=…) and a space to the video's notes. That line is the bookmark: there is no other, and a note with no time is written by editing the notes. The line goes beside its neighbors in time, whatever order the user left the note in: after the latest bookmark at or before its time and the lines under that bookmark, else just before the earliest bookmark after it, else at the end; nothing else moves. That is all it does, docked or maximized: playback, the notes dock, its mode and the focus stay as they are, so a video can be listened to through, bookmarked as it goes, and the notes added later; a note to write now is one pause, by Space or a click, away (owner in #574; #573 paused and opened the notes in edit by default, behind a Videos-page setting since removed). The player's seek slider marks each bookmark of the video loaded with a tick, drawn under the handle.

The panel — view, editor, toggle, link dispatch — is one widget; the dock and the player's N panel each host an instance. They share one model (VideoNotesEdit), which holds which video's notes show, the search for them, the write rules above and the text of an edit: each part is one Scintilla document that every panel's editor shows, so a key typed in one is in the other as it is typed, while each panel keeps its own mode, caret and scroll. A bookmark goes into that one document, so text typed and unwritten in either panel is never lost to it, and the two are written once, by whichever way editing ends first.

The player maximized, and its panels

[[[plugins#player-maximized]]]

The player stays the tutorial's sub-dock; this is how it gets big without a layout change, and how a big video keeps its navigation and its notes a key away.

A click pauses and resumes; a double-click maximizes or restores. The player counts its own clicks (PlayerClicks): a click with no second one within the system's double-click interval toggles playback once the interval has passed, and a second within it — whatever Qt calls it — maximizes or restores instead, so a double-click never also toggles playback. A click that brings the focus to the player counts like any other (owner): the picture has nothing a stray click could harm, and players toggle on the first click. Every press still ties the notes to the player's video ([[plugins#video-notes-dock]]). The lightbox's a single click does nothing is deliberately not followed: the lightbox has nothing to toggle.

Maximizing lifts the player's stage — the picture and the panels beside it — and its transport bar into an overlay over the document, the main window or a frameless full-screen window, the three surfaces the lightbox offers ([[plugins#tutorial-plugin]]), chosen for videos by a Maximized player setting of their own on the Videos page ([[appendices.settings-pages#category-groups]]; the document by default; the next maximize uses a change, an open one is not moved). SHIFT, CTRL and CTRL+SHIFT held at the double-click pick the surface over the setting, as for an image. Esc, a double-click or the restore button at the end of the transport bar (shown only while maximized) put them back. Qt re-parents the QVideoWidget's native window rather than recreating it (#315), and libvlc's surface is an ordinary widget, so a playing video keeps playing through both moves. The overlay host is the lightbox's own mechanics — the host per surface, the size-tracking event filter, focus held while up and returned within the document on dismiss — extracted into one base both viewers sit on (OverlaySurface), not copied; the player's actions are added to the overlay too, so its keys answer there. Maximize current dock (Ctrl+Shift+M) is unchanged: that is the dock within its document. Stopping the player — closing its dock or its document — puts it back first. A maximized player reports its surface for the session entry ([[plugins#session-restore]]).

The panels sit beside the video, never over it: the picture shrinks to make room. Nothing is drawn on the picture, so Qt's engine keeps its QVideoWidget, whose native window no plain widget can paint over ([[appendices.vlc#overlay]]). The stage is a splitter — the tree on the left, the video, and a column on the right with the info above the notes — and any of them may show at once. The stage's dividers drag, and its split rides in the player's entry of the document's layout; above the notes the info is as tall as its text, behind a divider that shows and does not drag (owner). The info and each part of the notes are islands, framed as the tree is, and the notes' titles are bold over what they head (owner). Each panel is a command of the player's focus group, so the Shortcuts page lists and rebinds it; which are shown is session state, not saved:

  • I — info: the video's key, its pixel size (from videos, else the frame the engine shows), its length, its position with its progress, and where it stands in the playlist ([30/123]), in the window's own colors.
  • T — tree (#575): a second view over the Tree sub-dock's rows, the name, the progress and the length (the dock's Length column) with no header, the current video marked and brought into view as the panel is shown. Clicks are the dock's: a click shows that video's notes without loading it, a double-click plays it, a bookmark row from its time.
  • N — notes (#575): a second view of the notes, under the info, with no button: F2 (Edit notes, a command of the player's like the rest) shows it if hidden, starts editing and puts the keyboard in the editor, and ends editing when pressed again, as Esc does. It and the Notes dock are one model ([[plugins#video-notes-dock]]): the same video, and the text of an edit typed in either is in both.

Which keys a panel keeps while it has the keyboard (owner, #575). The player's keys are armed on everything inside it, the panels included, and a shortcut is tried before the focused widget sees the key; a panel claims the keys it needs by accepting the shortcut-override Qt sends first. A notes editor claims every key that is one of the player's as they are bound now, so everything types and a key rebound on the Shortcuts page follows; other shortcuts (Ctrl+S) are untouched. F2 is the one key of the player's an editor leaves to the player, so it can end the editing. Esc in an editor ends the editing and gives the keyboard back to the player, or to its overlay, and the next Esc is the player's. The tree and the rendered notes claim the plain arrows, Home, End, Page Up and Page Down: Space, B, I, T, N, [, ] and the Ctrl arrows stay the player's. Showing a panel never takes the keyboard, and one hidden while it holds it hands it to the player.

B works as it does docked: it adds its bookmark line and changes nothing else ([[plugins#video-notes-dock]]).

I and T mean what they mean in the lightbox; N is new; [, ], the arrows and Space stay the player's.

§13.7 Reference images plugin

[[[plugins#refimages-plugin]]]

Viewer/editor similar in shape to the tutorial plugin (no "follow" mode), with type-specific features. The four bullets below are the summary; the full treatment — the three data layers and their homes, the scan sidecar, user-configurable models, what a node needs, and scan dispatch — is [[reference-images]]:

  • Tagging at two granularities: archive-level and per-image. Per-image tags are stored as app-managed mutable metadata alongside .rehu/screenshots (not inside the immutable, checksummed zip), keyed to images by index/filename — see [[data-model#image-meanings]] for the screenshot-vs-zip-content distinction and the stale-overlay warning when a zip is manually refreshed.
  • Non-destructive redaction: rectangle/ellipse regions with an effect type (mosaic/blur/solid color/cover — cover is inpaint-based removal, restoring plausible skin or background rather than occluding; see [[reference-images#modes]]), stored as app-managed metadata ([[data-model#image-meanings]]) and applied at render time — the original image inside the zip stays byte-identical and covered by the checksum manifest ([[data-model#checksums]]). A toggle controls whether redaction is shown; likely a per-user (not just per-device) preference, and overridable per document and per image ([[reference-images#redaction-scope]]).
  • Search: tag-based filtering (select from existing tags, e.g. female, back, 3/4) is straightforward. Free-text natural-language search (e.g. "3/4 view of male face") is harder and should be scoped as: a cheap fallback (fuzzy match against existing tags/synonyms) now, with a semantic/embedding-based approach as a possible later upgrade — not assumed solved by simple string matching.
  • Sketch-practice slideshow: timed rotation (e.g. 20 sec/1 min/5 min per image) through a filtered image set, for drawing practice. Records a session log (ordered list of images shown, with timestamps/durations) distinct from any lifetime per-image view stats; the user can favorite/tag images from that session afterward, using the same per-image tagging mechanism as elsewhere — not a separate tagging system.
  • Drawing comparison/critique (exploratory, not committed): proposed as a two-stage pipeline — (1) deterministic facial/pose landmark detection run on both the reference image and the user's drawing, producing measurable deltas (eye height, symmetry, proportions), followed by (2) a cheap LLM call that narrates those numeric deltas in plain language. This is preferred over asking a vision-capable LLM to critique the images directly, which would be less reliably grounded in anything actually measured and more expensive per call. Caveat: landmark detectors are mature for photos but may not generalize well to loose hand-drawn sketches — this needs early prototyping against real sketches before being relied on. Treated as a v2/exploratory enrichment, not a dependency of the core sketch-practice feature.

§13.8 Daz3D plugin

[[[plugins#daz3d-plugin]]]

Viewer/editor similar in shape to the others, plus a custom action: install/uninstall the plugin/asset into the user's local Daz3D installation. Tracked per user and per box (i.e. "installed on which machine, by whom, when"), since this is a system-integration side effect rather than a view/edit operation — it's the first concrete example motivating "custom actions with tracked side effects" as a first-class plugin capability ([[plugins#core-vs-plugin]]), not just schema/viewer/editor/web.

§13.9 Grouping-entity plugins: creator, collection, learning path

[[[plugins#grouping-entities]]]

Three types share one template — a grouping entity is a metadata-only resource: 1 entity == 1 .rehu with its own type, no content files of its own (the measured sizes are simply omitted), synced, retained, and rebuilt like any resource. All three arrive with the catalog cache (CacheDB's .rehudb — their browser, the Tag Browser ([[plugins#tag-browser]]), is what needs it), and none changes the v1 on-disk membership fields ([[field-schema#sources]]), which are already the reference mechanism this design builds on.

referenced by natural home own wrinkle
creator a credited name in authors ([[field-schema#authors]]); a source's publisher ([[field-schema#sources]]) above its own resources, else the creators' home one party, two roles; alias aggregation
collection member's collections[] members' parent dir when containment-shaped, else the collections' home dual placement
learning path member's learning_paths[] the learning paths' home / owner's per-user state owned per-user, shared by copy into the reserved public scope ([[field-schema#learning-path-ownership]])
actor a face's nearest exemplar centroid in the cross-pack index, plus authored verdicts ([[reference-images#actors]]) the actors' home identity by embedding, not by name; portrait and representatives auto-picked with provenance, a user's choice wins
  • Discovered vs. genuine. An entity needs no document to exist: the membership entries on resources alone define a discovered entity — browsable, weightless, derived. A genuine entity has its own .rehu. The rule for which is which: an entity document exists exactly when the entity has something of its own to say — a description, an authoritative order, a public-visibility state. The browsers show the union, marked; adding a description to a discovered entity is what forces materializing it.
  • Materialization mints identity. Creating the entity document is a deliberate act (like import, [[data-model#write-integrity]]): it mints the UUID, seeds the item list from the discovered members, and stamps the record timestamps. Nothing materializes as a side effect of browsing.
  • The entity document is the source of truth — but never retroactively. When a genuine entity exists, its item list decides membership. A membership change is one logical operation writing both documents (the child's entry and the entity's list — each document keeps its single writer, [[data-model#write-integrity]]), never two independent field edits. A child-side entry the entity doesn't carry is pruned only when the entity is known newer (a version comparison, [[sync#overview]] — never blind precedence), the prune is a logged event, and a genuinely concurrent child-add vs. entity-edit is surfaced, not auto-lost — the same asymmetric-stakes rule as delete-vs-edit. A blind "strip on child save whatever the entity omits" would destroy legitimate child-side and offline additions the entity simply hasn't heard of yet.
  • Child entries stay even when the entity exists, as derived copies — not for authority but for self-description: a resource checked out onto offline media must still know its memberships with no entity document in reach ([[architecture-design#why-distributed]]). Entity authoritative, child cached, repaired on reconcile — the same relationship as retained metadata copies ([[mounts-and-storage#durable-retention]]).
  • Ordering. A discovered entity's order comes from the member-side index (the only data there is); a genuine entity owns the sequence in its item list, and member-side indexes become derived.
  • Description renders per membership. tc4's motive for collection descriptions — write shared prose once, show it on every member — is served by rendering each membership's entity blurb in the member's viewer ("part of X — …", one section per membership). Nothing needs to pick the collection, so the multiple-membership ambiguity that killed description inheritance never arises.
  • What every entity carries. Its name is its primary source's title — a field every resource already has, so the viewer, a browser row and the cache need nothing new; its prose is the core description; a portrait, a logo or a cover is a screenshot (<stem>01.jpg), as for any resource; and its block holds urls, a list — a creator's site, store pages and profiles, a collection's series page. An entity is matched to the resources naming it by folded name (fold, the cache's rule), so a resource crediting José names the entity Jose.
  • Creator: one party, two roles. An author and a publisher are often the same studio, so they are one type, creator, with two flags in its block, author and publisher, either or both. Its badge names the roles (Author, Publisher, Author · Publisher). One created from the Tag Browser's Authors branch starts as an author, from Publishers as a publisher; one with both is listed under both. Merging an author onto a publisher yields one creator with both roles ([[plugins#entity-merge]]).
  • Creator specifics. Its per-store URLs are the urls above; alias spellings ([[daz3d-personal-database#authors-urls]]) are later work, and aggregating credited spellings into one entity will use the duplicate-review verdict flow ([[instances-and-dedup#duplicate-review]]) — propose, human verdict, never re-ask. Until then two spellings that fold differently are two creators, and a rename onto the other merges them ([[plugins#entity-merge]]). Resources keep referencing creators by credited name; membership-by-identity (UUIDs on the references) follows the same later trajectory as collections ([[field-schema#deferred-items]]).
  • Actor specifics. An actor is discovered as a face cluster and becomes genuine when the user confirms it; its block holds the exemplar face keys the assignment is derived from, the merge log that makes a split possible, and the provenance of its auto-picked screenshots. Everything else — the face stage, the identity lanes for faceless images, split and merge, the surfaces — is [[reference-images#actors]].
  • Learning-path specifics. Paths are per-user with a private/public toggle ([[field-schema#per-user-shared]]). A private path likely stays pure per-user state with the entity document minted at publication — privacy by non-existence beats privacy by access rule — decided finally when the plugin is built. v1 (single-user, no entities) is unaffected either way.
  • Placement is free; each kind has a home. The directory tree is never the source of membership. An entity document may sit above its members — a containment-shaped collection's info.rehu in the folder holding its tutorials, a creator's info.rehu over the folders of its own tutorials and packs — or anywhere else under a scanned root as a standalone <name>.rehu; the scan descends past every record, whatever its type ([[data-model#scan-and-staleness]]). Each kind has a home the .rehuco declares ([[mounts-and-storage#rehuco-scope]]) — creators, collections, learning paths, one folder or three — where a new or materialized entity of that kind is created: a collection that gathers tutorials from many places lives there, and so does almost every learning path. Discovery needs no home at all — it is type-based: the scanner finds entity documents wherever they sit in any scanned root, so a share arriving with its own creators is just documents in its roots.
  • Names, and moving home. Each kind has a location name template on the Locations settings page, beside the resource types' (#322) — {name} for a creator, {title} for a collection and a learning path by default — which names a new document and fills the location editor's suggestions. The location editor of an entity document also offers its kind's home; picking it moves the document there, its screenshots with it as in any rename: a rename within a root, the checksum-gated move across roots or filesystems (#339).

Merging two entities

[[[plugins#entity-merge]]]

Renaming an entity A onto the name of an existing B of the same kind ([[plugins#tag-browser]]) merges A into B. B survives — its id is the one references will carry once they carry ids. Either may be discovered:

  • Both discovered: only the members change — every resource naming A names B instead ([[sync#value-rename]]).
  • A genuine, B discovered: A's document is renamed to B's name in place, id kept; nothing moves.
  • A discovered, B genuine: only the members change.
  • Both genuine: B's document takes A's:
  • URLs — B's, then each of A's that B lacks.
  • Description — B's, then A's under a heading naming A, a rule between: the non-blank parts joined by \n\n---\n\n# <A's name>\n\n. A description that is empty or only whitespace is dropped, separator and heading with it, so a lone surviving part is kept verbatim. Foo described Foo 123 and Bar described Bar 456; Bar renamed onto Foo leaves Foo with:

    Foo 123
    
    ---
    
    # Bar
    
    Bar 456
    
  • Roles (creators) — the union of both.

  • Files — everything A's stem owns moves beside B (the set a standalone rename moves, [[plugins#toolkit-surfaces]]). A's screenshots take B's next free <stem>NN slots in their own order, except one identical to a screenshot B already has, byte for byte, which is dropped; any other file keeps its suffix under B's stem. A's description is rewritten to name the moved images before it is appended — Markdown, HTML <img> and reference-style links alike, as the .tc conversion rewrites them. Whatever else the user does not want is removed afterward in B's Images editor: the merge keeps everything but duplicates.
  • Then A's .rehu and its .checksum go by the deletion policy (#312: the Recycle Bin where there is one). Never A's folder — a containment-shaped collection's info.rehu sits in its members' folder.
  • Order: move the files, write B, rewrite the members, delete A last. A run stopped at any point leaves a duplicate, never a loss, and carries on where it stopped: the merge is a job ([[sync#value-rename]]). It waits while either document is open with unsaved edits, and says so.

§13.10 Shared capability worth extracting

[[[plugins#shared-capability]]]

"Follow tutorial" ([[plugins#tutorial-plugin]]) and the sketch-practice slideshow ([[plugins#refimages-plugin]]) both want a timed/sequential presentation capability, just configured differently (tracked progress + notes/bookmarks vs. a fixed-duration rotating display + a session log). Worth designing this as one shared core capability that plugins configure, rather than reimplementing similar sequencing/timer logic independently in two plugins. The practice side's requirements are in [[reference-images#practice-sessions]]; the tutorial side's notes and bookmarks are now [[plugins#video-notes-dock]] and [[field-schema#video-notes]].