Skip to content

Commit 65ebb01

Browse files
committed
Make on_toggle_starred and on_label_click mandatory props for the Timeline component and increase the separator height in the Home panel
1 parent 798fab6 commit 65ebb01

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

‎packages/ui/src/components/editor/panel/Timeline/Timeline.stories.tsx‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ export const SingleItem = () => (
7474
backgroundColor: 'var(--vscode-sideBar-background)'
7575
}}
7676
>
77-
<Timeline items={[initialItems[0]]} />
77+
<Timeline
78+
items={[initialItems[0]]}
79+
on_toggle_starred={() => {}}
80+
on_label_click={(id) => alert(`Restore checkpoint: ${id}`)}
81+
/>
7882
</div>
7983
)
8084

@@ -94,6 +98,8 @@ export const NoDescription = () => (
9498
is_starred: false
9599
}
96100
]}
101+
on_toggle_starred={() => {}}
102+
on_label_click={(id) => alert(`Restore checkpoint: ${id}`)}
97103
/>
98104
</div>
99105
)

‎packages/ui/src/components/editor/panel/Timeline/Timeline.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export type TimelineItemProps = {
1717

1818
type Props = {
1919
items: TimelineItemProps[]
20-
on_toggle_starred?: (id: string | number) => void
21-
on_label_click?: (id: string | number) => void
20+
on_toggle_starred: (id: string | number) => void
21+
on_label_click: (id: string | number) => void
2222
}
2323

2424
export const Timeline: React.FC<Props> = ({
@@ -61,7 +61,8 @@ export const Timeline: React.FC<Props> = ({
6161
<div className={styles.item__content}>
6262
<div
6363
className={styles.item__content__label}
64-
onClick={() => on_label_click?.(item.id)}
64+
onClick={() => on_label_click(item.id)}
65+
title="Restore checkpoint"
6566
>
6667
{item.label}
6768
</div>

‎packages/vscode/src/views/panel/frontend/Home/Home.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const Home: React.FC<Props> = (props) => {
8585
on_click={props.on_api_calls_click}
8686
/>
8787
</div>
88-
<Separator height={12} />
88+
<Separator height={16} />
8989
<div className={styles.inner__timeline}>
9090
<Timeline
9191
items={props.checkpoints.map((c) => ({

‎packages/vscode/src/views/settings/frontend/Home/Home.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export const Home: React.FC<Props> = (props) => {
172172

173173
const nav_item_ids = NAV_ITEMS_CONFIG.filter(
174174
(item): item is Extract<NavConfigItem, { type: 'item' }> =>
175-
item.type === 'item'
175+
item.type == 'item'
176176
).map((item) => item.id)
177177
const active_nav_item_id =
178178
nav_item_ids.filter((id) => stuck_sections.has(id)).pop() || nav_item_ids[0]

0 commit comments

Comments
 (0)