Skip to content

[SC-17836] Document inventory field variables in Long Text fields - #1480

Open
even-steven wants to merge 1 commit into
mainfrom
stevenchand/sc-17836/inventory-field-variables-in-long-text
Open

[SC-17836] Document inventory field variables in Long Text fields#1480
even-steven wants to merge 1 commit into
mainfrom
stevenchand/sc-17836/inventory-field-variables-in-long-text

Conversation

@even-steven

@even-steven even-steven commented Aug 26, 2026

Copy link
Copy Markdown

Pull Request Description

What and why?

Documents sc-17836 — inserting inventory field variables into rich-text Long Text fields, shipped in validmind/frontend#2822 and validmind/backend#3492.

Both surfaces that shipped are covered:

  • Settings → Inventory Record Fields — the variable picker in a Long Text field's template editor. New section: Manage inventory fields → Insert field variables into a Long Text template.
  • A record's Long Text value — the same picker while editing an individual record. New section: Edit inventory fields → Insert field variables into a Long Text field.

Two new includes carry the shared content so the two pages can't drift:

  • _insert-field-variables.qmd — the picker steps and what the drop-down contains.
  • _field-variable-resolution.qmd — when values resolve, the Access denied / Circular reference / Exceeded max depth markers, and attestation-snapshot behavior.

The Long Text entry in _field-types.qmd is split into inventory- and artifact-scoped variants, following the pattern the Attachments entry already uses in that file. Variables apply only to inventory record fields, so the artifact page keeps the original one-line text.

Documented as implemented, not as specified. Two places where the shipped behavior differs from the story's acceptance criteria, and the docs follow the code:

Story AC What shipped
Resolve one level only Resolves two levels, with cycle detection and a visible Exceeded max depth marker (RECORD_FIELD_MAX_DEPTH = 2)
The edited field remains in its own picker (include self) Self is excluded (excludeFieldKey), per backend 3221ecdd / frontend 4ae0595a

Behavior documented that isn't in the story at all: field-level read permissions produce an Access denied marker rather than a blank (the value never reaches the browser); inventory CSV exports contain resolved values; a template assigned to several record types can only offer variables shared by all of them.

How to test

Rendered locally against --profile development. All four consumers of the edited include render clean, with only the pre-existing Unable to resolve link target: validmind/validmind.qmd warning that any isolated single-page render produces.

Pages to review, on the deployed preview:

Page What to check
Manage inventory fields New Insert field variables into a Long Text template section, and the revised Long Text field-type entry
Edit inventory fields New Insert field variables into a Long Text field section
Manage artifact fields Regression: Long Text must still read as the original one-liner, with no variables guidance
Customizing Your Inventory Regression (RevealJS): Long Text unchanged in both the inventory and artifact tabs

I checked the deployed preview, not just the local render: the new section is present on the inventory page, and the variables wording appears zero times on both the artifact page and the training deck, so neither regression fired.

Verified in the rendered HTML: the Long Text definition list still emits proper <dt>/<dd> despite the new fenced divs, and step numbering continues across the include boundary (<ol start="3">) on both pages.

What needs special review?

1. The feature is behind a LaunchDarkly flag that currently defaults to off. launchdarkly.rollout.inventory-field-variables (OfflineFlags default false). This PR documents it as generally available. Please confirm the flag will be on for 26.09 before merging, or tell me how the docs team prefers to stage docs ahead of a rollout — I did not invent a convention for it.

2. The RevealJS training deck is deliberately not updated. _field-types.qmd is included twice in training/administrator-fundamentals/customizing-your-inventory.qmd — once for inventory fields, once for artifact fields — and the RevealJS block is gated only on format, with no includes.inventory meta to switch on. Adding inventory-only guidance there would be wrong in the artifact tab. Training coverage for this feature therefore needs its own decision; happy to follow up.

3. Terminology check on the picker labels. The drop-down is documented as Record → Core Fields / {Group} / No Group / Stakeholders. Those come from the backend registry, relabeled from Model Fields to Record in the frontend, and match the existing wording in _reference-field-values.qmd. Worth a glance from someone who has the flag on.

4. No screenshots. I did not have the flag enabled against a live environment to capture the picker. Say the word if you want them and I'll add them.

Dependencies, breaking changes, and deployment notes

  • Implemented by validmind/frontend#2822 and validmind/backend#3492 (both merged).
  • No dependency on another docs PR.

Release notes

You can now reference other inventory field values from inside a rich-text Long Text field — both when defining the field's template and when editing the value on an individual record. Insert a field as a variable and it resolves to that record's current value, so a summary stays in sync as the record changes. Learn more ...

Checklist

  • What and why
  • Screenshots or videos (Frontend) — n/a, see What needs special review Update get-source to stop generating Markdown #4
  • How to test
  • What needs special review
  • Dependencies, breaking changes, and deployment notes
  • Labels applied — documentation
  • PR linked to Shortcut — sc-17836
  • Unit tests added (Backend) — n/a
  • Tested locally
  • Documentation updated (if required)
  • Environment variable additions/changes documented (if required) — n/a

Covers both surfaces that shipped in frontend#2822 / backend#3492: the
variable picker in a Long Text field's template editor (Settings) and in
the field's value on an individual record.

Documents the behavior as implemented rather than as specified. The story
called for one-level resolution and for the edited field to remain in its
own picker; what shipped resolves two levels with cycle detection and
excludes self, so the guidance follows the code.

The Long Text entry in _field-types.qmd is split into inventory- and
artifact-scoped variants, following the pattern the Attachments entry
already uses in that file. Variables apply only to inventory record
fields, so the artifact page and the RevealJS training deck (which
renders the include in an artifact context) keep the original text.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@even-steven even-steven added the documentation Improvements or additions to documentation label Aug 26, 2026
@CLAassistant

CLAassistant commented Aug 26, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

Copy link
Copy Markdown
Contributor

Validate docs site

✓ INFO: A live preview of the docs site is available — Open the preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants