docs(developer-guide): show the pre-edit hook result, fix the re-read drop list #17

Merged
allan merged 2 commits from docs/pre-edit-hook-images into main 2026-10-15 17:57:19 +00:00
Collaborator

What

Two changes to developer-guide/filter-pre-edit-hook.md, which merged in #16:

  1. A "What it looks like" section with a before/after pair of the editor, so the page shows the outcome as well as the mechanism.
  2. A correction to the re-read step (review finding on #16): the example now drops &drop_rk alongside the transaction and processing columns, and the note records that a bitemporal table also needs getdata's latest-record dedup. The previous wording claimed the step mirrored getdata while missing both.

How the images were produced

Captured from the mocked estate (the usual source for docs images), driving the streamed app with a throwaway Cypress spec:

  • a demo table (TESTDATA.DEMO_ORDERS) with an ORDER_DATE column and rows spanning two quarters;
  • a stored filter on ORDER_DATE (the user's own filter, one quarter);
  • for the "after" shot, the mock's editors/getdata reproducing the hook's effect - widen the date filter to the previous quarter, taking the reference date from the rows the filter returned, and return the widened FILTER_TEXT.

The JS mock cannot execute a SAS hook, so the mock emulates the hook's logic for the capture; the images illustrate the outcome, they are not a run of the SAS example. Both captures are 1920x900, no free-tier banner, and the Handsontable evaluation notice the stale mock build renders in its status bar was hidden for the shot (it is a mock-build artefact, not a Data Controller state).

Verification

  • mkdocs build --clean succeeds; both images resolve from /img/ and render on the page.
  • The before/after pair was read back from the captured PNGs: the info bar goes from (( ORDER_DATE >= "01JUL2026"d )) with 5 rows to (( ORDER_DATE >= "01JUL2026"d ) OR (ORDER_DATE between "01APR2026"d and "30JUN2026"d)) with 8 rows.
## What Two changes to `developer-guide/filter-pre-edit-hook.md`, which merged in #16: 1. **A "What it looks like" section** with a before/after pair of the editor, so the page shows the outcome as well as the mechanism. 2. **A correction to the re-read step** (review finding on #16): the example now drops `&drop_rk` alongside the transaction and processing columns, and the note records that a bitemporal table also needs getdata's latest-record dedup. The previous wording claimed the step mirrored `getdata` while missing both. ## How the images were produced Captured from the mocked estate (the usual source for docs images), driving the streamed app with a throwaway Cypress spec: - a demo table (`TESTDATA.DEMO_ORDERS`) with an `ORDER_DATE` column and rows spanning two quarters; - a stored filter on `ORDER_DATE` (the user's own filter, one quarter); - for the "after" shot, the mock's `editors/getdata` reproducing the hook's effect - widen the date filter to the previous quarter, taking the reference date from the rows the filter returned, and return the widened `FILTER_TEXT`. The JS mock cannot execute a SAS hook, so the mock emulates the hook's logic for the capture; the images illustrate the outcome, they are not a run of the SAS example. Both captures are 1920x900, no free-tier banner, and the Handsontable evaluation notice the stale mock build renders in its status bar was hidden for the shot (it is a mock-build artefact, not a Data Controller state). ## Verification - `mkdocs build --clean` succeeds; both images resolve from `/img/` and render on the page. - The before/after pair was read back from the captured PNGs: the info bar goes from `(( ORDER_DATE >= "01JUL2026"d ))` with 5 rows to `(( ORDER_DATE >= "01JUL2026"d ) OR (ORDER_DATE between "01APR2026"d and "30JUN2026"d))` with 8 rows.
hermes added 1 commit 2026-10-15 17:12:12 +00:00
- Adds a "What it looks like" section to the pre-edit hook page: the editor
  before (the user's own filter, one quarter of rows) and after (the hook's
  widened filter, both quarters), captured from the mocked estate.
- Corrects the re-read step: it now drops &drop_rk like getdata does, and the
  accompanying note records that a bitemporal table also needs the latest-record
  dedup, so the example no longer claims to mirror getdata exactly while missing
  both (raised in review of #16).
Author
Collaborator

The before/after pair added to the page:

Before - the user's own filter, 5 rows:

before

After - the hook's widened filter, 8 rows:

after

The before/after pair added to the page: **Before** - the user's own filter, 5 rows: ![before](https://git.datacontroller.io/attachments/a321af4b-76e4-46b4-9503-57e0ce0529a7) **After** - the hook's widened filter, 8 rows: ![after](https://git.datacontroller.io/attachments/59b7f7f8-daa5-474e-96c5-9df7b88a12d1)
hermes left a comment
Author
Collaborator

Reviewed the full diff (the filter-pre-edit-hook.md edits and both new PNGs); claims cross-checked against the getdata service source (sas/sasjs/services/editors/getdata.sas on dc/dc main) and the site built from the PR head.

  • docs/developer-guide/filter-pre-edit-hook.md:103 - the re-read step now copies getdata's drop list but not its sort. getdata runs proc sort data=work.out; by &sortpk; before the pre-edit hook and does not re-sort afterwards, so this step hands the editor rows in source order rather than the &sortpk order the user first saw. Add proc sort data=work.out; by &sortpk; run; after the re-read (&sortpk is declared %global in getdata and set before the hook runs, so it resolves in hook scope), or note the gap in the bullet at line 128 the same way the bitemporal dedup is noted.
  • .pre-commit-config.yaml (absent at the PR head) - the repo has no gitleaks pre-commit hook. Add one with the gitleaks hook pinned to an exact release tag (e.g. repo: https://github.com/gitleaks/gitleaks, rev: v8.30.1 at the time of writing, id: gitleaks), so staged content is scanned at commit time.

2 findings above for review.

Reviewed the full diff (the filter-pre-edit-hook.md edits and both new PNGs); claims cross-checked against the getdata service source (sas/sasjs/services/editors/getdata.sas on dc/dc main) and the site built from the PR head. - docs/developer-guide/filter-pre-edit-hook.md:103 - the re-read step now copies getdata's drop list but not its sort. getdata runs `proc sort data=work.out; by &sortpk;` before the pre-edit hook and does not re-sort afterwards, so this step hands the editor rows in source order rather than the &sortpk order the user first saw. Add `proc sort data=work.out; by &sortpk; run;` after the re-read (`&sortpk` is declared %global in getdata and set before the hook runs, so it resolves in hook scope), or note the gap in the bullet at line 128 the same way the bitemporal dedup is noted. - .pre-commit-config.yaml (absent at the PR head) - the repo has no gitleaks pre-commit hook. Add one with the gitleaks hook pinned to an exact release tag (e.g. `repo: https://github.com/gitleaks/gitleaks`, `rev: v8.30.1` at the time of writing, `id: gitleaks`), so staged content is scanned at commit time. 2 findings above for review.
hermes added 1 commit 2026-10-15 17:49:02 +00:00
- The re-read step now sorts work.out by &sortpk after rebuilding it, matching
  getdata (which sorts before the hook runs and does not sort again), so the
  grid keeps the order the user first saw. The bullet records why.
- Adds a .pre-commit-config.yaml with the gitleaks hook pinned to v8.30.1, so
  staged content is scanned at commit time.
Author
Collaborator

Both findings addressed in 9d48240.

  • The re-read step now sorts work.out by &sortpk after rebuilding it, matching getdata (which sorts before the hook runs and does not sort again afterwards), so the grid keeps the order the user first saw. The bullet at :128 records why.
  • .pre-commit-config.yaml added at the repo root, with the gitleaks hook pinned to v8.30.1.

mkdocs build --clean is clean and the built page carries both changes.

Both findings addressed in 9d48240. - The re-read step now sorts `work.out` by `&sortpk` after rebuilding it, matching getdata (which sorts before the hook runs and does not sort again afterwards), so the grid keeps the order the user first saw. The bullet at :128 records why. - `.pre-commit-config.yaml` added at the repo root, with the gitleaks hook pinned to `v8.30.1`. `mkdocs build --clean` is clean and the built page carries both changes.
allan merged commit cc2441fd2d into main 2026-10-15 17:57:19 +00:00
allan deleted branch docs/pre-edit-hook-images 2026-10-15 17:57:20 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/docs.datacontroller.io#17