Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6631 +/- ##
=======================================
Coverage 76.66% 76.66%
=======================================
Files 398 398
Lines 20103 20103
Branches 4841 4841
=======================================
Hits 15411 15411
Misses 4692 4692
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cstns
left a comment
There was a problem hiding this comment.
tested locally and working as expected, my notes are mostly nitpicks and enhancements that can be handled in future iterations
| @@ -0,0 +1,158 @@ | |||
| <template> | |||
| <div class="context-selector mr-2"> | |||
| <ff-listbox | |||
There was a problem hiding this comment.
looking a bit more carefull at the headless ui docs, the popover component would have been better suited for the task because it can be closed dynamically.
not asking for a change, leaving this here for posterity for when we add new items to the context
https://headlessui.com/v1/react/popover#closing-popovers-manually
| hasUserSelection: (state) => { | ||
| return state.selectedNodes.length | ||
| }, | ||
| hasContextSelection: (state) => { |
There was a problem hiding this comment.
Really appreciate the use of getters!
| PlusIcon | ||
| }, | ||
| props: { | ||
| modelValue: { |
There was a problem hiding this comment.
I'm not sure i follow the need for the modelValue prop, we either have the chip or not, we don't need to opt out
There was a problem hiding this comment.
then again, we could make use of it further down the line when we'll need to pass props to the chips but then the type shouldn't be boolean
| if (this.isOperatorAgent) { | ||
| return [] | ||
| } | ||
| const sc = this.getSelectedContext |
| <include-selection-button v-if="hasUserSelection && !isOperatorAgent" /> | ||
| <context-selector v-if="!isOperatorAgent" /> | ||
| <div class="context-items-container" @wheel="horizontalScrolling"> | ||
| <include-context-item v-for="(context, index) in selectedContext" :key="index" :contextItem="context" /> |
There was a problem hiding this comment.
scaling this we'd need to move this approach into a for loop to iterate over an object that has the components we'd want to inject as values instead of manually adding them each time we add a new chip
There was a problem hiding this comment.
but good enough for now, it can pe acted upon later
| if (totalEntries > MAX_DEBUG_LOG_ENTRIES) { | ||
| const excess = totalEntries - MAX_DEBUG_LOG_ENTRIES | ||
| state.debugLog.splice(0, excess) | ||
| } |
There was a problem hiding this comment.
I would have preferred a queue-esque approach, but that's just me nitpicking
Description
This pull request implements a new context selection feature in the expert chat input, allowing users to include or exclude specific context sources (like palette and debug logs) in their assistant interactions. It introduces new UI components for context selection and chips, improves the layout for displaying selected context items, and updates the Vuex store to support context options and their effects. The changes also refactor selection button components for consistency and reuse.
Context selection feature:
ContextSelector.vue) and context chips (ContextChip/index.vue,IncludeContextItem.vue) to the expert chat input, enabling users to choose which context sources (e.g., palette, debug logs) to include in assistant interactions. Chips are displayed horizontally and can be individually toggled. [1] [2] [3] [4]assistant/index.js,context/index.js) to define available context options, track selected context, and inject palette/debug log data into the context sent to the assistant when selected. [1] [2] [3]UI/UX improvements:
ContextChipcomponent, ensuring consistent appearance and behavior across context and selection chips. [1] [2]Other minor updates:
CapabilitiesSelector.vuefor clarity (min-options-widthtooptions-min-width).Related Issue(s)
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel