Skip to content

[6.x] Ask AI groundwork: card alignment, UiRenderer setValues(), AI problems, word diff - #20029

Open
riasvdv wants to merge 6 commits into
6.xfrom
feature/ask-ai-groundwork
Open

riasvdv wants to merge 6 commits into
6.xfrom
feature/ask-ai-groundwork

Conversation

@riasvdv

@riasvdv riasvdv commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Generic pieces the Ask AI PR builds on, one commit each:

 craft-card
   .card__header__suffix
+    align-items: center        # badges line up with header actions

 UiRenderer (exposed)
   setValue(path, value, kind)
+  setValues([{path, value, refreshable}])
+    set all values
+    refresh the layout once, for the last refreshable change

 Ai::problems()
   for each task
-    no provider → problem
+    no provider → problem, only once a provider is chosen anywhere

+resources/js/common/utils/diff.ts
+  renderDiff(current, proposed, highlights, expanded) → {pieces, collapsed, edits}

The problems() change matters once Craft registers its own task: without it, every install would show a “can’t run yet” alert while AI is still off.

Evidence

  • UiRenderer.test.ts › refreshes once after setting several refreshable values
    • Before: n/a (new API)
    • After: 1 refresh request with every value
  • AiTest › lists the problems admins need to fix
    • Before: nothing chosen → Summarize doesn’t have a provider…
    • After: nothing chosen → no problem; another task has a provider → Summarize doesn’t have a provider…
  • diff.test.ts covers word diffs, collapsing, and highlights.

@riasvdv
riasvdv added this pull request to stack #20032 October 19, 2026 15:23
@riasvdv riasvdv changed the title feature/ask ai groundwork [6.x] Ask AI groundwork: card alignment, UiRenderer setValues(), AI problems, word diff Oct 19, 2026
@riasvdv
riasvdv marked this pull request as ready for review October 19, 2026 15:25
@riasvdv
riasvdv requested a review from brandonkelly October 19, 2026 15:25
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/ui — open Storybook

Changed components:

resources/js — open Storybook

No changed components detected in this Storybook.

@riasvdv
riasvdv force-pushed the feature/ask-ai-groundwork branch 2 times, most recently from a8b62f1 to ffe7fdb Compare October 19, 2026 17:14
Base automatically changed from feature/field-input-schemas to 6.x October 19, 2026 21:30
Setting several values refreshes the layout once, rather than once per reactive field.
Until a provider is chosen for a default or a task, AI is off, which isn't a problem worth alerting admins about.
renderDiff() splits two texts into unchanged, removed, and added pieces, collapses long unchanged runs, and marks highlighted passages.
@brandonkelly
brandonkelly force-pushed the feature/ask-ai-groundwork branch from ffe7fdb to da465f0 Compare October 19, 2026 21:30

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants