Conversation
📝 WalkthroughWalkthroughThis PR simplifies event handling by removing component/instance injections and blueprint checks from the dataframe/tag components and the dataframe value broker; the broker now accepts only an emitter element and table, and events are emitted unconditionally. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant TagComponent as Tag Component
participant DataframeComponent as Dataframe Component
participant Broker as useDataFrameValueBroker
participant Host as Host Element / Parent
rect rgba(135,206,250,0.5)
TagComponent->>Broker: tag click -> handler (emitterEl)
Broker->>Host: dispatchEvent('wf-tag-click', payload)
end
rect rgba(144,238,144,0.5)
DataframeComponent->>Broker: cell/edit/add/action -> handler (emitterEl, table)
Broker->>Host: dispatchEvent('wf-dataframe-event', payload)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/ui/src/components/core/content/CoreDataframe/useDataframeValueBroker.ts (1)
44-48: Missing null check fortable.valueinhandlerAddRow.Unlike
handlerActionRow(line 82) andhandlerUpdateCell(line 103), this function accessestable.value.numRows()without first checking iftable.valueis null. This inconsistency could cause a runtime error if called before the table is initialized.🐛 Proposed fix
async function handlerAddRow() { const eventType = "wf-dataframe-add"; + if (!table.value) throw Error("Table is not ready"); const rowIndex = table.value.numRows();
🤖 Fix all issues with AI agents
In `@src/ui/src/components/core/content/CoreTags.vue`:
- Line 176: CoreTags.vue currently sets cursor: pointer unconditionally on tags
causing non-interactive tags to appear clickable; change the template/style to
apply cursor: pointer only when a click handler is present (e.g., check for the
wf-tag-click listener or a prop like clickable) and fall back to default cursor
otherwise. Locate the tag element and update its binding (use a conditional
class or inline style tied to the presence of $listeners['wf-tag-click'] or a
boolean prop) so the cursor is pointer only when wf-tag-click is registered or
when the component's clickable flag is true.
| align-items: center; | ||
| gap: 4px; | ||
| cursor: v-bind("isClickable ? 'pointer' : 'auto'"); | ||
| cursor: pointer; |
There was a problem hiding this comment.
Cursor is now always pointer, even without a registered handler.
Previously, the cursor style was conditional on whether a click handler was registered. Now tags always display a pointer cursor, which may mislead users into expecting interactivity when no wf-tag-click handler is attached.
Consider whether this UX change is intentional or if you want to retain conditional cursor styling through a different mechanism (e.g., a field option to enable/disable clickability).
🤖 Prompt for AI Agents
In `@src/ui/src/components/core/content/CoreTags.vue` at line 176, CoreTags.vue
currently sets cursor: pointer unconditionally on tags causing non-interactive
tags to appear clickable; change the template/style to apply cursor: pointer
only when a click handler is present (e.g., check for the wf-tag-click listener
or a prop like clickable) and fall back to default cursor otherwise. Locate the
tag element and update its binding (use a conditional class or inline style tied
to the presence of $listeners['wf-tag-click'] or a boolean prop) so the cursor
is pointer only when wf-tag-click is registered or when the component's
clickable flag is true.
ea7f0ec to
197c4a8
Compare
Summary by CodeRabbit
Refactor
Style
✏️ Tip: You can customize this high-level summary in your review settings.