mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 17:53:55 +08:00
Simple (and not so simple, but result of a drag event) field references
in expression inputs like `{{ $("Create Topic").first().json.topic.id
}}` now render as a pill (source badge + property path) instead of raw
expression syntax. The pill is purely a display layer; the document
still holds the real expression, so evaluation, validation and saving
are unchanged.
Pills are interactive: click to select, double-click (or the dropdown's
"Edit code") to edit the raw text, and a caret button / Enter / "."
opens a property picker to drill into objects or switch siblings without
ever surfacing the syntax. They can be dragged between fields (moving,
not copying) and respond to keyboard navigation. Validity is colored the
same way the editor does: valid, incomplete (resolves to an object), or
invalid.
<img width="645" height="203" alt="image"
src="https://github.com/user-attachments/assets/aef5b573-20cc-48c1-94b0-2e27626d5644"
/>
Each reference source gets its own badge: Input ($json/$input), Trigger
($trigger), Item index ($itemIndex), Variable, Current user, Site
setting, Execution, or the referenced node's name. Scope resolution also
learned plain array/bracket subscripts (`$json.items[0].id`), so such
references classify correctly instead of showing as invalid.
Anything more involved (method calls, arithmetic, multiple references)
is left as syntax-highlighted code, so the raw editor remains fully
available.
Clicking the empty area below the last line now focuses the editor and
places the caret at the end, making the whole field clickable.
|
||
|---|---|---|
| .. | ||
| admin/assets/javascripts | ||
| app | ||
| assets | ||
| config | ||
| db/migrate | ||
| lib | ||
| spec | ||
| test/javascripts | ||
| plugin.rb | ||
| USE_CASES.md | ||