|
39 | 39 | - Start new visual work from `visual/templates/Postman-Visualizer-SectionTemplate.md` and build the page section-by-section from that scaffold. |
40 | 40 | - Do not manually edit generated visual docs (`docs/visual/`, `docs/visual-previews/`); regenerate from `visual/`. |
41 | 41 | - No comments in visual code/templates unless explicitly requested. |
42 | | -- Required exception: every visual script must begin with a two-line header comment in this format: |
| 42 | +- Required exception: every visual script must begin with a three-line header comment in this format: |
43 | 43 | - `// Postman Visualizer: <<Description of Visual >>` |
44 | 44 | - `// Last Update: <<Date and Time>>` |
| 45 | +- `// Visual Constraints: Follow canonical visual rules in CODING_AGENTS.md.` |
45 | 46 | - No emoji in visual UI labels, titles, legends, table headers, axis labels, or status text unless explicitly requested. |
46 | 47 | - At the top of each visual HTML file, maintain the visual rules/constraints and indicate that `CODING_AGENTS.md` defines the canonical rules so they are not forgotten. |
47 | 48 | - Do not scatter magic numbers through visual HTML/script logic. Put tunable constants in a clearly named `TUNING` section near the top of the visual (for example chart heights, tick limits, sampling caps, render-bin caps, animation timings). |
|
65 | 66 | - For `Moving Avg` overlays, use the same base color as `Actual` with a dashed line style. |
66 | 67 | - Avoid redundant repetition of values already shown in `Device Info` (for example, do not repeat `MacAddress` in the channel header if it is already in the device table). |
67 | 68 | - If `system_description` is missing/partial, render `N/A` for missing fields instead of vendor-specific fallback values. |
| 69 | +- Never hardcode vendor/model/firmware fallback values in visualizer runtime logic. |
| 70 | +- PyPNM generic placeholder values are for fixture JSON only and must not be used as runtime script fallbacks. |
68 | 71 | - JSON responses may contain multiple upstream/downstream channels; each channel must render as its own graph for the selected graph type. |
69 | 72 | - For multi-channel visuals with repeated per-channel panels/boxes, default to a 2-column layout (max 2 per row) with a 1-column fallback on narrower widths. |
70 | 73 | - For channel-related multi-channel visuals, place the combined graph at the top and per-channel graphs below it. |
|
91 | 94 | - Regression / trend / fitted reference lines must use a high-contrast color distinct from waveform traces (prefer dashed). |
92 | 95 | - Default regression/reference line color: white. |
93 | 96 | - If white reduces readability against the chart/waveform palette, use a dark red contrast line (for example `#c62828`) or another clearly contrasting color and document the choice in the visual remarks. |
| 97 | + |
| 98 | +## Postman Request YAML Guardrails (Required) |
| 99 | + |
| 100 | +- Use this top-level key order for every `*.request.yaml`: |
| 101 | +- `$kind`, `url`, `method`, `body`, `scripts`, `order` |
| 102 | +- Keep `language: text/javascript` present under every script entry. |
| 103 | +- Keep `order` unique among sibling requests in the same folder. |
| 104 | +- Request URL must use `{{variable}}` base prefix (no hardcoded host/base). |
| 105 | +- JSON bodies must use the repo escaped multi-line body style used by existing request files in that folder. |
| 106 | + |
| 107 | +### New Endpoint Workflow (Do This Every Time) |
| 108 | + |
| 109 | +- Create the new request YAML with the correct endpoint body and variable names. |
| 110 | +- Add a temporary visualizer stub header that matches the visual path. |
| 111 | +- Run `tools/postman/sync_visualizers.py --update` to copy script content from `visual/` 1:1. |
| 112 | +- Do not hand-edit long synced script blocks in YAML unless explicitly required; fix the source HTML in `visual/` and re-sync. |
| 113 | + |
| 114 | +### Post-Sync Verification Checklist |
| 115 | + |
| 116 | +- Confirm the script header has all 3 required lines. |
| 117 | +- Confirm canonical dark-blue palette is present (page `#141821`, panel `#1b2332`). |
| 118 | +- Confirm `language: text/javascript` is present. |
| 119 | +- Confirm sibling `order` remains unique. |
| 120 | +- If any check fails, fix source visual and rerun sync before commit. |
0 commit comments