diff --git a/database/seeders/ShowcaseWidgetsSeeder.php b/database/seeders/ShowcaseWidgetsSeeder.php index ad9e164c..379217f3 100644 --- a/database/seeders/ShowcaseWidgetsSeeder.php +++ b/database/seeders/ShowcaseWidgetsSeeder.php @@ -16,7 +16,7 @@ /** * The Local Team's "Widget gallery": one widget of every type and its main variants, the - * screen docs/widgets.md takes its screenshots of (npm run docs:screenshots). An 8 x 17 + * screen docs/widgets.md takes its screenshots of (npm run docs:screenshots). An 8 x 19 * grid that fills its display: 1920 px wide, its cells are as wide as an 8-column screen's * on a 1920 x 1080 TV, and square. Its calendar is a data source of Storefront whose feed is * written again on every run, relative to now; a gallery screen already there is kept. @@ -28,7 +28,7 @@ class ShowcaseWidgetsSeeder extends Seeder /** Eight columns as on a 1920 x 1080 TV with four rows; the gallery has more rows of the same size. */ private const int COLS = 8; - private const int ROWS = 17; + private const int ROWS = 19; private const string TIMEZONE = 'Europe/Copenhagen'; @@ -126,7 +126,7 @@ private function feed(CarbonImmutable $now): string } /** - * Rows of tiles on the 8 x 17 grid, named by type and variant. + * Rows of tiles on the 8 x 19 grid, named by type and variant. * * @return list> */ @@ -195,6 +195,15 @@ private function widgets(?Project $project, ?DataSource $calendar): array $widget('stat-activity', 'stat', 'activity', 5, 14, 2, 1, 'Carts abandoned', ['compare' => 'yesterday', ...$centered], [...$storefront, 'filter' => 'cart:cart.abandoned']), $widget('list-activity', 'list', 'top_activity', 0, 15, 4, 2, 'Storefront activity', ['show_project' => false], $storefront), $widget('list-activity-latest', 'list', 'latest_activity', 4, 15, 4, 2, options: [], scope: $storefront), + + // A group with its title, behind the two tiles it holds; they draw no card of their own. + $widget('group', 'group', null, 0, 17, 4, 2, 'Checkout', ['show_title' => true]), + $widget('group-requests', 'stat', 'requests', 0, 17, 2, 2, options: ['compare' => 'yesterday', ...$centered], scope: $storefront), + $widget('group-errors', 'gauge', 'error_rate', 2, 17, 2, 2, scope: $storefront), + + // QR codes in a style of their own: modules, eyes apart, colors and a filter. + $widget('qr-styled', 'qr', null, 4, 17, 2, 2, options: ['url' => 'https://lumberjack.test', 'caption' => 'Status page', 'qr_module' => 'dots-medium', 'qr_eyes' => 'custom', 'qr_outer' => 'circle', 'qr_inner' => 'heart', 'qr_filters' => ['mixed-rotation']]), + $widget('qr-colors', 'qr', null, 6, 17, 2, 2, options: ['url' => 'https://lumberjack.test', 'caption' => 'Our docs', 'qr_logo' => false, 'qr_color' => '#1e1b4b', 'qr_background' => '#ffffff', 'qr_module' => 'flowing-soft', 'qr_eyes' => 'leaf']), ]; } } diff --git a/docs/guides/status-tv.md b/docs/guides/status-tv.md index e2303f9d..8c1c0ec4 100644 --- a/docs/guides/status-tv.md +++ b/docs/guides/status-tv.md @@ -29,9 +29,9 @@ settings of the selected widget on the right. ![The designer](../screenshots/screen-designer.png) -1. Click the grid's background for the screen's settings: the **projects**, - **environment** and **period** the widgets show, and **Columns**, **Rows** and - **Aspect** to match the TV. +1. Set **Columns** and **Rows** in the toolbar. Click the grid's background for the + screen's settings: the **Aspect** to match the TV under **Display**, and the + **projects**, **environment** and **period** the widgets show under **Data**. 2. Drag a widget type onto a free cell, or click it to add it in the first free spot. Drag a widget's edges to resize it. 3. Pick what a widget shows under **Shows**, such as a **Stat** with **Error rate** or a diff --git a/docs/screens.md b/docs/screens.md index 9bb377df..6b114e52 100644 --- a/docs/screens.md +++ b/docs/screens.md @@ -131,6 +131,8 @@ Click the grid's background, press Escape, or use **Screen settings** in the too the date**: the app's, the TV's own, or one picked. - **Time zone**: for the clock and the theme schedule. Empty means each TV uses its own. +![The Display tab](./screenshots/screen-settings-display.png) ![The Look tab](./screenshots/screen-settings-appearance.png) ![The Header tab](./screenshots/screen-settings-time.png) + ### Incident mode **Show an incident** previews the screen in trouble (an issue escalating, a check down, diff --git a/docs/screenshots/screen-designer-display.png b/docs/screenshots/screen-designer-display.png index 128437a2..82797855 100644 Binary files a/docs/screenshots/screen-designer-display.png and b/docs/screenshots/screen-designer-display.png differ diff --git a/docs/screenshots/screen-designer-drop.png b/docs/screenshots/screen-designer-drop.png index b5c7ccb4..a4f96bfd 100644 Binary files a/docs/screenshots/screen-designer-drop.png and b/docs/screenshots/screen-designer-drop.png differ diff --git a/docs/screenshots/screen-designer-incident.png b/docs/screenshots/screen-designer-incident.png index a6e515cb..aa85a85d 100644 Binary files a/docs/screenshots/screen-designer-incident.png and b/docs/screenshots/screen-designer-incident.png differ diff --git a/docs/screenshots/screen-designer-qr-style.png b/docs/screenshots/screen-designer-qr-style.png new file mode 100644 index 00000000..2b20271d Binary files /dev/null and b/docs/screenshots/screen-designer-qr-style.png differ diff --git a/docs/screenshots/screen-designer-rotation.png b/docs/screenshots/screen-designer-rotation.png index 88763732..827c2e36 100644 Binary files a/docs/screenshots/screen-designer-rotation.png and b/docs/screenshots/screen-designer-rotation.png differ diff --git a/docs/screenshots/screen-designer.png b/docs/screenshots/screen-designer.png index 3fde2662..0d4f6f14 100644 Binary files a/docs/screenshots/screen-designer.png and b/docs/screenshots/screen-designer.png differ diff --git a/docs/screenshots/screen-kiosk-light.png b/docs/screenshots/screen-kiosk-light.png index 1b6e15f6..05f9ae9e 100644 Binary files a/docs/screenshots/screen-kiosk-light.png and b/docs/screenshots/screen-kiosk-light.png differ diff --git a/docs/screenshots/screen-kiosk.png b/docs/screenshots/screen-kiosk.png index 2d6fb74a..fa9b7cb8 100644 Binary files a/docs/screenshots/screen-kiosk.png and b/docs/screenshots/screen-kiosk.png differ diff --git a/docs/screenshots/screen-settings-appearance.png b/docs/screenshots/screen-settings-appearance.png new file mode 100644 index 00000000..15b81022 Binary files /dev/null and b/docs/screenshots/screen-settings-appearance.png differ diff --git a/docs/screenshots/screen-settings-display.png b/docs/screenshots/screen-settings-display.png new file mode 100644 index 00000000..6d34e57e Binary files /dev/null and b/docs/screenshots/screen-settings-display.png differ diff --git a/docs/screenshots/screen-settings-time.png b/docs/screenshots/screen-settings-time.png new file mode 100644 index 00000000..827c2e36 Binary files /dev/null and b/docs/screenshots/screen-settings-time.png differ diff --git a/docs/screenshots/screens.png b/docs/screenshots/screens.png index 7dc3b2c9..a5e6aa45 100644 Binary files a/docs/screenshots/screens.png and b/docs/screenshots/screens.png differ diff --git a/docs/screenshots/widget-group.png b/docs/screenshots/widget-group.png new file mode 100644 index 00000000..4c070e66 Binary files /dev/null and b/docs/screenshots/widget-group.png differ diff --git a/docs/screenshots/widget-qr-colors.png b/docs/screenshots/widget-qr-colors.png new file mode 100644 index 00000000..dd3d8ab3 Binary files /dev/null and b/docs/screenshots/widget-qr-colors.png differ diff --git a/docs/screenshots/widget-qr-styled.png b/docs/screenshots/widget-qr-styled.png new file mode 100644 index 00000000..8d662d83 Binary files /dev/null and b/docs/screenshots/widget-qr-styled.png differ diff --git a/docs/screenshots/widget-qr-wifi.png b/docs/screenshots/widget-qr-wifi.png index dc3158d4..58db24cf 100644 Binary files a/docs/screenshots/widget-qr-wifi.png and b/docs/screenshots/widget-qr-wifi.png differ diff --git a/docs/teams.md b/docs/teams.md index 29ce66a1..f20f3802 100644 --- a/docs/teams.md +++ b/docs/teams.md @@ -6,11 +6,11 @@ the teams they are members of; system administrators see every team, see ## Roles -| Role | Can | -| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Owner | Everything an admin can, and transfer ownership. One per team. | -| Admin | Create projects, change their settings, manage members, invitations, API and MCP tokens, alerts and retention. Pair TVs, manage displays, share screens by link and reload a display. | -| Member | See every project of the team and work on its issues: status, assignee, labels, notes, watching. See, design and delete status screens, and reload the TVs showing one. | +| Role | Can | +| ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Owner | Everything an admin can, and transfer ownership. One per team. | +| Admin | Create projects, change their settings, move them to another team they are admin of, manage members, invitations, API and MCP tokens, alerts and retention. Pair TVs, manage displays, share screens by link and reload a display. | +| Member | See every project of the team and work on its issues: status, assignee, labels, notes, watching. See, design and delete status screens, and reload the TVs showing one. | ## The team page diff --git a/docs/widgets.md b/docs/widgets.md index f43ac553..e74b4b6f 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -537,6 +537,10 @@ Its style is in four sections, each with **Reset** back to Lumberjack's own: A style phones could not read reliably, such as colors too close together or filters too strong, is refused when saved. +![Medium dots, circle and heart eyes and mixed rotation](./screenshots/widget-qr-styled.png) ![Flowing modules and leaf eyes in navy on white, without the logo](./screenshots/widget-qr-colors.png) + +![A QR code's style in the designer](./screenshots/screen-designer-qr-style.png) + Share links show the code too, wifi password included. ## Image, video or page @@ -572,6 +576,8 @@ draws no card of its own. Groups nest. Drag a group by the space between its wid move it with all it holds; it cannot be made smaller than its widgets. Its title is off by default. +![A group titled Checkout holding a stat and a gauge](./screenshots/widget-group.png) + ## Empty cell Older screens may have an **Empty cell** widget. It still works but is no longer offered, diff --git a/scripts/docs-screenshots.mjs b/scripts/docs-screenshots.mjs index 7d5ec4e8..36f36067 100644 --- a/scripts/docs-screenshots.mjs +++ b/scripts/docs-screenshots.mjs @@ -73,9 +73,16 @@ const click = async (selector) => { await sleep(600); }; -// Webhook URLs carry ids and tokens; show only where they point. +// Webhook URLs carry ids and tokens; show only where they point. Only the app shows: a dev +// toolbar in a corner is hidden. const mask = () => page.evaluate(() => { + // A dev toolbar (Monocle's button) sits beside the body, on the page itself. + for (const el of document.documentElement.children) { + if (el !== document.head && el !== document.body) { + el.style.visibility = 'hidden'; + } + } const walker = document.createTreeWalker( document.body, NodeFilter.SHOW_TEXT, @@ -164,7 +171,7 @@ const pairCode = await page // It fills its display: 1920 px wide gives each cell the width an 8-column screen has on a // 1920 x 1080 TV, and rows as tall as that make a 1 x 1 tile square. -const galleryView = { width: 1920, height: 240 * 17 }; +const galleryView = { width: 1920, height: 240 * 19 }; // Health first: the seeded checks' agents report no more, and go stale within minutes. const galleryTiles = [ 'health-cards', @@ -192,6 +199,9 @@ const galleryTiles = [ 'countdown', 'countdown-calendar', 'qr-wifi', + 'qr-styled', + 'qr-colors', + 'group', 'media-image', 'message', 'message-ticker', @@ -386,6 +396,35 @@ const shots = { path: screen, before: () => click('[aria-label="Display settings"]'), }, + // The screen's settings, a shot per tab. + ...Object.fromEntries( + ['display', 'appearance', 'time'].map((tab) => [ + `screen-settings-${tab}`, + { + path: screen, + before: () => click(`#screen-tab-${tab}-button`), + element: `aside:has(#screen-tab-${tab}-button)`, + }, + ]), + ), + // A styled QR code of the gallery in the designer, its style sections open. + 'screen-designer-qr-style': { + path: gallery ? `${gallery}/edit` : null, + before: async () => { + await click('[data-widget="qr-styled"]'); + await page.evaluate(() => { + for (const details of document.querySelectorAll( + 'aside details', + )) { + details.open = /Logo and colors|Eyes/.test( + details.querySelector('summary')?.textContent ?? '', + ); + } + }); + await sleep(600); + }, + element: 'aside:has(details)', + }, 'screen-designer-incident': { path: screen, before: () => click('::-p-text(Show an incident)'), diff --git a/tests/Feature/Database/ShowcaseWidgetsSeederTest.php b/tests/Feature/Database/ShowcaseWidgetsSeederTest.php index 0453f5e4..7a96b369 100644 --- a/tests/Feature/Database/ShowcaseWidgetsSeederTest.php +++ b/tests/Feature/Database/ShowcaseWidgetsSeederTest.php @@ -6,6 +6,7 @@ use App\Domains\DataSources\Support\Ical; use App\Domains\Projects\Models\Project; use App\Domains\Screens\Models\Screen; +use App\Domains\Screens\Support\ScreenLayout; use App\Domains\Screens\Support\WidgetSchema; use App\Domains\Teams\Models\Team; use Carbon\CarbonImmutable; @@ -30,7 +31,7 @@ $projects = [(string) $this->project->uuid]; expect(collect($screen->widgets)->pluck('type')->unique()->sort()->values()->all()) - ->toBe(collect(WidgetSchema::types())->reject(fn (string $type): bool => in_array($type, ['empty', 'group'], true))->sort()->values()->all()); + ->toBe(collect(WidgetSchema::types())->reject(fn (string $type): bool => $type === 'empty')->sort()->values()->all()); foreach ($screen->widgets as $widget) { $validator = Validator::make(['widget' => $widget], WidgetSchema::rules('widget', $widget, $screen->cols, $screen->rows, $projects)); @@ -38,12 +39,7 @@ expect($validator->errors()->all())->toBe([], "{$widget['id']} does not validate"); } - $cells = collect($screen->widgets)->flatMap(fn (array $widget): array => collect(range($widget['x'], $widget['x'] + $widget['w'] - 1)) - ->crossJoin(range($widget['y'], $widget['y'] + $widget['h'] - 1)) - ->map(fn (array $cell): string => implode(',', $cell)) - ->all()); - - expect($cells->duplicates()->all())->toBe([], 'widgets overlap'); + expect(ScreenLayout::overlapping($screen->widgets))->toBe([], 'widgets overlap'); }); it('gives the calendar widgets a feed with an event on now and more to come', function () {