feat(SurveyFormBuilder): lockable sections & questions#4512
Conversation
Extracted from #4307 — only the sds/surveys changes (blocked questions and sections, locked tags, answering-form notices), plus the F0TagRaw className prop and the surveyFormBuilder.labels.locked i18n key they depend on. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…pe lock tooltip to the icon QuestionNotice carried variant/title/icon (AlertVariant) but nothing ever rendered it as an alert — only `description` is read, shown as a title-less tooltip. Drop the unused fields. Also move that tooltip off the whole question card onto just the lock icon, so the explanation shows on hovering the lock rather than anywhere on the question. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ce & LockedQuestionNotice
Make the lock-tooltip data model symmetric: a section carries a
LockedSectionNotice and a question carries a LockedQuestionNotice, both
{ description }, and the locked-question tooltip prefers the question's
own notice then falls back to the section's.
- rename QuestionNotice -> LockedSectionNotice (it lived on the section)
- type the question's lockedNote as LockedQuestionNotice (was a bare
string) so both levels feed the popover the same way
- fix the answering-form test that set the section-only `notice` on a
question; it now sets `lockedNote`
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Complete the lock-tooltip fallback chain: a locked question prefers its own LockedQuestionNotice, falls back to the parent section's LockedSectionNotice, and finally to a default lock notice that now lives in the F0Provider i18n defaults (surveyFormBuilder.labels.lockedNotice) instead of being hardcoded per story. Stories migrated to the new model: lock explanations move from a section's `description` to its `notice`, and the default-fallback story drops the hardcoded text so it exercises the provider default. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Questions could previously only be locked via a locked section. Add a per-question `locked` flag so a standalone question can be locked on its own, showing the lock affordance + tooltip and disabling its inputs. The lock tooltip chain for a question is now: own `lockedNote` → parent section's `notice` → default question notice. Split the provider default into `lockedSectionNotice` (sections) and `lockedQuestionNotice` (questions) to match the LockedSectionNotice / LockedQuestionNotice types. Adds a "With Locked Questions" story (some questions carry their own notice, others fall back to the default) and fixes the tooltip-on-hover test to hover the lock icon rather than the whole card. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A standalone locked question isn't moved into place like a section's members, so the default reads "edited or removed". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A read-only (locked/disabled) question with no description was still rendering its textarea, showing an editable-looking placeholder. Gate it on the same showDescription rule the section uses: render only when the question is editable or actually has a description. Sections already hide theirs when locked. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ No New Circular DependenciesNo new circular dependencies detected. Current count: 0 |
🔍 Visual review for your branch is published 🔍Here are the links to: |
📦 Alpha Package Version PublishedUse Use |
A section and a question now use the same `lockedNote` field name for their lock explanation (typed LockedSectionNotice / LockedQuestionNotice respectively), instead of the section calling it `notice`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
When a question shows no description (e.g. a locked question with none), collapse the title-to-input gap from gap-4 to gap-2. Likewise, the first question in a locked section sits closer to the section title, which has no inline description beneath it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Description
Adds the ability to mark sections and individual questions in the
SurveyFormBuilderas predefined and read-only. A locked item shows a lock affordance instead of its edit/drag controls, disables its inputs, and explains itself through a hover tooltip that falls back to a default notice from the F0Provider. This was extracted from the co-creation work in #4307, scoped down to just the survey changes.Screenshots