Skip to content

Commit 2623a1b

Browse files
committedOct 29, 2024·
fix(timeline): hide switcher in internal timeline panel and exclude internal timeline events to prevent triggering
1 parent e7d9d45 commit 2623a1b

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed
 

‎packages/applet/src/components/timeline/index.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ const props = withDefaults(defineProps<{
1919
docLink: string
2020
githubRepoLink?: string
2121
headerVisible?: boolean
22+
switcherVisible?: boolean
2223
}>(), {
2324
headerVisible: true,
25+
switcherVisible: true,
2426
})
2527
2628
const { expanded: expandedStateNodes } = createExpandedContext('timeline-state')
@@ -143,7 +145,7 @@ function toggleRecordingState() {
143145
No events
144146
</Empty>
145147

146-
<div class="absolute right-3 top-12 flex items-center justify-end b-1 border-base rounded-1 b-solid px2 py1">
148+
<div v-if="switcherVisible" class="absolute right-3 top-12 flex items-center justify-end b-1 border-base rounded-1 b-solid px2 py1">
147149
<div class="flex items-center gap-2 px-1">
148150
<div v-tooltip.bottom-end="{ content: recordingTooltip }" class="flex items-center gap1" @click="toggleRecordingState">
149151
<span v-if="recordingState" class="recording recording-btn bg-[#ef4444]" />

‎packages/client/src/pages/timeline.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function toggleTimelineLayer() {
8585
</Pane>
8686
<Pane relative h-full size="65">
8787
<div class="h-full flex flex-col p2">
88-
<Timeline ref="timelineRef" :layer-ids="[activeTimelineLayer]" :header-visible="false" doc-link="" />
88+
<Timeline ref="timelineRef" :layer-ids="[activeTimelineLayer]" :header-visible="false" doc-link="" plugin-id="" :switcher-visible="false" />
8989
</div>
9090
</Pane>
9191
</Splitpanes>

‎packages/devtools-kit/src/ctx/hook.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ export function createDevToolsCtxHooks() {
335335

336336
// add timeline event
337337
hooks.hook(DevToolsContextHookKeys.TIMELINE_EVENT_ADDED, ({ options, plugin }) => {
338-
if (devtoolsState.highPerfModeEnabled || !devtoolsState.timelineLayersState?.[plugin.descriptor.id])
338+
const internalLayerIds = ['performance', 'component-event', 'keyboard', 'mouse']
339+
if (devtoolsState.highPerfModeEnabled || (!devtoolsState.timelineLayersState?.[plugin.descriptor.id] && !internalLayerIds.includes(options.layerId)))
339340
return
340341
// @ts-expect-error hookable
341342
hooks.callHookWith(async (callbacks) => {

0 commit comments

Comments
 (0)
Please sign in to comment.