Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
f15bf83
feat: add queue, schedule and workers tasks and a Taskfile sync comma…
roble Nov 5, 2026
76d55af
feat: create the E2E env file on install (sc-1108)
roble Nov 5, 2026
5b9a1cc
chore: forbid nested ternaries in both stacks' ESLint config
roble Nov 6, 2026
64f463b
feat: throw when two sources declare the same capability in a group (…
roble Nov 6, 2026
3a32e7c
feat: dashboard period filter, Period and TrendStat for widgets, and …
roble Nov 6, 2026
6ed4b00
fix: keep every month in the 12-month period, warn when the E2E env i…
roble Nov 6, 2026
472efcf
Merge branch 'main' of https://github.com/saucebase-dev/core into dev…
roble Nov 6, 2026
8b92522
Merge origin/main into dev
roble Nov 8, 2026
680b537
chore: alias the dev branch as 2.13.x-dev
roble Nov 8, 2026
09239d5
Merge branch 'renanroble-dev-branch-alias' into dev
roble Nov 8, 2026
33c8062
feat: named states replace --demo in modules:seed
roble Nov 10, 2026
2759c3d
Merge branch 'renanroble-named-states' into dev
roble Nov 10, 2026
d4e4765
feat: set up a template after the modules it requires
roble Nov 10, 2026
763a45f
Merge branch 'renanroble-template-type' into dev
roble Nov 10, 2026
fa3ca8d
feat: dashboard widgets fill gaps; drop the Discord links from the ap…
roble Nov 10, 2026
8863ddd
Merge branch 'renanroble-dashboard-dense' into dev
roble Nov 10, 2026
c68c13c
feat: template install and capture, module options
roble Nov 13, 2026
ea39de6
Merge branch 'renanroble-template-install' into dev
roble Nov 13, 2026
a3bac51
feat: install settings, set at install by templates, flags or prompts
roble Nov 13, 2026
c5bd04a
Merge branch 'renanroble-install-settings' into dev
roble Nov 13, 2026
03c80e5
feat: one configure key and --set for templates
roble Nov 13, 2026
c773758
Merge branch 'renanroble-configure' into dev
roble Nov 13, 2026
a3337b8
feat: template workspaces resolve @/ from the app first
roble Nov 13, 2026
b6cb20a
feat: select and table components in the Vue starter UI
roble Nov 13, 2026
a8e8d91
fix: every reka popup opens above an Inertia modal
roble Nov 13, 2026
dbd85d1
Merge branch 'renanroble-app-first-ui' into dev
roble Nov 13, 2026
57f567a
fix: popups opened from a modal keep focus and Escape
roble Nov 14, 2026
9b624ba
feat: combobox in the Vue starter UI
roble Nov 14, 2026
cadec30
fix: the same space above a page's title as below it
roble Nov 14, 2026
bcae913
Merge branch 'renanroble-qa-fixes' into dev
roble Nov 14, 2026
bc2f9ca
feat: a template installs clean; --state seeds its demo
roble Nov 14, 2026
0467bdd
Merge branch 'renanroble-template-demo-opt-in' into dev
roble Nov 14, 2026
8eeaf80
feat: a demo without DEMO_PASSWORD gets a random one, saved in .env
roble Nov 14, 2026
3242bfe
docs: a skill for building Saucebase templates
roble Nov 14, 2026
f03b08d
Merge branch 'renanroble-generated-demo-password' into dev
roble Nov 14, 2026
978f691
Merge branch 'renanroble-template-skill' into dev
roble Nov 14, 2026
44cc972
feat: build a template in any app, by any vendor
roble Nov 14, 2026
1141366
Merge branch 'renanroble-template-from-scratch' into dev
roble Nov 14, 2026
cfee9b1
fix: a recipe's dotfiles reach the module it makes
roble Nov 15, 2026
d9a0f2e
Merge branch 'renanroble-recipe-dotfiles' into dev
roble Nov 15, 2026
1911bb7
fix: a recipe's CI names the module by its folder
roble Nov 15, 2026
05573aa
Merge branch 'renanroble-recipe-ci-name' into dev
roble Nov 15, 2026
1d1439b
docs: what building the notes template taught the template skill
roble Nov 15, 2026
20dd450
Merge branch 'renanroble-template-skill-lessons' into dev
roble Nov 15, 2026
72353f2
fix: put composer files back when a package install fails
roble Nov 15, 2026
d1e25b0
chore: require module-installer 3.3 for templates, alias dev as 3.0.x…
roble Nov 15, 2026
a0d3244
ci: install a template's stubs in the test app, as a customer's app g…
roble Nov 15, 2026
b7b8925
feat!: modules:seed and module-install take --state, not --demo
roble Nov 15, 2026
ee4923f
fix: React popups opened from a modal show above it
roble Nov 15, 2026
6bbd5bb
fix: an override's relative imports find files beside it in the app
roble Nov 15, 2026
b07f886
fix: each post-install command gets only the answers it takes
roble Nov 15, 2026
60a32c4
chore: leave the select, table and combobox shadcn folders out of Sonar
roble Nov 15, 2026
7f79ac4
Merge remote-tracking branch 'origin/main' into dev
roble Nov 15, 2026
34bc51a
fix: module-install seeds a state in its own process, after setup
roble Nov 15, 2026
b7fe7c7
chore: alias dev as 3.1.x-dev, past the v3.0.0 release
roble Nov 15, 2026
5a8da44
fix: a failed package install leaves the app as it was, bootable
roble Nov 16, 2026
d80b343
chore: alias dev as 3.x-dev, so it never falls behind a minor release
roble Nov 16, 2026
ca14dc2
feat: seeders declare their demo accounts (#[DemoAccount])
roble Nov 16, 2026
5f60188
feat: AssertsDemoAccounts checks a seeder creates the accounts it dec…
roble Nov 16, 2026
3eb5184
chore: PHPStan skips AssertsDemoAccounts, used only by modules' tests
roble Nov 16, 2026
adeb2d9
feat: add shadcn Empty; EmptyState builds on it
roble Nov 18, 2026
7950a69
Merge branch 'renanroble-empty' into dev
roble Nov 18, 2026
3aee45a
feat: React select and table; modals and capture work for React templ…
roble Nov 18, 2026
643358f
Merge branch 'renanroble-react-select-table' into dev
roble Nov 18, 2026
a445e99
fix: type-checking skips template stubs
roble Nov 18, 2026
d182b2f
Merge branch 'renanroble-tsconfig-stubs' into dev
roble Nov 18, 2026
6e494b5
feat: template-capture --restore puts a template's files back
roble Nov 18, 2026
850d066
fix: React sidebar marks links that open in a new tab
roble Nov 18, 2026
c93dab6
Merge branch 'renanroble-template-restore' into dev
roble Nov 18, 2026
6f5ada4
Merge branch 'renanroble-react-nav-external' into dev
roble Nov 18, 2026
fbe1999
feat: RegistrationInvite lets an invited address sign up while sign-u…
roble Nov 19, 2026
33db225
Merge branch 'renanroble-night-2026-11-18' into dev
roble Nov 19, 2026
cc8afe7
fix: navigation loads on every instance, so Octane and queue workers …
roble Nov 19, 2026
9b5fd9e
Merge branch 'renanroble-bugfixes-2026-11-19' into dev
roble Nov 19, 2026
ff31261
fix: navigation marks a site-root item without a deprecation warning
roble Nov 20, 2026
fc3e371
Merge branch 'renanroble-nav-root-url' into dev
roble Nov 20, 2026
3220cb0
ci: lint with the project's own Pint
roble Nov 20, 2026
3a95728
Merge branch 'renanroble-ci-own-pint' into dev
roble Nov 20, 2026
1a3af2f
fix: an open collapsible no longer swallows a modal's Escape
roble Nov 20, 2026
0b6c59e
fix: template-capture --restore touches only the stack in use
roble Nov 20, 2026
204b956
fix: a failed install reinstalls from the restored lock
roble Nov 20, 2026
894be32
Merge branch 'renanroble-coderabbit-42' into dev
roble Nov 20, 2026
ca8028e
fix: React overlays over a modal keep their focus handlers and tooltips
roble Nov 20, 2026
f388681
fix: template-capture --restore checks every stub before writing
roble Nov 20, 2026
deed3e8
fix: a failed reinstall no longer claims nothing changed
roble Nov 20, 2026
22366f2
Merge branch 'renanroble-coderabbit-42' into dev
roble Nov 20, 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
14 changes: 11 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,18 @@ jobs:
- uses: actions/checkout@v7
with:
ref: ${{ github.head_ref }}
- name: "laravel-pint"
uses: aglipanci/laravel-pint-action@36de00d5f5a8a4e12d443e01671daa12a18f4c79 # 2.6
- name: Setup PHP
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2
with:
configPath: './pint.json'
php-version: '8.4'
coverage: none

- name: Install dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0

# The project's own Pint (composer.lock), so CI formats exactly as a local run does.
- name: Pint
run: vendor/bin/pint --config pint.json

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@d0b01107b5db882071f96de5dd4b54961ea93f4c # v7.2.1
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"saucebase",
"saas"
],
"version": "v3.0.0",
"version": "v3.1.0",
"license": "MIT",
"authors": [
{
Expand Down Expand Up @@ -62,7 +62,7 @@
},
"extra": {
"branch-alias": {
"dev-dev": "3.0.x-dev"
"dev-dev": "3.x-dev"
},
"laravel": {
"providers": [
Expand Down
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ parameters:
# analysed.
- identifier: trait.unused
path: src/Filament/ModulePlugin.php
# Same for the test helper modules and templates use in their own tests.
- identifier: trait.unused
path: src/Testing/AssertsDemoAccounts.php
6 changes: 6 additions & 0 deletions resources/boost/skills/saucebase-module-development/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ no module provides fails. In production it asks first; `--force` (also on `sauce
same kind; modules that aren't installed are ignored. A module with an admin area creates its `manage {module}` permission
there (see `saucebase-filament-development`); state seeders never hold anything an install needs.

A state seeder that creates accounts declares them on its class, one attribute each:
`#[DemoAccount('owner@saucebase.dev', 'owns Acme and Globex', featured: true)]`
(`Saucebase\Core\Attributes\DemoAccount`). `php artisan modules:demo-accounts --state=showcase` lists them
(`--json` for the installer); `featured` ones are named where people start, after `modules:seed --state` and in
the installer's summary. Feature only the one or two to sign in with first. They all use `DEMO_PASSWORD`.

## Patches

A module changes application files it doesn't own (the `User` model, `routes/web.php`) with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The recipe writes it: `type: saucebase-template`, `require` = core and every Sau

- A module added later: `saucebase:module-install <module>`, then add it to `require` by hand.
- `extra.saucebase.configure` (optional): module settings for the install, e.g. `{"auth": {"registration_enabled": true}}`.
- `extra.saucebase.demo_account` (optional): the email the demo signs in with; the installer prints it after `--demo`.
- The demo's account goes on `Default{Template}DatabaseSeeder`, not here: `#[DemoAccount('notes@saucebase.dev', 'your notes and lists', featured: true)]`. The installer names it after `--demo` (see `saucebase-module-development`, Seeders).
- Keep the template's frontend in `resources/js/{stack}/`. The installer flattens it into apps of that stack and refuses a module without the folder.

## Stubs: replacing app files
Expand Down
190 changes: 188 additions & 2 deletions resources/js/lib/modal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ class FakeKeyboardEvent extends Event {

const layerAbove = { closest: () => null };

/** reka marks its layers; Radix (React) doesn't, so its open layers are found by shadcn's slot. */
let layerSelector = '[data-dismissable-layer]';

beforeEach(() => {
const document = Object.assign(new EventTarget(), {
documentElement: new EventTarget(),
querySelector: (selector: string) =>
selector === '.im-modal-wrapper' ? {} : null,
querySelectorAll: () => [layerAbove],
querySelectorAll: (selector: string) =>
selector.includes(layerSelector) ? [layerAbove] : [],
});

Object.assign(globalThis, {
Expand All @@ -30,11 +35,125 @@ beforeEach(() => {
});

afterEach(() => {
for (const key of ['document', 'window', 'KeyboardEvent']) {
for (const key of ['document', 'window', 'KeyboardEvent', 'Element']) {
Reflect.deleteProperty(globalThis, key);
}
});

/** Just enough of CSS attribute selectors: `[a]`, `[a="v"]`, `[a$="v"]` and `:not(...)` of those. */
function matches(element: Record<string, string>, selector: string): boolean {
const test = (
attribute: string,
operator?: string,
value?: string,
): boolean => {
const actual = element[attribute];
if (operator === undefined) return actual !== undefined;
if (actual === undefined) return false;

return operator === '$=' ? actual.endsWith(value!) : actual === value;
};

const parts = [
...selector.matchAll(/(:not\()?\[([\w-]+)(?:(\$?=)"([^"]*)")?\]\)?/g),
];

return (
parts.length > 0 &&
parts.every(
([, not, attribute, operator, value]) =>
Boolean(not) !== test(attribute, operator, value),
)
);
}

/** A node in a tiny page: listeners by phase, and an event's way down and back up. */
class FakeNode {
listeners: { listener: (event: object) => void; capture: boolean }[] = [];

constructor(
public parent: FakeNode | null = null,
public attributes: Record<string, string> = {},
) {}

addEventListener(
_type: string,
listener: (event: object) => void,
capture = false,
): void {
this.listeners.push({ listener, capture });
}

contains(other: FakeNode | null): boolean {
for (let node = other; node; node = node.parent) {
if (node === this) return true;
}

return false;
}

closest(selector: string): FakeNode | null {
for (let node: FakeNode | null = this; node; node = node.parent) {
const attributes = node.attributes;
if (
selector
.split(',')
.some((part) => matches(attributes, part.trim()))
) {
return node;
}
}

return null;
}
}

/** document > html > body > the modal; React listens on body, the portals' container. */
function page(): { document: FakeNode; body: FakeNode } {
const document = new FakeNode();
const html = new FakeNode(document);
const body = new FakeNode(html);
const modal = new FakeNode(body, { class: 'im-modal-wrapper' });

Object.assign(document, {
documentElement: html,
querySelector: (selector: string) =>
selector === '.im-modal-wrapper' ? modal : null,
querySelectorAll: () => [],
});
Object.assign(globalThis, { document, Element: FakeNode });
initializeModals(() => {});

return { document, body };
}

/** focusin down from the document (capture), then back up (bubble), until stopped. */
function focus(target: FakeNode): void {
const path: FakeNode[] = [];
for (let node: FakeNode | null = target; node; node = node.parent) {
path.push(node);
}

let stopped = false;
const event = {
type: 'focusin',
target,
stopPropagation: () => (stopped = true),
};

for (const [nodes, capture] of [
[[...path].reverse(), true],
[path, false],
] as const) {
for (const node of nodes) {
if (stopped) return;
node.listeners
.filter((entry) => entry.capture === capture)
.forEach((entry) => entry.listener(event));
}
}
}

function pressEscape(): Event {
const event = new FakeKeyboardEvent('keydown', {
key: 'Escape',
Expand All @@ -56,10 +175,77 @@ describe('Escape over a modal', () => {
expect(layerHeardIt).toBe(true);
});

/**
* React's menus and selects (Radix) carry no layer mark, only shadcn's open content slot.
* An open collapsible (the sidebar's nav groups) carries one too, but is no layer: Escape
* must still reach the modal.
*/
it('goes to a Radix overlay above, not to any open content slot', () => {
const heard = (slot: string, state = 'open'): boolean => {
const element = { 'data-slot': slot, 'data-state': state };
Object.assign(document, {
querySelectorAll: (selector: string) =>
selector
.split(',')
.some((part) => matches(element, part.trim()))
? [layerAbove]
: [],
});
let layerHeardIt = false;
const listener = () => (layerHeardIt = true);
window.addEventListener('keydown', listener);
pressEscape();
window.removeEventListener('keydown', listener);

return layerHeardIt;
};

expect(heard('collapsible-content')).toBe(false);
expect(heard('sidebar-group-content')).toBe(false);
expect(heard('dropdown-menu-content')).toBe(true);
expect(heard('select-content')).toBe(true);
expect(heard('dialog-content')).toBe(true);
// Radix's tooltip is never "open", only delayed or instant.
expect(heard('tooltip-content', 'delayed-open')).toBe(true);
expect(heard('dialog-content', 'closed')).toBe(false);
});

/** A layer may refuse Escape (mid-submit, say); the refusal must hold. */
it('keeps a refusal from the layer above', () => {
window.addEventListener('keydown', (event) => event.preventDefault());

expect(pressEscape().defaultPrevented).toBe(true);
});
});

describe('Focus while a modal is open', () => {
/** React reads onFocus from focusin on its containers; the traps listen on document. */
it('reaches an overlay above, but not the modal trap', () => {
const { document, body } = page();
const input = new FakeNode(
new FakeNode(body, { 'data-slot': 'popover-content' }),
);
const heard: string[] = [];
body.addEventListener('focusin', () => heard.push('react'));
document.addEventListener('focusin', () => heard.push('trap'));

focus(input);

expect(heard).toEqual(['react']);
});

/** Page content behind the modal is no overlay: the trap pulls focus back from it. */
it('is left to the trap in page content behind the modal', () => {
const { document, body } = page();
const link = new FakeNode(
new FakeNode(body, { 'data-slot': 'card-content' }),
);
const heard: string[] = [];
body.addEventListener('focusin', () => heard.push('react'));
document.addEventListener('focusin', () => heard.push('trap'));

focus(link);

expect(heard).toEqual(['react', 'trap']);
});
});
Loading