Skip to content

Commit 8f6b837

Browse files
committed
[canvas-apps] Sync prompts from PA-Client
1 parent 3303f75 commit 8f6b837

12 files changed

Lines changed: 193 additions & 91 deletions

File tree

plugins/canvas-apps/agents/canvas-app-planner.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Read:
6060

6161
- `${PLUGIN_ROOT}/references/YamlSyntax.md` — file structure, syntax rules, parse-error triage
6262
- `${PLUGIN_ROOT}/references/ControlGuide.md` — control selection, per-control properties, enums
63-
- `${PLUGIN_ROOT}/references/LayoutGuide.md` — responsive layout, scrolling, colour contrast
63+
- `${PLUGIN_ROOT}/references/LayoutGuide.md` — responsive layout, scrolling, color contrast
6464
- `${PLUGIN_ROOT}/references/PowerFxGuide.md` — state, events, named formulas, mock data
6565
- `${PLUGIN_ROOT}/references/DesignGuide.md` — aesthetic direction and design process
6666
- `${PLUGIN_ROOT}/references/PlanTemplates.md` — the exact shape of every artifact you write
@@ -89,6 +89,13 @@ ManualLayout.
8989
recorded, because the builder cannot look it up.
9090
5. Call API and schema detail tools only for resources involved in the edit.
9191

92+
### Component refresh checkpoint
93+
94+
Immediately before auditing properties, re-run `describe_control` for
95+
every Canvas or Code Component used by the plan to ensure any imported or updated components made in Studio are available.
96+
Especially if a successful compile applied local component-definition changes, since the previous lookup.
97+
Treat earlier component responses as stale; builders cannot refresh them.
98+
9299
## 3. Audit Control Properties
93100

94101
Before writing plans:
@@ -151,7 +158,7 @@ clear navigation is cheaper than a screen that no builder can write correctly in
151158
and no user can scan. Prefer splitting by task (entry vs. history vs. analysis) rather
152159
than by control count.
153160

154-
## 5. Specify the Narrow-Width Behaviour
161+
## 5. Specify the Narrow-Width Behavior
155162

156163
Builders implement exactly what the brief specifies. If the brief describes only the
157164
desktop composition, the screen will break on a phone — this is the most frequently
@@ -168,7 +175,7 @@ For every screen brief, state explicitly:
168175
- That the root container scrolls (`LayoutOverflowY: =LayoutOverflow.Scroll`).
169176
- That the screen-level `Children:` list contains only that root, with every visible
170177
section nested under the root's `Children:` list.
171-
- The foreground colour for text on every coloured surface, so nothing renders
178+
- The foreground color for text on every colored surface, so nothing renders
172179
dark-on-dark.
173180
- A width or `LayoutMinWidth` for status badges and KPI values that fits the longest value
174181
they can display.
@@ -244,6 +251,12 @@ Do not edit any `.pa.yaml` file. Put all required app-level edits in the plan in
244251

245252
If a group is empty, write `None` for it.
246253

254+
### All modes
255+
256+
Put requested screen or component-definition ordering in `## Editor State Changes` as
257+
the exact final `ScreensOrder` and `ComponentDefinitionsOrder` lists. Write `None` when
258+
the current Studio order should remain unchanged.
259+
247260
## 8. Write Progressive Plan Artifacts
248261

249262
Follow `${PLUGIN_ROOT}/references/PlanTemplates.md`.
@@ -257,6 +270,7 @@ Write only orchestration information:
257270
- Compact discovery summary
258271
- Dispatch table
259272
- EDIT-mode App changes
273+
- Editor state changes
260274

261275
The dispatch table columns are:
262276

@@ -354,7 +368,7 @@ App compile: [Clean / diagnostics remaining, with detail]
354368
- Do not edit existing `.pa.yaml` files in EDIT mode.
355369
- Call `compile_canvas` only to validate CREATE-mode `App.pa.yaml`. Do not use it to
356370
chase screen-file diagnostics; the orchestrator owns full-app validation.
357-
- Do not edit `[working directory]/_EditorState.pa.yaml`.
371+
- Do not edit `[working directory]/_EditorState.pa.yaml`; record ordering work in `## Editor State Changes` for the top-level orchestrator.
358372
- Do not embed all discovery output in the index or shared plan.
359373
- Every screen brief must be self-sufficient when read with the shared plan.
360374
- Never assign two screens the same control name prefix.

