[pull] develop from baserow:develop#367
Merged
Merged
Conversation
…pt (#5716) * feat: add AI prompt validation helper * feat: expose computed AI field prompt error in serializer * test: AI prompt error clears on fix and survives broken import * feat: reject AI generate when prompt is broken Re-validate the AI field prompt in AsyncGenerateAIFieldValuesView so a direct API call returns 400 instead of starting a job when the prompt is unparseable or references a missing field. * feat: disable grid AI generate when prompt is broken * feat: disable row-edit AI generate when prompt is broken * chore: add changelog for AI broken-prompt fix * fix: disable AI generate button on non-selected broken-prompt cells * fix: show broken-prompt tooltip on wrapper so it appears while button is disabled * fix: actually disable the grid cell Generate button on a broken prompt The functional (non-selected) grid cell used a tag="a" Button, which ignores the disabled prop, so the Generate button never disabled on a broken prompt. Use a real button so :disabled applies, move the tooltip to the wrapper, and add a regression test. * fix: update AI field error live when a referenced field changes The prompt error is computed on serialize, but the open grid never learned about it when a referenced field was deleted/restored because the AI field wasn't reported as a dependant. Hook field_dependency_updated so the AI field is included in related_fields (re-serialized with the fresh error) without touching its stored cell values. * fix: tolerate an unparseable AI prompt in dependency extraction and import Saving an invalid prompt is still rejected, but a broken prompt can also arrive through an import (or references can break later). Guard the prompt parsing in get_field_dependencies and after_import_serialized so such a field imports fine and surfaces the problem via its computed error instead of raising. * fix: block saving an AI field with an invalid prompt The prompt input only emits parseable formulas, so typing an invalid one and saving silently kept the last valid prompt — the field saved fine and looked healthy. The input now reports validity changes and the AI field form shows an error and refuses to submit while the prompt is invalid. * refactor: pass table_id to get_ai_prompt_error to avoid fetching the table The error property only needs the table PK for the field-existence lookup, so dereferencing self.table added a pointless query per serialization. * fix: re-report the AI field when a trashed referenced field is restored Deleting a referenced field dropped the AI field's dependency edge entirely (get_field_dependencies skipped missing ids), so restoring the field had no edge to walk and the grid kept showing the stale error until a reload. A trashed referenced field is now declared as a broken reference by name, like formula fields do, so the restore re-links it and the AI field is re-serialized with its error cleared. * fix: scope trashed broken-reference lookup to the AI field's table Keeps get_field_dependencies consistent with get_ai_prompt_error, which only considers same-table references, so a trashed field from another table can't leave a by-name broken reference in this table's graph. Also restores the delete test's cell-value assertion that was accidentally moved into the restore test, and drops the duplicate there. * fix: reject broken AI prompts on every generation entry point The generic /jobs/ endpoint used by the bulk generation modal skipped the prompt validation, double-quoted get("fields.field_X") references escaped the extractor, dependency discovery accepted cross-table field ids, and every error access repeated the field query. Validation now lives in the job type's prepare_values, the extractor strips both quote styles, the dependency lookup is table scoped, and the validated field ids are cached per request and invalidated on schema changes. * fix: disable AI generation shortcuts and context menus when the prompt is broken The Enter key on an empty cell and the field/cell context menu items could still trigger generation with a broken prompt. The shared generate actions now guard themselves and both menu items are disabled with an explanatory tooltip. * test: assert cross-table prompt references create no field dependencies
* feat: rich text editor for form field description (creator) * feat: render form field description as rich text (respondent) * feat: rich text editor for form description (creator) * feat: render form description as rich text (respondent) Renders the form-level description read-only via RichTextEditor in FormViewModeForm.vue (the public standard form), matching the field description treatment from FormPageField. FormViewModeSurvey.vue was checked and has no separate form-level description/title render at all (it goes straight to fields), so no change was needed there. * docs: changelog for rich form descriptions (#1851) * fix: only save form description after an actual edit saveDescription ran on every editor blur and compared tiptap's normalized markdown against the raw stored value, so clicking into a legacy plain-text description (with chars like *, #, %) and away without editing silently rewrote the stored value. Add a dirty flag set only by update:modelValue (real edits) so blur without an edit is a no-op. Also drops the unused editor-class attribute on the description RichTextEditor (no matching SCSS rule). * perf: only mount field description editor when needed (v-if) * fix: preserve in-progress description edit on external update; add e2e coverage * fix: click-to-edit toggle for form descriptions; fix cursor reset Replace the always-editable inline RichTextEditor on the form builder with a shared FormViewDescription component that renders read-only markdown and mounts the editor only while editing, behind an edit pencil (matching title/submit). - Restores the edit affordance that regressed vs the old Editable. - Passes model-value one-way and reads markdown back on blur, so typing after moving the cursor no longer resets to the end. - No floating menu lingers on the form once editing stops. - Removes the dirty/save-on-blur logic duplicated across FormViewField and FormViewModePreviewForm. * test: cover form description toggle and save-on-blur * fix: keep description editor menu stuck to cursor line on scroll Pass the form preview's scroll container (.form-view__preview) to the editor so its floating/bubble menu tracks the cursor line while the page scrolls, instead of falling back to the editor's own non-scrolling root. * Address PR review feedback (#5707) - Route public form description render sites through FormViewDescription - Pass scroll container as a resolver prop instead of a closest() lookup - Wrap long unbroken words in form and field descriptions - Use palette color variable for the description placeholder * fix: clamp form description containers to the form column The flex editor wrapper inside the inline-block description containers made them shrink-to-fit their max-content width, letting long words escape the form column on the public form.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )