Skip to content
Open
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
47d76f5
UI kit 6d: sign-in and account pages on the kit (#461)
silverbackdan Nov 18, 2026
534f52b
Changelog for UI kit 6d (#471, #461)
silverbackdan Nov 18, 2026
9717884
UI kit 6d review: reset password field errors announced and focused, …
silverbackdan Nov 18, 2026
5cc047c
Changelog for the UI kit 6d review (#471, #461)
silverbackdan Nov 18, 2026
938fe16
Merge feat/236-kit-6a-dialog review fixes into feat/236-kit-6d-auth
silverbackdan Nov 18, 2026
7aa0dd6
Budgets for UI kit 6d on the 6a review: entry 164609, visitor 185640 …
silverbackdan Nov 18, 2026
09e3fcd
UI kit 6d review: the focused success alert and the auth links draw t…
silverbackdan Nov 18, 2026
8af12eb
Budgets and changelog for the UI kit 6d review: entry 164620, visitor…
silverbackdan Nov 18, 2026
57a113e
Resource stack on phones: a long touch press is a right-click, and be…
silverbackdan Nov 18, 2026
190fcab
Confirms on the kit: the resource manager's delete and discard, the l…
silverbackdan Nov 18, 2026
a9a9ac2
ClonePlacementMenu on the kit menu: a reka dropdown menu anchored at …
silverbackdan Nov 18, 2026
f17cb75
UI kit 7d: the page dialog's header edge says the page type or page d…
silverbackdan Nov 18, 2026
55c7958
UI kit 7d: Public without a route moves from Details to the Routes ta…
silverbackdan Nov 18, 2026
d05f089
UI kit 7d: moving to another page of an admin list scrolls back to th…
silverbackdan Nov 18, 2026
7eb31a6
UI kit 7d: the route recommendation says which page title it is based…
silverbackdan Nov 18, 2026
9abebaf
In-page editing: CwaUiInlineEdit edits text on the page, CwaUiInlineH…
silverbackdan Nov 18, 2026
ccd7529
UI kit 7d: deleting a layout names the other admins editing it again …
silverbackdan Nov 18, 2026
7f2139e
UI kit 7d: the Redirect to search sends the legacy path filter beside…
silverbackdan Nov 18, 2026
931a712
UI kit 7d: the add component dialog's Field says Loading… while a dat…
silverbackdan Nov 18, 2026
623d25c
The rest of the admin on the kit: the header's Edit/Done, page settin…
silverbackdan Nov 18, 2026
ce897fa
Preview: merge 7b in-page editing (WIP)
silverbackdan Nov 18, 2026
e896237
Preview: merge 7d modal parity (WIP)
silverbackdan Nov 18, 2026
29ddf2e
Kit workbench: remembered settings for theme, touch, width and reduce…
silverbackdan Nov 18, 2026
32ddbbf
SelectOption comes from cwa-select now that cwa-select-input is gone;…
silverbackdan Nov 18, 2026
b79b4c8
Changelog for UI kit 7c (#481, #461)
silverbackdan Nov 18, 2026
114fdee
Preview: merge 7c rest of the admin on the kit (WIP)
silverbackdan Nov 18, 2026
dad4539
UI kit 7d: the page type is a Static/Dynamic select in the dialog hea…
silverbackdan Nov 18, 2026
2bcfb79
Changelog and CLAUDE.md for UI kit 7d (#482, #461)
silverbackdan Nov 18, 2026
e36ced8
Kit workbench: sticky toolbar with theme, width frame, touch, reduced…
silverbackdan Nov 18, 2026
8e3e056
CwaUiLinkPopover: link editing for rich text (a page from the routes,…
silverbackdan Nov 18, 2026
1aff65b
CwaUiImageAlt (an image field with its alt text in a popover from an …
silverbackdan Nov 18, 2026
f54caa1
UI kit 7d: entry budget 164716 B and visitor preload budget 185420 B …
silverbackdan Nov 18, 2026
bc033e3
Kit workbench: field states simulation, every field type in one force…
silverbackdan Nov 18, 2026
69a14fc
Kit fixes: a Toggle's label sits in the field's lead, so a peer's pre…
silverbackdan Nov 18, 2026
f8136c6
Preview: specs follow the solid edit placeholder and the unused mediu…
silverbackdan Nov 18, 2026
2f5fff7
CwaUiDayRangePicker: a first and last day on the kit range calendar, …
silverbackdan Nov 18, 2026
b69cf2c
Kit workbench: Kit and In practice tabs (?tab=practice), and the fail…
silverbackdan Nov 18, 2026
8a22161
Preview: merge latest 7b-inline
silverbackdan Nov 18, 2026
0043ae3
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
44c73cf
Preview: merge latest 7d-modal-parity
silverbackdan Nov 18, 2026
4a86c3b
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
07857ba
Preview: merge latest 6d-auth
silverbackdan Nov 18, 2026
7a5d059
Kit workbench: search menu and list simulations with the shared loadi…
silverbackdan Nov 18, 2026
506e145
Kit workbench: dialogs simulation, page kinds, adding or editing, and…
silverbackdan Nov 18, 2026
61927fa
Kit page: DayRangePicker, ImageAlt and ImageSlots with the fields, an…
silverbackdan Nov 18, 2026
b3895dc
The Order tab's Move up, Move down and position work without Enable r…
silverbackdan Nov 18, 2026
34863e1
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
7da04f7
A kit field shows a conflict's values through its own format (a date …
silverbackdan Nov 18, 2026
561c266
Changelog and CLAUDE.md for UI kit 7b (#479, #461)
silverbackdan Nov 18, 2026
af20f1b
Kit workbench: resource stack and toast simulations; sim controls scr…
silverbackdan Nov 18, 2026
d9cfd0e
The kit tokens spec no longer expects --cwa-color-medium: its last us…
silverbackdan Nov 18, 2026
0bba367
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
10a99fc
Preview: merge latest 7b-inline
silverbackdan Nov 18, 2026
5147314
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
9f45b52
Changelog: resolve the conflict markers inherited from the base, keep…
silverbackdan Nov 18, 2026
0f22b08
UI kit 7d: a long depth chain scrolls sideways under the dialog heade…
silverbackdan Nov 18, 2026
6f0bc19
The outdated notice is visitor-facing, so its Update uses the kit's b…
silverbackdan Nov 18, 2026
511fae3
Kit workbench: In practice tab, the real admin header, manager bar an…
silverbackdan Nov 18, 2026
cec38c4
Deleting a component used in several places asks with Don't delete an…
silverbackdan Nov 18, 2026
0652222
Preview: FormGroup's form-error test sets the error through failNext,…
silverbackdan Nov 18, 2026
2c550fe
Preview: merge latest 7b-inline
silverbackdan Nov 18, 2026
7eea40c
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
3249ab5
Preview: merge latest 7d-modal-parity
silverbackdan Nov 18, 2026
483ccb2
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
ae0b58a
Kit: information popovers on a dark surface with white text (#461)
silverbackdan Nov 18, 2026
1655db3
UI kit 7d: the lists' Status column fits an Inherited scheduled badge…
silverbackdan Nov 18, 2026
8e90c60
FormGroup spec: raise the form error through the fake form's next Sav…
silverbackdan Nov 18, 2026
c10d949
Preview: merge latest 7d-modal-parity
silverbackdan Nov 18, 2026
015dd39
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
8ab0616
Preview: merge latest 7f-polish
silverbackdan Nov 18, 2026
88d13fd
Kit: muted secondary links on the auth pages; playground drops the de…
silverbackdan Nov 18, 2026
2175a00
Preview: recompile cwa.css for the merged sources
silverbackdan Nov 18, 2026
8793aa9
Preview: merge latest 7f-polish
silverbackdan Nov 18, 2026
5597f82
Kit: /kit runs without the page's CWA (no layout, no route fetch); In…
silverbackdan Nov 18, 2026
23cd9b8
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
e1224bd
Site settings shows the bundle and app versions in full, with the bun…
silverbackdan Nov 18, 2026
cbf8ba7
The kept-stack spec stubs the focus outline, whose ComponentFocus moc…
silverbackdan Nov 18, 2026
48cc641
Recompile the kit CSS: the saving lines' colours, the 3px page-type s…
silverbackdan Nov 18, 2026
0786e31
Changelog: site settings versions (#484)
silverbackdan Nov 18, 2026
c213b4b
Preview: merge latest 7g-settings
silverbackdan Nov 18, 2026
54c7eba
Kit workbench: type the live field model's state as always present, a…
silverbackdan Nov 18, 2026
134055d
List rows' Edit is a pencil drawn in the text colour, not the setting…
silverbackdan Nov 18, 2026
6652fa3
UI kit 7d: edit dialogs slide over from the right, confirms and the a…
silverbackdan Nov 18, 2026
28029a0
Preview: merge latest 7g-settings
silverbackdan Nov 18, 2026
a7103bb
Empty position and group placeholders only in edit mode, so an admin …
silverbackdan Nov 18, 2026
31d0a47
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
ce41806
Kit: the resource stack grows by scale, so it never paints at the top…
silverbackdan Nov 18, 2026
b7c4b97
Kit: dialogs open with focus on their title, never a header control (…
silverbackdan Nov 18, 2026
e077608
Preview: merge latest 7f-polish
silverbackdan Nov 18, 2026
22a68b9
Kit page spec: load the kit page before the first navigation, so a co…
silverbackdan Nov 18, 2026
92cf14e
Preview: merge latest 7b-inline
silverbackdan Nov 18, 2026
b1c81cf
Preview: merge latest 7d-modal-parity
silverbackdan Nov 18, 2026
3a1e68b
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
8cfdb84
Browser scenarios 30 and 43 expect the solid outlines 7c drew (the or…
silverbackdan Nov 18, 2026
b63e2b3
UI kit 7d: entry and visitor preload budgets back to 164702 B and 185…
silverbackdan Nov 18, 2026
2f56fa2
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
8b0860d
Preview: merge latest 7d-modal-parity
silverbackdan Nov 18, 2026
6688eb8
Kit: segmented controls hug their options instead of stretching acros…
silverbackdan Nov 18, 2026
f2987b0
Preview: merge latest 7f-polish
silverbackdan Nov 18, 2026
3efb854
The stranded groups dialog takes the warning header line, as the old …
silverbackdan Nov 18, 2026
2aefcae
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
ef3f7b6
The resource stack no longer jumps while it opens: its grow animation…
silverbackdan Nov 18, 2026
ce8f6eb
Merge feat/236-kit-preview into 7e (#461)
silverbackdan Nov 18, 2026
c94be55
UI kit 7d: the dialog header's eye and close sit together, apart from…
silverbackdan Nov 18, 2026
86d480e
Preview: merge latest 7d-modal-parity
silverbackdan Nov 18, 2026
9261a6a
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
fb9236a
Kit: information popovers match the proposal's popover, the menu surf…
silverbackdan Nov 18, 2026
9634163
Site settings in General, SEO, Maintenance and About tabs with one Sa…
silverbackdan Nov 18, 2026
20ed7f9
Preview: merge latest 7f-polish
silverbackdan Nov 18, 2026
cc80f3d
Merge remote-tracking branch 'origin/feat/236-kit-preview' into feat/…
silverbackdan Nov 18, 2026
8418bf3
Preview: merge latest 7g-settings
silverbackdan Nov 18, 2026
7f58861
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
c9e61a5
Browser scenarios 56-60 recorded against the local API (phone sheet, …
silverbackdan Nov 18, 2026
40223c0
The admin header's row is centred in the bar, so the menu and Edit si…
silverbackdan Nov 18, 2026
5a1f50d
Preview: merge latest 7b-inline
silverbackdan Nov 18, 2026
3b60166
Kit: the resource stack opens with a fade and a 4px downward settle, …
silverbackdan Nov 18, 2026
320b41b
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
3d7ab5a
Preview: close the in-page editing describe before 7c's header scenario
silverbackdan Nov 18, 2026
9185573
Preview: merge latest 7f-polish
silverbackdan Nov 18, 2026
2bf56b8
Budgets for UI kit 7b: entry 164805 B and visitor 185960 B, just abov…
silverbackdan Nov 18, 2026
5206f13
Preview: merge latest 7b-inline
silverbackdan Nov 18, 2026
ab4d73a
Kit: information popovers and their caret get a 1px line ring (#461)
silverbackdan Nov 18, 2026
70d7e30
Preview: merge latest 7f-polish
silverbackdan Nov 18, 2026
bb3c234
UI kit 7d: an edit slide-over opens at once and shows a spinner while…
silverbackdan Nov 18, 2026
89e497e
Preview: merge latest 7d-modal-parity
silverbackdan Nov 18, 2026
a1e977a
Kit In practice: usable without explanation; site first with a Try li…
silverbackdan Nov 18, 2026
f609bf8
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
ca8b268
UI kit 7d: round Static and Dynamic dots everywhere; Redirect to sear…
silverbackdan Nov 18, 2026
fbdeba0
Escape from a CwaUiInlineEdit whose save has failed reverts and goes …
silverbackdan Nov 18, 2026
3acb814
Preview: merge latest 7b-inline
silverbackdan Nov 18, 2026
43b52a8
Kit: fill the slots with the page type select, the dialog's type line…
silverbackdan Nov 18, 2026
cf6acd0
Preview: merge latest 7d-modal-parity
silverbackdan Nov 18, 2026
64b58d7
Preview: the dialog focuses its title by the title ref's value, which…
silverbackdan Nov 18, 2026
5ab4613
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
f5a88c2
Selection outline shows the selected component's save state: sweep, s…
silverbackdan Nov 18, 2026
c7a4d95
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
87d1fd6
The bar status opens an error popover for a field an in-page editor h…
silverbackdan Nov 18, 2026
1984b03
Preview: merge latest 7b-inline
silverbackdan Nov 18, 2026
dcd58c0
Dialog alert names a refused field on an unopened tab by the label it…
silverbackdan Nov 18, 2026
bcb24ba
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
5ade02e
InlineHandoff in a manager tab: its Edit dialog holds the text area w…
silverbackdan Nov 18, 2026
f33a94a
Kit sizing: buttons match the fields beside them on touch, an image f…
silverbackdan Nov 18, 2026
697ffa9
Kit: a field's focus ring fades in from transparent, never from white…
silverbackdan Nov 18, 2026
d57afb2
Preview: merge latest 7f-polish
silverbackdan Nov 18, 2026
ce4e22f
ManagerTab's scrolling row clips its fields' positioned parts, so a t…
silverbackdan Nov 18, 2026
6e7b780
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
ac24bcd
Site settings: the tab follows the URL hash by replace, never scrolls…
silverbackdan Nov 18, 2026
a51d2e9
Preview: merge latest 7g-settings
silverbackdan Nov 18, 2026
7dc2dd0
Every kit field takes disabledReason, shown behind its ⓘ in the dark …
silverbackdan Nov 18, 2026
6bccdbd
The manager tab root check no longer warns for a tab that renders Cwa…
silverbackdan Nov 18, 2026
9357dc1
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
386573e
UI kit 7d review: a depth switch never keeps the previous depth's dat…
silverbackdan Nov 18, 2026
83ce165
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
271766c
Preview: merge latest 7d-modal-parity
silverbackdan Nov 18, 2026
08109ae
Review fixes for UI kit 7b: long press only in edit mode and the nati…
silverbackdan Nov 18, 2026
a94ee3c
Preview: merge latest 7b-inline (7b's beside slot replaces 7f's items…
silverbackdan Nov 18, 2026
1188b90
On a phone the header's "Live editing paused" is a glyph named for it…
silverbackdan Nov 18, 2026
39c4abb
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
601fac6
Guard that the committed compiled CSS is current: scripts/check-compi…
silverbackdan Nov 18, 2026
41af1c1
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
5abde59
List rows' Edit and View glyphs are 20px in their 32px targets (44px …
silverbackdan Nov 18, 2026
38284a2
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
ed7e29b
A save failing through a field shows in the field, the bar status and…
silverbackdan Nov 18, 2026
b97a21c
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
47ecbba
Clicking an in-page editor on a page starts the edit instead of askin…
silverbackdan Nov 18, 2026
7b26750
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
bc517fa
Merge remote-tracking branch 'origin/feat/236-kit-7-in-page' into fea…
silverbackdan Nov 18, 2026
e18e1f8
Renumber the two step 7c header scenarios 61 and 62, after the step 7…
silverbackdan Nov 18, 2026
2a2be31
CwaRootLayout's click specs wait for the clock to pass the mount: Vue…
silverbackdan Nov 18, 2026
dd9c764
Set the entry and visitor preload budgets just above the consolidated…
silverbackdan Nov 18, 2026
63166bd
Merge the consolidated kit steps' changelog lines into one line per s…
silverbackdan Nov 18, 2026
85d0ce4
The header's Edit/Done sits on the same centre as page settings and t…
silverbackdan Nov 18, 2026
a6ed606
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
f0f4530
An edit slide-over slides out when closed, the page behind fading, an…
silverbackdan Nov 18, 2026
a28b6fd
Preview: merge latest 7d-modal-parity
silverbackdan Nov 18, 2026
e4c9974
Merge the preview's 7c header centring and 7d slide-out into the cons…
silverbackdan Nov 18, 2026
ac1835b
The header's path selector is as tall as Done beside it on a touch sc…
silverbackdan Nov 18, 2026
519dfc0
Preview: merge consolidation fixes (scenario renumbering, PathSelecto…
silverbackdan Nov 18, 2026
02dba34
Content an admin's choice reveals scrolls into view by the least move…
silverbackdan Nov 18, 2026
dcbe4e1
Merge the kit preview into 7e: the reveal re-applied on 7g's tabbed s…
silverbackdan Nov 18, 2026
311390d
Merge feat/236-kit-preview into feat/236-kit-7c-old-ui
silverbackdan Nov 18, 2026
db6fb29
Merge feat/236-kit-preview into feat/236-kit-7d-modal-parity
silverbackdan Nov 18, 2026
63eda7f
Merge feat/236-kit-preview into feat/236-kit-7b-inline
silverbackdan Nov 18, 2026
55127fa
Merge remote-tracking branch 'origin/feat/236-kit-preview' into feat/…
silverbackdan Nov 18, 2026
11e90c4
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
47b432f
Kit at 390 never scrolls sideways: below 40rem kit rows let a bar-lay…
silverbackdan Nov 18, 2026
8795cad
Preview: merge latest 7e-kit-workbench
silverbackdan Nov 18, 2026
12653af
Persona review fixes: the header menu toggle is a button that moves f…
silverbackdan Nov 18, 2026
c31e8f4
Preview: merge latest 7c-old-ui
silverbackdan Nov 18, 2026
98e6aa5
UI kit 7d persona fixes: Delete Draft on a live component asks to dis…
silverbackdan Nov 18, 2026
217df96
Preview: merge latest 7d-modal-parity
silverbackdan Nov 18, 2026
6659fb5
Components are selected by keyboard in edit mode, the bar's tabs are …
silverbackdan Nov 18, 2026
995afc8
Preview: merge latest 7b-inline
silverbackdan Nov 18, 2026
9ece403
The TipTap reference edits a Body Text not added yet on its own and j…
silverbackdan Nov 18, 2026
19a9041
Preview: merge latest 7f-polish
silverbackdan Nov 18, 2026
b228866
Preview: merge latest into 7e
silverbackdan Nov 18, 2026
a1ca06f
A choice reveals content only when the action that made it was in the…
silverbackdan Nov 18, 2026
1487261
A field's fill is darker and its placeholder dimmer, so an empty fiel…
silverbackdan Nov 18, 2026
8e38194
CwaUiTextarea warns once in development in a manager tab and names th…
silverbackdan Nov 18, 2026
074c78a
Placeholders read clearly dimmer than values (2.3:1 between them) on …
silverbackdan Nov 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Check the committed compiled CSS is current
run: pnpm run tailwind:check

- name: Prepare
run: pnpm run dev:prepare

Expand Down
28 changes: 8 additions & 20 deletions CHANGELOG.md

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions CLAUDE.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"tailwind:main": "postcss src/tailwind/tailwind-cwa.css -o ./src/runtime/templates/assets/cwa.css",
"tailwind:base": "postcss src/tailwind/tailwind-base.css -o ./src/runtime/templates/assets/base.css",
"tailwind:watch": "postcss src/tailwind/tailwind-cwa.css -o ./src/runtime/templates/assets/cwa.css --watch",
"tailwind:check": "node scripts/check-compiled-css.mjs",
"test:fresh-install": "node test/e2e/fresh-install.mjs",
"test:browser": "playwright test -c test/browser/playwright.config.mjs",
"test:browser:rehearse": "node test/browser/rehearse.mjs"
Expand Down
71 changes: 71 additions & 0 deletions playground/app/kit/KitImageAlt.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<script setup lang="ts">
import { ref } from 'vue'
import { CwaUiButton, CwaUiDialog, CwaUiFormSection, CwaUiImageAlt, CwaUiImageSlots, CwaUiManagerTab } from '#components'
import { createFakeSaveServer, liveFieldModel } from './fake-save-server'
import { kitFieldSet } from './kit-field-set'

const set = kitFieldSet(createFakeSaveServer())
const alt = liveFieldModel<string>(createFakeSaveServer(), 'alt', '')
const dialogOpen = ref(false)
</script>

<template>
<div class="kit-image-alt">
<div
class="kit-image-alt-bar"
data-testid="kit-image-alt-bar"
>
<CwaUiManagerTab>
<CwaUiImageAlt
label="Image"
:upload="set.upload"
:alt="alt"
/>
<CwaUiImageSlots
label="Images"
:slots="[{ label: 'Desktop', upload: set.upload }, { label: 'Mobile', upload: set.upload }]"
/>
<CwaUiButton
label="Crop"
size="sm"
/>
</CwaUiManagerTab>
</div>
<CwaUiButton
label="Open the image dialog"
size="sm"
data-testid="kit-image-alt-dialog-open"
@click="dialogOpen = true"
/>
<CwaUiDialog
v-if="dialogOpen"
title="Image"
size="md"
data-testid="kit-image-alt-dialog"
@close="dialogOpen = false"
>
<CwaUiFormSection title="Image">
<CwaUiImageAlt
label="Image"
:upload="set.upload"
:alt="alt"
/>
</CwaUiFormSection>
</CwaUiDialog>
</div>
</template>

<style scoped>
.kit-image-alt {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 1rem;
}

.kit-image-alt-bar {
max-width: 100%;
background: var(--cwa-color-surface);
box-shadow: inset 0 0 0 1px var(--cwa-color-line);
}
</style>
75 changes: 0 additions & 75 deletions playground/app/kit/KitInfoPopoverLooks.vue

This file was deleted.

10 changes: 5 additions & 5 deletions playground/app/pages/kit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import { badgeTintPercent } from '../../../src/runtime/templates/components/ui/k
import { kitColourLabel, kitColourTokens, kitContrastPairs, kitThemeStyle, kitTokenCss, measureKitPair } from '../../../src/tailwind/kit-tokens'
import KitWorkbench from '../kit/KitWorkbench.vue'
import KitLabs from '../kit/KitLabs.vue'
import KitInfoPopoverLooks from '../kit/KitInfoPopoverLooks.vue'
import KitImageAlt from '../kit/KitImageAlt.vue'
import { useKitWorkbench } from '../kit/workbench-state'
import KitPractice from '../kit/KitPractice.vue'
import KitRevealSim from '../kit/KitRevealSim.vue'
Expand Down Expand Up @@ -535,11 +535,11 @@ const badgeTones = [
</div>
</section>

<section aria-labelledby="kit-info-popover">
<h2 id="kit-info-popover">
Information popover
<section aria-labelledby="kit-image-alt">
<h2 id="kit-image-alt">
Image with alt text
</h2>
<KitInfoPopoverLooks />
<KitImageAlt />
</section>

<section aria-labelledby="kit-fields">
Expand Down
39 changes: 39 additions & 0 deletions scripts/check-compiled-css.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { execFileSync } from 'node:child_process'
import { mkdtempSync, readFileSync, rmSync } from 'node:fs'
import { createRequire } from 'node:module'
import { tmpdir } from 'node:os'
import { join, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'

export const compiledCss = [
{ script: 'tailwind:main', source: 'src/tailwind/tailwind-cwa.css', committed: 'src/runtime/templates/assets/cwa.css' },
{ script: 'tailwind:base', source: 'src/tailwind/tailwind-base.css', committed: 'src/runtime/templates/assets/base.css' },
]

const postcssCli = createRequire(import.meta.url).resolve('postcss-cli')

export function findStaleCompiledCss(root, files = compiledCss) {
const out = mkdtempSync(join(tmpdir(), 'cwa-compiled-css-'))
try {
return files.filter(({ source, committed }, index) => {
const target = join(out, `${index}.css`)
execFileSync(process.execPath, [postcssCli, source, '-o', target], { cwd: root, stdio: ['ignore', 'ignore', 'inherit'] })
return readFileSync(target, 'utf8') !== readFileSync(resolve(root, committed), 'utf8')
})
}
finally {
rmSync(out, { recursive: true, force: true })
}
}

export function staleMessage(stale) {
return `The committed compiled CSS is out of date, so it does not hold every class the source uses:\n${stale.map(({ script, committed }) => ` ${committed}: run \`pnpm run ${script}\` and commit it`).join('\n')}`
}

if (process.argv[1] === fileURLToPath(import.meta.url)) {
const stale = findStaleCompiledCss(process.cwd())
if (stale.length) {
console.error(staleMessage(stale))
process.exit(1)
}
}
136 changes: 136 additions & 0 deletions src/layer/_composables/useItemPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,3 +615,139 @@ describe('useItemPage creating (#461)', () => {
expect(errors).toHaveLength(1)
})
})

describe('useItemPage loading', () => {
const child = '/_/layouts/child'
const parent = '/_/layouts/parent'
const grand = '/_/layouts/grand'

function setupLoading(stored: Record<string, any>, start = child) {
const store = reactive<Record<string, any>>(Object.fromEntries(Object.entries(stored).map(([iri, data]) => [iri, { data, apiState: { status: 'SUCCESS' } }])))
const answers: Record<string, (data?: Record<string, any>) => void> = {}
const fetchResource = vi.fn(({ path }: { path: string }) => new Promise<void>((resolve) => {
answers[path] = (data) => {
data && (store[path] = { data, apiState: { status: 'SUCCESS' } })
resolve()
}
}))
// @ts-expect-error
vi.spyOn(cwaComposable, 'useCwa').mockImplementation(() => ({
resources: { getResource: vi.fn((iri: string) => computed(() => store[iri])) },
resourcesManager: { errors: [], updateResource: vi.fn() },
fetchResource,
}))
const endpoint = ref(start)
const emit = vi.fn()
let itemPage!: ReturnType<typeof useItemPage>
mount(defineComponent({
setup() {
itemPage = useItemPage({ createEndpoint: '/_/layouts', emit, resourceType: 'Layout', defaultResource: {}, endpoint })
return () => null
},
}))
return { itemPage: () => itemPage, endpoint, answers, fetchResource, emit }
}

const layoutAt = (iri: string, reference: string, more: Record<string, any> = {}) => ({ ...layout, '@id': iri, reference, ...more })

test('a resource the store already holds shows at once, without loading, while it is fetched again', async () => {
const { itemPage } = setupLoading({ [child]: layoutAt(child, 'Child') })
await flushPromises()
expect(itemPage().isLoading.value).toBe(false)
expect(itemPage().localResourceData.value?.reference).toBe('Child')
})

test('a resource not stored is loading until its fetch answers', async () => {
const { itemPage, answers } = setupLoading({})
await flushPromises()
expect(itemPage().isLoading.value).toBe(true)
answers[child]!(layoutAt(child, 'Child'))
await flushPromises()
expect(itemPage().isLoading.value).toBe(false)
expect(itemPage().localResourceData.value?.reference).toBe('Child')
})

test('moving to a resource not stored drops the previous one at once: nothing unsaved, nothing to send, until it arrives', async () => {
const { itemPage, endpoint, answers } = setupLoading({ [child]: layoutAt(child, 'Child') })
await flushPromises()
itemPage().localResourceData.value!.reference = 'Edited'

endpoint.value = parent
await flushPromises()
expect(itemPage().isLoading.value).toBe(true)
expect(itemPage().localResourceData.value).toBeUndefined()
expect(itemPage().form.unsavedFields).toEqual([])

answers[parent]!(layoutAt(parent, 'Parent'))
await flushPromises()
expect(itemPage().isLoading.value).toBe(false)
expect(itemPage().localResourceData.value?.reference).toBe('Parent')
})

test('only the latest of overlapping loads ends the loading: an earlier answer arriving first never shows another resource as loaded', async () => {
const { itemPage, endpoint, answers } = setupLoading({ [child]: layoutAt(child, 'Child', { parentPage: '/_/pages/x' }) })
await flushPromises()
endpoint.value = parent
await flushPromises()
endpoint.value = grand
await flushPromises()

answers[parent]!(layoutAt(parent, 'Parent'))
await flushPromises()
expect(itemPage().isLoading.value).toBe(true)
expect(itemPage().localResourceData.value).toBeUndefined()

answers[grand]!(layoutAt(grand, 'Grand'))
await flushPromises()
expect(itemPage().isLoading.value).toBe(false)
expect(itemPage().localResourceData.value).toMatchObject({ '@id': grand, 'reference': 'Grand' })
expect(itemPage().loadFailed.value).toBe(false)
})

test('a later load that brings nothing is a failure shown in place, with nothing to send, and Retry loads it again', async () => {
const { itemPage, endpoint, answers, fetchResource, emit } = setupLoading({ [child]: layoutAt(child, 'Child') })
await flushPromises()
endpoint.value = parent
await flushPromises()

answers[parent]!()
await flushPromises()
expect(itemPage().isLoading.value).toBe(false)
expect(itemPage().loadFailed.value).toBe(true)
expect(itemPage().localResourceData.value).toBeUndefined()
expect(itemPage().form.unsavedFields).toEqual([])
expect(emit).not.toHaveBeenCalledWith('close')

itemPage().loadResource()
await flushPromises()
expect(itemPage().loadFailed.value).toBe(false)
expect(itemPage().isLoading.value).toBe(true)
answers[parent]!(layoutAt(parent, 'Parent'))
await flushPromises()
expect(itemPage().loadFailed.value).toBe(false)
expect(itemPage().localResourceData.value?.reference).toBe('Parent')
expect(fetchResource).toHaveBeenCalledTimes(3)
})

test('the first load that brings nothing closes the dialog, as before', async () => {
const { itemPage, answers, emit } = setupLoading({})
await flushPromises()
answers[child]!()
await flushPromises()
expect(emit).toHaveBeenCalledWith('close')
expect(itemPage().loadFailed.value).toBe(false)
})

test('a first load overtaken by a move does not close the dialog for the resource moved to', async () => {
const { itemPage, endpoint, answers, emit } = setupLoading({})
await flushPromises()
endpoint.value = parent
await flushPromises()
answers[child]!()
await flushPromises()
expect(emit).not.toHaveBeenCalledWith('close')
answers[parent]!(layoutAt(parent, 'Parent'))
await flushPromises()
expect(itemPage().localResourceData.value?.reference).toBe('Parent')
})
})
Loading