plugins/canvas-apps/agents/canvas-screen-builder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ incomplete, and the orchestrator will send the screen back.
165165
## Constraints
166166

167167
- Modify exactly one screen file.
168-
- Never edit `[working directory]/App.pa.yaml` or `[working directory]/_EditorState.pa.yaml`.
168+
- Do not edit `[working directory]/App.pa.yaml` or `[working directory]/_EditorState.pa.yaml`; the top-level orchestrator owns app-level and cross-file ordering changes.
169169
- Never substitute a filename, YAML key, or control name prefix.
170170
- Never use a property absent from that control's definition.
171171
- Never write a version suffix on a `Control:` value.

plugins/canvas-apps/references/ControlGuide.md

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Choosing a control type, and writing properties and enum values that the compile
66
## Contents
77

88
- Discover before you choose
9+
- Interpret property defaults and requirements
910
- Layout containers
1011
- Data display
1112
- Selection controls — `ItemDisplayText` is a per-item formula
@@ -14,7 +15,7 @@ Choosing a control type, and writing properties and enum values that the compile
1415
- Enum type names
1516
- Enum member values
1617
- Option set values
17-
- Colour and button-state patterns
18+
- Color and button-state patterns
1819
- Timer lifecycle
1920
- Read-only ancestors
2021
- Cross-screen navigation
@@ -27,7 +28,26 @@ Choosing a control type, and writing properties and enum values that the compile
2728
**⚠️ Required — not optional:** run `list_controls` before planning your layout. Controls
2829
you don't know exist can't influence your design, and the catalog includes high-level
2930
controls (`ModernTabList`, `ModernCard`, and others) that are easy to miss and expensive
30-
to reinvent with primitives. Then run `describe_control` on every type you plan to use.
31+
to reinvent with primitives.
32+
33+
The resulting list will also specify if any Code Components or Canvas Components are available as control instances in the app. The result identifies the `ComponentName` to pass to `describe_control`.
34+
35+
Run `describe_control` on every type you plan to use.
36+
37+
## Interpret property defaults and requirements
38+
39+
The `Default` shown for a property is the value the property takes when it is omitted from the YAML.
40+
Properties marked `Required: true` must be provided, even when no default is shown.
41+
Omit other properties to accept their default.
42+
43+
### Refresh Canvas and Code Component descriptions
44+
45+
`describe_control` results for Canvas and Code Components are snapshots of the current
46+
Studio document, not durable catalog entries. Re-run `describe_control` for the returned
47+
`ComponentName` after a successful `compile_canvas` applies changes to a local component
48+
definition or its custom properties. Do not reuse component descriptions from an earlier
49+
turn after any of those events. Refresh immediately before recording component properties
50+
in a plan or editing a component instance.
3151

3252
## Layout containers
3353

@@ -283,18 +303,18 @@ or starts with a number:
283303
Visible: =ThisItem.Status = 'Status (Assignments)'.Active
284304
```
285305

286-
## Colour and button-state patterns
306+
## Color and button-state patterns
287307

288308
```yaml
289-
# Colour constants
309+
# Color constants
290310
Fill: =Color.White
291311
BasePaletteColor: =Color.Blue
292312
293313
# RGBA
294314
Fill: =RGBA(240, 240, 240, 1)
295315
FontColor: =RGBA(0, 0, 0, 1)
296316
297-
# Conditional colour
317+
# Conditional color
298318
BasePaletteColor: =If(isActive, Color.Blue, Color.Gray)
299319
```
300320

@@ -303,18 +323,6 @@ and `Transparent` can remain light even when `Fill` is set. Pair those appearanc
303323
dark `Color`, or switch to `Primary` and set `BasePaletteColor` for a dark surface. Do not
304324
assume `Fill` overrides the variant.
305325

306-
```yaml
307-
Properties:
308-
DisplayMode: =If(isDisabled, DisplayMode.Disabled, DisplayMode.Edit)
309-
Text: =buttonText
310-
OnSelect: |-
311-
=If(condition,
312-
false, # Guard clause - do nothing
313-
Set(variable, value); # Execute logic
314-
Set(anotherVar, anotherValue)
315-
)
316-
```
317-
318326
## Timer lifecycle
319327

320328
An automatic Timer needs a start edge after the control exists. If `AutoStart: =false`
@@ -361,13 +369,13 @@ replace `Badge.Content`; omitting Content can render placeholder text such as `A
361369

