Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Commit c206b7c

Browse files
committed
feat: add mobile back button to SubTaskDetailPanel
- Introduced a mobile back button in the SubTaskDetailPanel for improved navigation on mobile devices. - Utilized the new ArrowLeftIcon for the back button, enhancing the user interface. - Integrated responsive design by conditionally rendering the button based on the device type. These changes aim to enhance user experience by providing a clear navigation option on mobile screens. Signed-off-by: Innei <tukon479@gmail.com>
1 parent ecc5c6a commit c206b7c

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

src/views/ai/tasks.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import {
77
AlertCircle as AlertCircleIcon,
88
AlertTriangle as AlertTriangleIcon,
9+
ArrowLeft as ArrowLeftIcon,
910
CheckCircle as CheckCircleIcon,
1011
ChevronDown as ChevronDownIcon,
1112
ChevronRight as ChevronRightIcon,
@@ -43,7 +44,10 @@ import { useQuery, useQueryClient } from '@tanstack/vue-query'
4344

4445
import { aiApi, AITaskStatus, AITaskType } from '~/api/ai'
4546
import { HeaderActionButton } from '~/components/button/header-action-button'
46-
import { MasterDetailLayout } from '~/components/layout/master-detail-layout'
47+
import {
48+
MasterDetailLayout,
49+
useMasterDetailLayout,
50+
} from '~/components/layout/master-detail-layout'
4751
import { SplitPanelLayout } from '~/components/layout/split-panel-layout'
4852
import { RelativeTime } from '~/components/time/relative-time'
4953
import { queryKeys } from '~/hooks/queries/keys'
@@ -1046,6 +1050,7 @@ const SubTaskDetailPanel = defineComponent({
10461050
},
10471051
setup(props) {
10481052
const queryClient = useQueryClient()
1053+
const { isMobile } = useMasterDetailLayout()
10491054
const StatusIcon = computed(() => TaskStatusIcons[props.task.status])
10501055

10511056
const title = computed(() => {
@@ -1083,7 +1088,21 @@ const SubTaskDetailPanel = defineComponent({
10831088
return () => (
10841089
<NScrollbar class="h-full">
10851090
<div class="p-3">
1086-
{/* Header with back button on mobile */}
1091+
{/* Mobile back button */}
1092+
{isMobile.value && props.onBack && (
1093+
<div class="mb-3">
1094+
<button
1095+
type="button"
1096+
class="flex items-center gap-1.5 text-sm text-neutral-600 transition-colors hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100"
1097+
onClick={props.onBack}
1098+
>
1099+
<ArrowLeftIcon class="size-4" aria-hidden="true" />
1100+
返回列表
1101+
</button>
1102+
</div>
1103+
)}
1104+
1105+
{/* Header */}
10871106
<div class="mb-3 flex items-start gap-2">
10881107
<StatusIcon.value />
10891108
<div class="min-w-0 flex-1">

0 commit comments

Comments
 (0)