Skip to content

Commit 45437d4

Browse files
committed
Fix showModal/showToast API in AI helper files; link docs from README
The AI helper files (CLAUDE.md, AGENTS.md, .cursor/rules/project.mdc) previously documented showModal with { text, onClick } action keys and showToast with an object argument. The actual API is { label, action } and showToast(message, opts) — corrected. Also added a Documentation section to the project README pointing to the new docs/ tree.
1 parent 4daf89c commit 45437d4

4 files changed

Lines changed: 34 additions & 9 deletions

File tree

.cursor/rules/project.mdc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ showModal({
9393
title: 'Delete project?',
9494
body: 'This cannot be undone.',
9595
actions: [
96-
{ text: 'Cancel', variant: 'ghost' },
97-
{ text: 'Delete', variant: 'danger', onClick: () => { /* … */ } }
96+
{ label: 'Cancel', variant: 'ghost' },
97+
{ label: 'Delete', variant: 'danger', action: () => { /* … */ } }
9898
]
9999
});
100100

101101
import { showToast } from './v4/toast.js';
102-
showToast({ text: 'Saved', variant: 'success' });
102+
showToast('Saved', { variant: 'success' });
103103
```
104104

105105
## Commands

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ showModal({
121121
title: 'Delete project?',
122122
body: 'This cannot be undone.',
123123
actions: [
124-
{ text: 'Cancel', variant: 'ghost' },
125-
{ text: 'Delete', variant: 'danger', onClick: () => { /**/ } }
124+
{ label: 'Cancel', variant: 'ghost' },
125+
{ label: 'Delete', variant: 'danger', action: () => { /**/ } }
126126
]
127127
});
128128

129129
import { showToast } from './v4/toast.js';
130-
showToast({ text: 'Saved', variant: 'success' });
130+
showToast('Saved', { variant: 'success' });
131131
```
132132

133133
### Add a page-local module

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,12 @@ Registered only in `import.meta.env.PROD` (skips dev so HMR isn't fighting cache
191191
```js
192192
import { showModal } from './v4/modal.js';
193193
showModal({ title: 'Delete project?', body: 'This can\'t be undone.', actions: [
194-
{ text: 'Cancel', variant: 'ghost' },
195-
{ text: 'Delete', variant: 'danger', onClick: () => { /**/ } }
194+
{ label: 'Cancel', variant: 'ghost' },
195+
{ label: 'Delete', variant: 'danger', action: () => { /**/ } }
196196
]});
197197

198198
import { showToast } from './v4/toast.js';
199-
showToast({ text: 'Saved', variant: 'success' });
199+
showToast('Saved', { variant: 'success' });
200200
```
201201

202202
### Wire up keyboard shortcuts

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,31 @@ Plus: 10 SCSS partials · build-time + runtime shell (no FOUC) · `data-page` at
8383

8484
3 production deps, 9 dev deps, **~178 MB `node_modules`** (was ~600 MB on the old Gentelella).
8585

86+
## Documentation
87+
88+
Comprehensive docs in [`docs/`](docs/) covering every part of v4:
89+
90+
| Topic | Doc |
91+
| --- | --- |
92+
| Setup, build, deploy | [getting-started](docs/getting-started.md) |
93+
| Directory layout | [project-structure](docs/project-structure.md) |
94+
| Shell injection + lazy modules | [architecture](docs/architecture.md) |
95+
| Tokens, dark mode, theme generator | [theming](docs/theming.md) |
96+
| Adding pages + sidebar entries | [pages](docs/pages.md) |
97+
| Buttons, cards, badges, grids | [components](docs/components.md) |
98+
| ECharts factories | [charts](docs/charts.md) |
99+
| DataTables, row selection, CSV | [tables](docs/tables.md) |
100+
| Inputs, validation, custom controls | [forms](docs/forms.md) |
101+
| `showModal`, `showToast`, `openMenu` | [overlays](docs/overlays.md) |
102+
| ⌘K | [command-palette](docs/command-palette.md) |
103+
| Inbox / kanban / calendar / files / settings | [app-modules](docs/app-modules.md) |
104+
| Service worker, manifest, offline | [pwa](docs/pwa.md) |
105+
| Hosts, subpath, cache headers | [deployment](docs/deployment.md) |
106+
| IntelliSense via `.d.ts` | [typescript](docs/typescript.md) |
107+
| Seed vs HTTP backend (`?api=1`) | [data-adapter](docs/data-adapter.md) |
108+
| Coming from old Gentelella | [migration-v2](docs/migration-v2.md) |
109+
| Common questions | [FAQ](docs/faq.md) |
110+
86111
## Quick start
87112

88113
```bash

0 commit comments

Comments
 (0)