362370
**Styling:**
363371

364-
- `Fill` — background colour (absent on `Badge` and `Progress`)
365-
- `Color` — text colour on the modern React controls; `Badge` spells it `FontColor`
366-
- `BasePaletteColor` — theme colour for `Badge`, `Progress`, and the modern inputs
372+
- `Fill` — background color (absent on `Badge` and `Progress`)
373+
- `Color` — text color on the modern React controls; `Badge` spells it `FontColor`
374+
- `BasePaletteColor` — theme color for `Badge`, `Progress`, and the modern inputs
367375
- `Size` — font size on the modern React controls; `Badge` spells it `FontSize`
368376
- `FontWeight` — Bold, Semibold, Normal, Lighter
369377

370-
**Behaviour:**
378+
**Behavior:**
371379

372380
- `DisplayMode` — Edit, View, Disabled
373381
- `Visible` — boolean visibility
@@ -382,7 +390,7 @@ replace `Badge.Content`; omitting Content can render placeholder text such as `A
382390
- `LayoutGap` — spacing between items
383391
- `LayoutOverflowY` — vertical overflow (`Scroll` for scrollable containers)
384392
- `FillPortions` — proportional sizing
385-
- `PaddingTop/Bottom/Left/Right` — container padding
393+
- `PaddingTop`/`Bottom`/`Left`/`Right` — container padding
386394

387395
## Troubleshooting
388396

plugins/canvas-apps/references/CreateWorkflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Read:
88

99
- `${PLUGIN_ROOT}/references/YamlSyntax.md` — file structure, syntax rules, parse-error triage
1010
- `${PLUGIN_ROOT}/references/ControlGuide.md` — control selection, per-control properties, enums
11-
- `${PLUGIN_ROOT}/references/LayoutGuide.md` — responsive layout, scrolling, colour contrast
11+
- `${PLUGIN_ROOT}/references/LayoutGuide.md` — responsive layout, scrolling, color contrast
1212
- `${PLUGIN_ROOT}/references/PowerFxGuide.md` — state, events, named formulas, mock data
1313
- `${PLUGIN_ROOT}/references/DesignGuide.md` — aesthetic direction and design process
1414

plugins/canvas-apps/references/DesignGuide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ the real user experience.
6262
- **Font Weight**: Use `ModernText` for headlines with `FontWeight: =FontWeight.Bold` and a large font size. Use `ModernText` with `FontWeight: =FontWeight.Normal` for body content.
6363
- **Size Contrast**: Create dramatic hierarchy with size differences. Headers at 24-32, subheaders at 18-20, body at 14-16.
6464
- **Alignment as Statement**: Mix `Align.Left`, `Align.Center`, `Align.Right` intentionally. Centered text for impact, left-aligned for readability.
65-
- **Font Properties**: Leverage `Size`, `FontWeight`, `Align`, `VerticalAlign`, and `Color` to create visual interest. On the modern React controls the text colour property is `Color` and the font size property is `Size``FontColor` and `FontSize` exist only on `Badge`. Confirm with `describe_control` rather than assuming.
65+
- **Font Properties**: Leverage `Size`, `FontWeight`, `Align`, `VerticalAlign`, and `Color` to create visual interest. On the modern React controls the text color property is `Color` and the font size property is `Size``FontColor` and `FontSize` exist only on `Badge`. Confirm with `describe_control` rather than assuming.
6666

6767
### Color & Visual Theme
6868

@@ -80,7 +80,7 @@ the real user experience.
8080
- **Design for the narrowest width you claim to support**: A layout composed at 1440px and never re-checked will clip at 1024px and collapse on a phone. Size layout containers with `Parent.Width` or `FillPortions`, never a literal like `Width: =1120`. Reserve fixed pixel sizes for icons, avatars, and steppers — and keep interactive ones at 44px or larger.
8181
- **Every horizontal row of more than two controls needs a reflow strategy**: Set `LayoutWrap: =true`, or drive `LayoutDirection` from a width breakpoint, so rows stack instead of squeezing. This is the single most common defect in generated apps and it is invisible at the width you designed at.
8282
- **The screen root must scroll** whenever it holds a gallery, a form, or more than about three stacked sections: canvas screens do not scroll on their own, so give the root container `LayoutOverflowY: =LayoutOverflow.Scroll` and content below the fold stays reachable on short viewports.
83-
- **Set foreground wherever you set background**: Text does not inherit a contrasting colour. Every time you choose a container `Fill`, set `Color` on the text inside it — dark-on-dark passes every automated check and is unreadable.
83+
- **Set foreground wherever you set background**: Text does not inherit a contrasting color. Every time you choose a container `Fill`, set `Color` on the text inside it — dark-on-dark passes every automated check and is unreadable.
8484
- **Rows inside a `Gallery` need their own container**: `Gallery` is a Classic control and positions its template children absolutely, so a row authored at desktop width stays at desktop width everywhere. Put one AutoLayout `GroupContainer` in the template and build the row inside it. See `${PLUGIN_ROOT}/references/LayoutGuide.md`.
8585
- **Asymmetry & Breaking Grid**: Don't center everything. Offset elements. Use unexpected positioning.
8686
- **Spacing as Design**: Generous padding creates breathing room. Dense layouts create energy.

plugins/canvas-apps/references/EditWorkflow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Anything else is **complex**.
1919

2020
1. Read `${PLUGIN_ROOT}/references/YamlSyntax.md`. Also read `${PLUGIN_ROOT}/references/ControlGuide.md` when the edit
2121
touches control properties or enums, and `${PLUGIN_ROOT}/references/LayoutGuide.md` when it touches
22-
sizing, scrolling, or colour.
22+
sizing, scrolling, or color.
2323
2. Use `describe_control` before adding a property not already present on that control.
2424
3. Apply targeted edits directly to the `[working directory]` folder.
2525
4. Read `${PLUGIN_ROOT}/references/ValidationWorkflow.md` and follow it.
@@ -31,7 +31,7 @@ Read:
3131

3232
- `${PLUGIN_ROOT}/references/YamlSyntax.md` — file structure, syntax rules, parse-error triage
3333
- `${PLUGIN_ROOT}/references/ControlGuide.md` — control selection, per-control properties, enums
34-
- `${PLUGIN_ROOT}/references/LayoutGuide.md` — responsive layout, scrolling, colour contrast
34+
- `${PLUGIN_ROOT}/references/LayoutGuide.md` — responsive layout, scrolling, color contrast
3535
- `${PLUGIN_ROOT}/references/PowerFxGuide.md` — state, events, named formulas, mock data
3636
- `${PLUGIN_ROOT}/references/DesignGuide.md` — aesthetic direction and design process
3737

plugins/canvas-apps/references/LayoutGuide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Canvas App YAML — Layout and Responsive Behaviour
1+
# Canvas App YAML — Layout and Responsive Behavior
22

3-
Sizing, positioning, scrolling, and the narrow-width behaviour that decides whether a
3+
Sizing, positioning, scrolling, and the narrow-width behavior that decides whether a
44
screen works on a phone. The defects in this guide are invisible at the width you author
55
and are reported by no compile diagnostic.
66

@@ -13,7 +13,7 @@ and are reported by no compile diagnostic.
1313
- Galleries are Classic — their rows do not reflow
1414
- Horizontal rows must reflow at narrow widths
1515
- Give labelled controls room for their longest value
16-
- Text colour must be set wherever you set a background
16+
- Text color must be set wherever you set a background
1717
- Never hard-code a layout width
1818
- The screen root must be able to scroll
1919
- Layout rules of thumb
@@ -220,9 +220,9 @@ control sits in a horizontal row, set `FillPortions: =0` plus a `Width` (or
220220
`LayoutMinWidth`) that fits the longest value it can display, and set `Wrap: =false` on
221221
single-line text so it cannot silently become two lines.
222222

223-
## Text colour must be set wherever you set a background
223+
## Text color must be set wherever you set a background
224224

225-
Text controls do not inherit a contrasting colour from their container. A dark `Fill` with
225+
Text controls do not inherit a contrasting color from their container. A dark `Fill` with
226226
an unset `Color` renders near-black text on a near-black surface — technically valid and
227227
completely unreadable:
228228

plugins/canvas-apps/references/PlanTemplates.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ CREATE
4343
|--------|--------|-------------|----------|-------------|--------------|
4444
| Create | [Landing] | `[working directory]/Screen1.pa.yaml` | Screen1 | [Prefix] | `[working directory]/Screen1.screen-plan.md` |
4545
| Create | [Additional] | `[working directory]/[Name].pa.yaml` | [Name] | [Prefix] | `[working directory]/[Name].screen-plan.md` |
46+
47+
## Editor State Changes
48+
[Exact final ScreensOrder and ComponentDefinitionsOrder lists, or "None"]
4649
```
4750

