Skip to content

Commit e7830bc

Browse files
committed
Refactors range selection highlighting to use prop-based approach
Replaces CSS class-based highlighting with a dedicated highlighted prop for better component encapsulation and maintainability. Removes custom CSS styling and ESLint disable comment while consolidating the highlighting logic into the component's prop system.
1 parent 411237f commit e7830bc

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

client/src/components/Workflow/List/WorkflowCard.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ interface Props {
2323
selected?: boolean;
2424
selectable?: boolean;
2525
clickable?: boolean;
26+
highlighted?: boolean;
2627
}
2728
2829
const props = withDefaults(defineProps<Props>(), {
@@ -36,6 +37,7 @@ const props = withDefaults(defineProps<Props>(), {
3637
selected: false,
3738
selectable: false,
3839
clickable: false,
40+
highlighted: false,
3941
});
4042
4143
const emit = defineEmits<{
@@ -126,7 +128,6 @@ function onKeyDown(event: KeyboardEvent) {
126128
</script>
127129

128130
<template>
129-
<!-- eslint-disable-next-line vuejs-accessibility/click-events-have-key-events, vuejs-accessibility/no-static-element-interactions -->
130131
<GCard
131132
:id="workflow.id"
132133
class="workflow-card"
@@ -151,6 +152,7 @@ function onKeyDown(event: KeyboardEvent) {
151152
:update-time="workflow.update_time"
152153
:bookmarked="!!workflow.show_in_tool_panel"
153154
:clickable="props.clickable"
155+
:highlighted="props.highlighted"
154156
@bookmark="() => toggleBookmark(!workflow?.show_in_tool_panel)"
155157
@rename="emit('rename', props.workflow.id, props.workflow.name)"
156158
@select="emit('select', workflow)"

client/src/components/Workflow/List/WorkflowCardList.vue

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ const workflowPublished = ref<InstanceType<typeof WorkflowPublished>>();
109109
:compact="props.compact"
110110
:current="workflow.id === props.currentWorkflowId"
111111
:clickable="props.clickable"
112+
:highlighted="props.rangeSelectAnchor?.id === workflow.id"
112113
class="workflow-card-in-list"
113-
:class="{ 'range-select-anchor-workfow': props.rangeSelectAnchor?.id === workflow.id }"
114114
@select="(...args) => emit('select', ...args)"
115115
@tagClick="(...args) => emit('tagClick', ...args)"
116116
@refreshList="(...args) => emit('refreshList', ...args)"
@@ -170,12 +170,5 @@ const workflowPublished = ref<InstanceType<typeof WorkflowPublished>>();
170170
171171
.workflow-card-list {
172172
container: cards-list / inline-size;
173-
.workflow-card-in-list {
174-
&.range-select-anchor-workfow {
175-
&:deep(.g-card-content) {
176-
box-shadow: 0 0 0 0.2rem transparentize($brand-primary, 0.75);
177-
}
178-
}
179-
}
180173
}
181174
</style>

0 commit comments

Comments
 (0)