This commit is contained in:
ivarsbariss
2026-02-27 14:57:15 +01:00
parent 28bb0e65e5
commit 7e0e2e3086
23 changed files with 1630 additions and 0 deletions

View File

@@ -57,3 +57,41 @@ Row 16 └───────────────────────
### Dynamic Height
Widgets with `"dynamicHeight": "AUTO_HEIGHT"` adjust height based on content. The `bottomRow` serves as an initial guide, and `originalTopRow`/`originalBottomRow` store the original placement values.
---
## Adding a New Page
New pages are added via AI agent (Cursor). The agent follows the skills in `.cursor/skills/` to clone the template, create the query, wire the table, add navigation buttons to all pages, and register the page in `application.json`.
### What You Need
1. **Page name** — Full display name in the format `<Section> - <Label>` (e.g. `Pending POs - ALx Pending`).
2. **Section** — Which navigation section the page belongs to (e.g. `Pending POs`, `Sales`). If the section already exists, the button is appended; otherwise a new section is created first.
3. **SQL query** — The exact query the page's table should run.
### Prompt Format
Tell the agent which section, what name, and what query. One sentence is enough:
> Add a new page under the Pending POs section "Pending POs - ALx Pending" with `select * from mpe.get_prototype_po_dashboard_data(array['25502', '27985']::text[])` query
### What the Agent Does
| Step | Detail |
|------|--------|
| Clone template | Copies `Sales - Capacity Planning` page structure (page JSON, widgets, Container1 nav) |
| Create query | Adds `queries/<query_name>/` with `.txt` (raw SQL) and `metadata.json` |
| Wire table | Sets `Table1.tableData` to `{{<query_name>.data}}` |
| Set heading | Updates `Heading.json` text to the page name |
| Generate gitSyncIds | Creates unique `<24-char-hex>_<uuid>` IDs for the page JSON and query metadata (required for Appsmith git sync) |
| Register page | Adds entry to `application.json` `pages` array |
| Add nav button | Creates `Button2Copy<N>.json` on **every** page — highlighted on its own page, white on all others |
### Verifying
After the agent finishes, run `git status` to confirm only the expected files were added/changed:
- `application.json` — one new page entry
- `pages/<New Page>/` — full page directory (page JSON, query, widgets)
- `pages/<Every Other Page>/widgets/Container1/Button2Copy<N>.json` — new nav button on each existing page