4851
## Plan Index — EDIT
@@ -81,6 +84,9 @@ EDIT
8184
seed data — or "None"]
8285
### After builders
8386
[Changes referencing screens that do not exist yet, such as StartScreen — or "None"]
87+
88+
## Editor State Changes
89+
[Exact final ScreensOrder and ComponentDefinitionsOrder lists, or "None"]
8490
```
8591

8692
## Shared Plan

plugins/canvas-apps/references/QAChecks.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ are not part of the identifier.
4343
- Check 19 — `QACHK-NO-REFLOW` — horizontal row with no narrow-width strategy
4444
- Check 20 — `QACHK-ROOT-NOT-SCROLLABLE` — screen content taller than the viewport cannot
4545
be reached
46-
- Check 21 — `QACHK-LOW-CONTRAST-TEXT` — text colour not set against a coloured background
46+
- Check 21 — `QACHK-LOW-CONTRAST-TEXT` — text color not set against a colored background
4747
- Check 22 — `QACHK-VARIANT-SURFACE-CONTRAST` — light foreground on a variant-supplied
4848
surface
4949
- Check 23 — `QACHK-CARD-PLACEHOLDER``ModernCard` slot left unset
@@ -780,18 +780,18 @@ viewport.
780780

781781
---
782782

783-
## Check 21 — `QACHK-LOW-CONTRAST-TEXT` (text colour not set against a coloured background)
783+
## Check 21 — `QACHK-LOW-CONTRAST-TEXT` (text color not set against a colored background)
784784

785-
**Problem:** Text controls do not inherit a contrasting colour from their container. A
785+
**Problem:** Text controls do not inherit a contrasting color from their container. A
786786
container with a dark `Fill` whose child text controls omit `Color` renders near-black on
787787
near-black. `compile_canvas` passes it.
788788

789789
**Detect:** For every container that sets a non-default `Fill`, check every descendant
790790
text control (`ModernText`, `Badge`, and any control with a `Text` or `Content` property)
791-
for an explicit colour — `Color` on the modern React controls, `FontColor` on `Badge`,
791+
for an explicit color — `Color` on the modern React controls, `FontColor` on `Badge`,
792792
`TitleColor`/`SubtitleColor`/`DescriptionColor` on `ModernCard`.
793793

794-
**Fix:** Set the colour explicitly wherever the background was set:
794+
**Fix:** Set the color explicitly wherever the background was set:
795795

796796
```yaml
797797
Color: =RGBA(239, 246, 250, 1)

plugins/canvas-apps/references/ValidationWorkflow.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ diagnostic history, and a fresh agent would have to rediscover all of it.
161161
- The only sanctioned re-delegation is back to `canvas-app-planner` when a builder
162162
returned `Status: Blocked` because its brief was genuinely missing a definition or an
163163
assignment field — never for a diagnostic on a file that already exists.
164-
165-
Never modify `[working directory]/_EditorState.pa.yaml` while repairing diagnostics.
164+
- Modify `[working directory]/_EditorState.pa.yaml` when a diagnostic identifies it or when the requested
165+
screen or component-definition order requires correction. Preserve valid names and
166+
repair only the affected order entries.
166167

167168
### Verify before you summarize
168169

0 commit comments

Comments
 (0)