Skip to content

refactor: decide what the data check holds in one place - #1091

Merged
ixuz merged 4 commits into
mainfrom
data-check-hold
Nov 28, 2026
Merged

ixuz merged 4 commits into
mainfrom
data-check-hold

Conversation

@ixuz

@ixuz ixuz commented Nov 28, 2026

Copy link
Copy Markdown
Member

What and why

Each Studio screen worked out for itself whether the data check holds its writes. It combined useDataCheck's readOnly with arrangementSetAside or isSetAside, in three different ways for the same three kinds of target. A new screen copied one of those expressions, and nothing checked that it picked the right one. The rule itself sat in a ui hook, where only a rendered test could reach it. Solid Memo's deck list and the Studio's Groups also differ, on purpose, in what they hold for a set-aside deck, but that difference only showed when you compared the two containers.

Four commits:

  • holdOf in the domain (validation.ts, next to deckSetAside and arrangementSetAside). It takes the check's state (the policy, and whether the check is pending, failed or has a report) and a target: the instance's own documents, the catalog, a list of decks or one deck. It returns why a write to that target waits (checking, unchecked, blocked or setAside), or null. It's tested once, for every policy, status and target. readOnly already answers from it in this commit.
  • hold(target) replaces readOnly on DataCheck. The 13 Studio containers ask it about what they write, and none combines the parts itself any more. ReadOnlySubject (what a held screen's notice names) is now taken from the target's kind, so a notice can't name one target while the rule asks about another. What each screen holds is the same as before.
  • Home's move into a group asks the catalog's hold, alongside the newer-version lock, so it says why for every reason the catalog waits. When the reason has no move message of its own (check running, check failed, instance blocked), the dialog shows the Studio's usual read-only line with its health link. Before this, the lock read arrangementSetAside directly. That was safe only because nothing can be selected while the check holds the decks.
  • DeckListScreen's deckHeld is required, so each deck list states which decks it holds. Solid Memo's deck list passes one that holds none, with the reason in a comment. The invalid data policy's section in docs/validation.md now says a set-aside deck can still be renamed, paused and deleted there, and that the Studio holds those actions.

Choices the issue left open:

  • I added an instance target, which the issue's sketch didn't have. It covers what nothing sets aside one by one: a draft, and Groups' wait while the check runs.
  • The target and subject keep the spelling "catalogue", because the Studio's messages are keyed by it (studio.readOnly.catalogue). The docs say "catalog" in their prose, as cspell requires.

Unchanged:

  • isSetAside and arrangementSetAside stay on DataCheck for the notices and hints that name what is set aside. They no longer decide a write in the Studio.
  • The workspace's route gate, a released draft's own reason, and the newer-version lock stay as they are.

Docs: docs/validation.md and docs/studio.md (sections "Data set aside" and "Groups") describe holdOf and hold.

Nothing the app writes to a pod or to localStorage changes. npm run check passes on each commit.

Closes: #1090

ixuz added 4 commits November 28, 2026 13:49
The invalid data policy's parts were in the domain (deckSetAside,
arrangementSetAside), but how they combine into "may this be written"
was in a ui hook, useDataCheck's readOnly, and only a rendered test
could reach it.

holdOf takes the check's state and what is written to (the instance,
the catalog, a list of decks or one deck) and says why the write waits,
or null. It is tested once, for every policy, status and target, and
readOnly now answers from it.

Refs: #1090
Each Studio container combined readOnly with arrangementSetAside or
isSetAside itself, in three ways for the same three targets. A new
screen copied one of the expressions, and nothing checked it picked
the right one.

useDataCheck now offers hold(target), answered by holdOf, in place of
readOnly. The containers ask it about the catalog, their list of decks
or one deck, and the notice's subject is that target's kind. What each
screen holds is as before.

Refs: #1090
Home's move lock still read arrangementSetAside itself, the one
Studio write decision left outside the data check's hold. It was safe
only because nothing can be selected while the check holds the decks.

The lock now asks hold about the catalog, beside the newer-version
lock, so it says why for every reason the catalog waits: the check
being made, one that could not be made or blocks the instance, and the
arrangement set aside.

Refs: #1090
DeckListScreen held no deck unless told to, so Solid Memo's deck list
let a set-aside deck be renamed, paused and deleted only because it
left deckHeld out, while the Studio's Groups holds them. The difference
was intended, but could only be seen by comparing the two containers.

deckHeld is now required: the deck list passes a choice that holds
none, with the reason beside it, and the invalid data policy's page
says what a set-aside deck still offers there.

Closes: #1090
@ixuz ixuz added the enhancement New feature or request label Nov 28, 2026
@ixuz
ixuz enabled auto-merge November 28, 2026 13:21
@ixuz
ixuz added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit 3809248 Nov 28, 2026
57 checks passed
@ixuz
ixuz deleted the data-check-hold branch November 28, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Each Studio screen works out whether the data check holds its writes, from the same parts combined in three ways

1 participant