You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Use when creating a demo or test page for manual testing of Handsontable. Trigger when the user asks to create a demo, test page, repro page, reproduction case, manual test, or wants to verify a bug fix or feature visually. Also trigger when the user mentions dev-generated.html, dev.html, or wants to compare behavior between a released version and a local build. Use this for any PR that needs a manual testing artifact.
3
+
description: Use when creating a demo or test page for manual testing of Handsontable. Trigger when the user asks to create a demo, test page, repro page, reproduction case, manual test, or wants to verify a bug fix or feature visually. Also trigger when the user mentions dev-generated.html, dev-pr.html, dev-latest.html, dev.html, or wants to compare behavior between a released version and a local build. Use this for any PR that needs a manual testing artifact.
4
4
---
5
5
6
6
# Demo Page Generator
7
7
8
-
Generate a self-contained HTML demo page at `handsontable/dev-generated.html`for manual testing. This file is gitignored (`dev*.html` pattern), so it never pollutes the repo.
8
+
Generate two self-contained HTML demo pages for manual testing:
9
9
10
-
The demo has two tabs so a reviewer can instantly compare behavior:
10
+
| File | Loads from | Purpose |
11
+
|------|-----------|---------|
12
+
|`handsontable/dev-latest.html`| jsDelivr CDN (latest published version) | Shows the current/buggy behavior |
13
+
|`handsontable/dev-pr.html`| Local `dist/` (built from the branch) | Shows the fix or new feature |
11
14
12
-
| Tab | Loads from | Purpose |
13
-
|-----|-----------|---------|
14
-
|**Released**| jsDelivr CDN (latest published version) | Shows the current/buggy behavior |
15
-
|**PR Build**| Local `dist/` (built from the branch) | Shows the fix or new feature |
15
+
Both files are gitignored (`dev*.html` pattern), so they never pollute the repo.
16
16
17
-
This side-by-side comparison makes PR review faster — the reviewer sees the bug on the Released tab and verifies the fix on the PR Build tab without switching branches.
17
+
Each file links to the other at the top, so a reviewer can switch back and forth without losing scroll position or state context. **Two separate files means complete JS/CSS isolation** — no dual-instance loading tricks, no stylesheet toggling, no shared globals between versions.
18
18
19
19
## Step 1 — Analyze the PR context
20
20
@@ -41,182 +41,170 @@ If missing or stale, build:
41
41
npm run build --prefix handsontable
42
42
```
43
43
44
-
## Step 3 — Generate the demo page
44
+
## Step 3 — Generate the two demo files
45
45
46
-
Write `handsontable/dev-generated.html`using the template structure below. Adapt the Handsontable configuration in each tab to target the specific bug or feature being tested.
46
+
Write both files using the templates below. Both are gitignored (`dev*.html`), so they never pollute the repo.
47
47
48
-
> **File already exists?**`dev-generated.html` is always throwaway — it was generated by a previous task and contains nothing worth preserving. Skip reading it. Wipe it first with a Bash command, then write the new file:
48
+
> **Files already exist?**Both files are throwaway — generated by a previous task. Skip reading them. Wipe them first, then write fresh:
> Then use the Write tool to create the new content from scratch. Do **not**read the old file before writing.
54
+
> Then use the Write tool to create each file from scratch.
55
55
56
-
### Template structure
56
+
Each file is a standalone single-instance page. The nav bar at the top links to the other file — the current file's link is styled as active (non-clickable) so the reviewer always knows where they are.
|`__RELEASED_VERSION__`| The latest published version from `handsontable/package.json` (e.g., `17.0.1`). If the PR branch itself bumped the version, use the version from the base branch (`git show origin/develop:handsontable/package.json`). |
189
+
| `__RELEASED_VERSION__` | The latest published version from `handsontable/package.json` (e.g., `17.0.1`). If the PR branch bumped the version, use the version from the base branch (`git show origin/develop:handsontable/package.json`). |
204
190
| `[Short description...]` | A one-line summary, e.g., "Filters dropdown closes on Android touch" |
205
191
| `[Step-by-step reproduction...]` | Numbered steps the reviewer should follow, e.g., "1. Double-tap cell A1. 2. The editor should open and stay open." |
206
192
193
+
Keep the `<script>` config **identical in both files** — the only difference between the pages is which Handsontable build they load. That way any behavioral difference the reviewer sees is caused by the code change, not a config discrepancy.
194
+
207
195
### Adapting the config
208
196
209
-
The `createInstance()`functionis where all the test-specific logic goes. Tailor it based on what the PR changes:
197
+
Tailor the Handsontable config block based on what the PR changes:
210
198
211
-
**Bug fix PRs** — Configure the grid to reproduce the bug. The Released tab should exhibit the broken behavior;the PR Build tab should show it fixed. Include the minimal settings needed to trigger the issue.
199
+
**Bug fix PRs** — Configure the grid to reproduce the bug. `dev-latest.html` should exhibit the broken behavior; `dev-pr.html` should show it fixed. Include the minimal settings needed to trigger the issue.
212
200
213
-
**Feature PRs** — Configure the grid to showcase the new feature. The Released tab shows the "before" state (feature absent);the PR Build tab demonstrates the new capability.
201
+
**Feature PRs** — Configure the grid to showcase the new feature. `dev-latest.html` shows the "before" state (feature absent); `dev-pr.html` demonstrates the new capability.
214
202
215
203
**Plugin-specific** — Enable the relevant plugin with settings that exercise the changed code paths. Example for Filters:
216
204
217
205
```js
218
-
returnnew Ht(container, {
219
-
data: Ht.helper.createSpreadsheetData(20, 6),
206
+
new Handsontable(document.getElementById('hot-container'), {
**Touch/mobile testing** — Add the viewport meta tag (already in template) and keep the grid width responsive (`width: '100%'`). Mention touch-specific steps in the instructions.
219
+
**Touch/mobile testing** — Keep the grid width responsive (`width: '100%'`). Mention touch-specific steps in the instructions.
232
220
233
-
**Third-party integrations** — If the demo needs external libraries (flatpickr, Pickr, etc.), load them from CDN in both tabs. Keep versions consistent between tabs.
221
+
**Third-party integrations** — If the demo needs external libraries (flatpickr, Pickr, etc.), load them from CDN in both files. Keep versions consistent.
234
222
235
223
### Additional CSS and external libraries
236
224
237
-
If the test needs extra CSS or third-party libraries, add them to the `<head>`:
225
+
Add them to the `<head>` of both files:
238
226
239
227
```html
240
228
<!-- Example: flatpickr for date editor testing -->
Tell the user the URL so they can open it in a browser and test.
253
+
The nav bar in each file links to the other, so the reviewer can switch back and forth without re-typing URLs.
264
254
265
255
## Important notes
266
256
267
-
- The file is gitignored — it will not appear in`git status` or get committed.
268
-
- Each tab has its own Handsontable instance. The CDN version is saved to `window.HandsontableReleased` before the local build script overwrites `window.Handsontable`.
269
-
- Stylesheet switching uses the `disabled` attribute on `<link>` elements so only one theme is active at a time.
270
-
- If the released version used the old CSS system (pre-v17, `dist/handsontable.full.css`), adjust the CDN CSS link accordingly.
271
-
- For very old version comparisons, check that the API used in`createInstance()` exists in both versions.
257
+
- Both files are gitignored (`dev*.html`) — they will not appear in `git status` or get committed.
258
+
- Each file loads only one Handsontable build — no dual-instance tricks needed.
259
+
- If the released version used the old CSS system (pre-v17, `dist/handsontable.full.css`), adjust the CDN CSS link in `dev-latest.html` accordingly.
260
+
- For very old version comparisons, check that the API used in the config block exists in both versions.
0 commit comments