Skip to content

Commit 9adab69

Browse files
committed
feat: add idle hint functionality and enhance panel transition effects
1 parent a2cf9eb commit 9adab69

File tree

1 file changed

+30
-2
lines changed
  • packages/extension/entrypoints/ui

1 file changed

+30
-2
lines changed

packages/extension/entrypoints/ui/App.vue

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang="ts">
2+
import { useIdle, useTimeoutFn } from '@vueuse/core'
3+
24
import Badge from '@/components/Badge.vue'
35
import IconButton from '@/components/IconButton.vue'
46
import Minus from '@/components/icons/Minus.vue'
@@ -16,6 +18,8 @@ import { options, runtimeMode } from '@/ui/state'
1618
useSelection()
1719
useKeyLock()
1820
21+
const HINT_IDLE_MS = 10000
22+
1923
function toggleMinimized() {
2024
options.value.minimized = !options.value.minimized
2125
}
@@ -56,6 +60,21 @@ const mcpBadgeActiveClass = computed(() =>
5660
isMcpConnected.value ? (selfActive.value ? 'tp-mcp-badge-active' : 'tp-mcp-badge-inactive') : null
5761
)
5862
63+
const showHint = ref(true)
64+
const initialLock = ref(true)
65+
const { idle } = useIdle(HINT_IDLE_MS, {
66+
initialState: true
67+
})
68+
69+
watch(idle, (isIdle) => {
70+
showHint.value = isIdle || initialLock.value
71+
})
72+
73+
useTimeoutFn(() => {
74+
initialLock.value = false
75+
showHint.value = idle.value
76+
}, 3000)
77+
5978
function activateMcp() {
6079
if (isMcpConnected.value) {
6180
activate()
@@ -64,7 +83,10 @@ function activateMcp() {
6483
</script>
6584

6685
<template>
67-
<Panel class="tp-main" :class="{ 'tp-main-minimized': options.minimized }">
86+
<Panel
87+
class="tp-main"
88+
:class="{ 'tp-main-minimized': options.minimized, 'tp-main-hint': showHint }"
89+
>
6890
<template #header>
6991
<div class="tp-row tp-gap-l">
7092
<span>TemPad Dev</span>
@@ -108,14 +130,20 @@ function activateMcp() {
108130

109131
<style scoped>
110132
.tp-main {
111-
transition: height 0.2s cubic-bezier(0.87, 0, 0.13, 1);
133+
transition:
134+
height 0.2s cubic-bezier(0.87, 0, 0.13, 1),
135+
box-shadow 0.2s ease;
112136
}
113137
114138
.tp-main-minimized {
115139
height: 41px;
116140
border-bottom-width: 0;
117141
}
118142
143+
.tp-main-hint {
144+
box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 30%, var(--color-bg) 30%);
145+
}
146+
119147
.tp-main.tp-panel-dragging,
120148
.tp-main.tp-panel-resizing {
121149
transition: none;

0 commit comments

Comments
 (0)