Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 12 additions & 3 deletions database/seeders/ShowcaseWidgetsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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';

Expand Down Expand Up @@ -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<array<string, mixed>>
*/
Expand Down Expand Up @@ -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']),
];
}
}
6 changes: 3 additions & 3 deletions docs/guides/status-tv.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/screens.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Binary file modified docs/screenshots/screen-designer-display.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screen-designer-drop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screen-designer-incident.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/screen-designer-qr-style.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screen-designer-rotation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screen-designer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screen-kiosk-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screen-kiosk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/screen-settings-appearance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/screen-settings-display.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/screen-settings-time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/widget-group.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/widget-qr-colors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/widget-qr-styled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/widget-qr-wifi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions docs/teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions docs/widgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
43 changes: 41 additions & 2 deletions scripts/docs-screenshots.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -192,6 +199,9 @@ const galleryTiles = [
'countdown',
'countdown-calendar',
'qr-wifi',
'qr-styled',
'qr-colors',
'group',
'media-image',
'message',
'message-ticker',
Expand Down Expand Up @@ -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)'),
Expand Down
10 changes: 3 additions & 7 deletions tests/Feature/Database/ShowcaseWidgetsSeederTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,20 +31,15 @@
$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));

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 () {
Expand Down
Loading