Skip to content

Commit 519d1f8

Browse files
committed
refactor(process): extract shared timeline list pane for desktop and mobile
- add ProcessTimelineListPane to centralize NodeTimelineList props/events/defaults - migrate ProcessDesktopPane to use the shared timeline pane - migrate ProcessMobilePane to use the shared timeline pane with mobile-specific overrides
1 parent 1de7066 commit 519d1f8

3 files changed

Lines changed: 64 additions & 12 deletions

File tree

src/views/process/components/ProcessDesktopPane.vue

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import ProcessDesktopLayoutShell from './ProcessDesktopLayoutShell.vue'
33
import TaskListPanel from './TaskListPanel.vue'
44
import ProcessTimelineToolbar from './ProcessTimelineToolbar.vue'
55
import NodeNavPanel from './NodeNavPanel.vue'
6-
import NodeTimelineList from './NodeTimelineList.vue'
6+
import ProcessTimelineListPane from './ProcessTimelineListPane.vue'
77
import type { NodeInfo, TaskInfo } from '../../../types'
88
import type { NodeNavViewItem } from '../composables/useNodeNavSearch'
99
import type { VNodeChild } from 'vue'
@@ -124,17 +124,13 @@ const emit = defineEmits<{
124124
</template>
125125

126126
<template #timeline-list>
127-
<node-timeline-list
128-
:nodes="currentNodes"
127+
<process-timeline-list-pane
128+
:current-nodes="currentNodes"
129129
:selected-task-key="selectedTaskKey"
130130
:display-mode="displayMode"
131131
:is-vscode-launch-embed="isVscodeLaunchEmbed"
132132
:bridge-request-task-doc="bridgeRequestTaskDoc"
133133
:bridge-reveal-task="bridgeRevealTask"
134-
item-padding="12px"
135-
scroller-style="height: 100%"
136-
wrapper-style="height: 100%; display: flex; flex-direction: column; position: relative"
137-
:capture-wheel-up="true"
138134
@manual-scroll-up="emit('manual-scroll-up')"
139135
@scroller-mounted="emit('scroller-mounted', $event)"
140136
@select-node="emit('select-node', $event)"

src/views/process/components/ProcessMobilePane.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import NodeTimelineList from './NodeTimelineList.vue'
2+
import ProcessTimelineListPane from './ProcessTimelineListPane.vue'
33
import type { NodeInfo } from '../../../types'
44
55
type NodeTimelineItem = NodeInfo & { _uniqueKey: string }
@@ -24,17 +24,15 @@ const emit = defineEmits<{
2424
</script>
2525

2626
<template>
27-
<node-timeline-list
28-
:nodes="props.currentNodes"
27+
<process-timeline-list-pane
28+
:current-nodes="props.currentNodes"
2929
:selected-task-key="props.selectedTaskKey"
3030
:display-mode="props.displayMode"
3131
:is-vscode-launch-embed="props.isVscodeLaunchEmbed"
3232
:bridge-request-task-doc="props.bridgeRequestTaskDoc"
3333
:bridge-reveal-task="props.bridgeRevealTask"
3434
item-padding="8px 4px"
35-
scroller-style="height: 100%"
3635
wrapper-style="flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative"
37-
:capture-wheel-up="true"
3836
@scroller-mounted="emit('scroller-mounted', $event)"
3937
@manual-scroll-up="emit('manual-scroll-up')"
4038
@select-node="emit('select-node', $event)"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<script setup lang="ts">
2+
import NodeTimelineList from './NodeTimelineList.vue'
3+
import type { NodeInfo } from '../../../types'
4+
5+
type NodeTimelineItem = NodeInfo & { _uniqueKey: string }
6+
7+
const props = withDefaults(defineProps<{
8+
currentNodes: NodeTimelineItem[]
9+
selectedTaskKey?: string | null
10+
displayMode: string
11+
isVscodeLaunchEmbed?: boolean
12+
bridgeRequestTaskDoc?: ((task: string) => Promise<string | null>) | null
13+
bridgeRevealTask?: ((task: string) => Promise<void>) | null
14+
itemPadding?: string
15+
scrollerStyle?: string
16+
wrapperStyle?: string
17+
captureWheelUp?: boolean
18+
}>(), {
19+
selectedTaskKey: null,
20+
isVscodeLaunchEmbed: false,
21+
bridgeRequestTaskDoc: null,
22+
bridgeRevealTask: null,
23+
itemPadding: '12px',
24+
scrollerStyle: 'height: 100%',
25+
wrapperStyle: 'height: 100%; display: flex; flex-direction: column; position: relative',
26+
captureWheelUp: true,
27+
})
28+
29+
const emit = defineEmits<{
30+
'scroller-mounted': [scroller: object | null]
31+
'manual-scroll-up': []
32+
'select-node': [node: NodeInfo]
33+
'select-action': [node: NodeInfo]
34+
'select-recognition': [node: NodeInfo, attemptIndex: number]
35+
'select-flow-item': [node: NodeInfo, flowItemId: string]
36+
}>()
37+
</script>
38+
39+
<template>
40+
<node-timeline-list
41+
:nodes="props.currentNodes"
42+
:selected-task-key="props.selectedTaskKey"
43+
:display-mode="props.displayMode"
44+
:is-vscode-launch-embed="props.isVscodeLaunchEmbed"
45+
:bridge-request-task-doc="props.bridgeRequestTaskDoc"
46+
:bridge-reveal-task="props.bridgeRevealTask"
47+
:item-padding="props.itemPadding"
48+
:scroller-style="props.scrollerStyle"
49+
:wrapper-style="props.wrapperStyle"
50+
:capture-wheel-up="props.captureWheelUp"
51+
@scroller-mounted="emit('scroller-mounted', $event)"
52+
@manual-scroll-up="emit('manual-scroll-up')"
53+
@select-node="emit('select-node', $event)"
54+
@select-action="emit('select-action', $event)"
55+
@select-recognition="(node, attemptIndex) => emit('select-recognition', node, attemptIndex)"
56+
@select-flow-item="(node, flowItemId) => emit('select-flow-item', node, flowItemId)"
57+
/>
58+
</template>

0 commit comments

Comments
 (0)