Skip to content

Conversation

@fsouris
Copy link
Collaborator

@fsouris fsouris commented Jan 9, 2026

No description provided.

const keys = path.split('.')
const { parent, lastKey } = traversePath(result, keys)

/* eslint-disable security/detect-object-injection */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Comment on lines +115 to +126
const props = withDefaults(defineProps<GanttChartComponentProps>(), {
dateRange: () => [],
rows: () => [],
links: () => [],
headerLabel: 'gantt_chart.header',
viewMode: 'day',
showWeekendShading: true,
stackMiniActivities: true,
activityTooltip: undefined,
activityClick: undefined,
leftHeaderWidthPx: 320,
})
Copy link
Contributor

@srozen srozen Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why LLM's are stuck with this old definition of props with default values 😆

The new way of doing that is like this:

const { viewMode = 'day', ... } = defineProps<GanttChartComponentProps>()

Beware that use of these props in the code will have to remove the props prefix

emit('activityClick', activity, rowData)
}
const viewMode = computed(() => props.viewMode ?? 'day')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This specific computed value should then disappear as a default viewMode will be destructured from the above props definition :)

}
const props = withDefaults(defineProps<GanttChartComponentProps>(), {
dateRange: () => [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be directly the array of dates?
I would more expect the API of this Gantt to ask for a startDate and endDate and then compute this range.

I am not 100% sure at this stage of my review but as many other thing place themselves based on an offset starting from the start_date, if you give a weird daterange with missing values, the elements like activities could position themselves and rekt the layout 😄

Comment on lines +41 to +50
<GanttChartRowsList
:list="list"
:row-heights="rowHeights"
:date-range="props.dateRange"
:view-mode="viewMode"
:show-weekend-shading="props.showWeekendShading"
:stack-mini-activities="props.stackMiniActivities"
:activity-tooltip="props.activityTooltip"
:left-header-width-px="props.leftHeaderWidthPx"
mode="labels"
Copy link
Contributor

@srozen srozen Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was at first ok with this but now I analyze this closer, many props does not apply at all to this label list like:

  • activity-tooltip
  • stack-mini-activities
  • show-weekend-shading

Maybe we should consider split in distinct sub components instead of using the same one

Comment on lines +12 to +30
<GanttChartHeader
:date-range="props.dateRange"
:view-mode="viewMode"
:header-label="props.headerLabel"
:left-header-width-px="props.leftHeaderWidthPx"
:show-grid="false"
/>
</div>
</template>
<template #header-right>
<div ref="gantt-header" class="w-full">
<GanttChartHeader
:date-range="props.dateRange"
:view-mode="viewMode"
:header-label="props.headerLabel"
:left-header-width-px="props.leftHeaderWidthPx"
:show-left-header="false"
/>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here with reuse, the header-left is really a dummy spacing element to align properly the dates indicators of the header-right yet they reuse the same component with a large chunk of things header-left probably does not care.

I would advocate to split

@@ -0,0 +1,62 @@
<template>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add comments to explain the purpose of this component

Comment on lines +5 to +12
v-if="props.showLeftHeader"
class="left-0 flex shrink-0 sticky z-60 justify-center items-center box-border border-r border-b border-surface-200 bg-surface-50 text-surface-900 font-semibold h-full"
:style="{ width: `${props.leftHeaderWidthPx}px` }"
>
{{ t(props.headerLabel) }}
</div>
<!-- Headers -->
<div v-if="props.showGrid" class="flex flex-col">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As said elsewhere, from what I get is those 2 v-if are in fact exclusives?
And thus a split of component would make sense

Copy link
Contributor

@srozen srozen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Berry nice

@@ -0,0 +1,98 @@
<template>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a small explanation over the SVG creation logic here would be cool 😄

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.

4 participants