Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

feat(pet): adjust the directory and optimize the style

hairyf740bb332282a
diff --git a/src/components/toast-provider.tsx b/src/components/toast-provider.tsx
index fd840726..94e386d6 100644
--- a/src/components/toast-provider.tsx
+++ b/src/components/toast-provider.tsx
@@ -47,7 +47,7 @@ export function ToastProvider(props: ToastProviderProps) {
<Spinner color="current" size="sm" />
</Toast.Indicator>
</If>
- <Toast.Content>
+ <Toast.Content className="overflow-hidden">
<If cond={content?.title !== undefined}>
<Toast.Title>{content?.title}</Toast.Title>
</If>
diff --git a/src/pet/app.tsx b/src/pet/app.tsx
index b53a6a8c..f01fc973 100644
--- a/src/pet/app.tsx
+++ b/src/pet/app.tsx
@@ -4,11 +4,11 @@ import { useWatch } from '@hairy/react-lib'
import { useRef } from 'react'
import { ToastProvider } from '@/components/toast-provider'
import { Pet } from './components/pet'
+import { isLoopingAnimation } from './config'
import { useBubble } from './hooks/use-bubble'
import { useDrag } from './hooks/use-drag'
import { useOmitIgnoreCursorEvents } from './hooks/use-omit-ignore-cursor-events'
import { usePet } from './hooks/use-pet'
-import { isLoopingAnimation } from './pet-config'
/** 拖拽方向 → 动画状态:桌面宠物在原生拖拽期间播放对应的移动动画。 */
const DRAW_STATUS: Record<DragDirection, PetStatus> = {
@@ -53,7 +53,13 @@ export function App() {
与 dsh-pet .dsh-pet-hit 一致的唯一可交互命中区。useDrag 负责拖拽/双击,
useOmitIgnoreCursorEvents 负责穿透恢复,调用方无需管理鼠标流和窗口几何。 */}
<div className="pointer-events-none h-full w-full touch-none select-none">
- <Pet status={drawStatus} dragging={dragging} clickCount={clickCount} hitboxRef={dragRef} ref={petRef} />
+ <Pet
+ status={drawStatus}
+ dragging={dragging}
+ clickCount={clickCount}
+ hitboxRef={dragRef}
+ ref={petRef}
+ />
</div>
</ToastProvider>
)
diff --git a/src/pet/components/pet.tsx b/src/pet/components/pet.tsx
index dd0ce119..b4900cd2 100644
--- a/src/pet/components/pet.tsx
+++ b/src/pet/components/pet.tsx
@@ -1,12 +1,11 @@
import type { CSSProperties, Ref, RefObject, SyntheticEvent } from 'react'
+import type { PetAnimationTarget, PetConfig } from '../config'
import type { PetHandle, PetStatus } from '../hooks/use-pet'
-import type { PetAnimationTarget, PetConfig } from '../pet-config'
import { invoke } from '@tauri-apps/api/core'
import { listen } from '@tauri-apps/api/event'
import { getCurrentWindow, LogicalSize } from '@tauri-apps/api/window'
import { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'
import { If } from 'react-if-lite'
-import { PET_STATUSES } from '../hooks/use-pet'
import {
fallbackPresetName,
isLoopingAnimation,
@@ -17,7 +16,8 @@ import {
rollKind,
shouldReloadAnimation,
spriteStatusFallback,
-} from '../pet-config'
+} from '../config'
+import { PET_STATUSES } from '../hooks/use-pet'
const PET_BASE_WIDTH = 220
/** 已安装预设被清理/未安装时的提示文案:桌宠窗口无 i18n 基础设施(气泡文案同样硬编码),按窗口语言就近显示。 */
diff --git a/src/pet/pet-config.test.ts b/src/pet/config/index.test.ts
similarity index 99%
rename from src/pet/pet-config.test.ts
rename to src/pet/config/index.test.ts
index 561c24c8..a131dbef 100644
--- a/src/pet/pet-config.test.ts
+++ b/src/pet/config/index.test.ts
@@ -1,4 +1,4 @@
-import type { PetAnimationTarget, PetCategory, PetWeights } from './pet-config'
+import type { PetAnimationTarget, PetCategory, PetWeights } from './'
import { describe, expect, it, vi } from 'vitest'
import {
fallbackPresetName,
@@ -11,7 +11,7 @@ import {
rollKind,
shouldReloadAnimation,
spriteStatusFallback,
-} from './pet-config'
+} from './'
const WEIGHTS: PetWeights = { idle: 10, turn: 5, move: 5 }
diff --git a/src/pet/pet-config.ts b/src/pet/config/index.ts
similarity index 100%
rename from src/pet/pet-config.ts
rename to src/pet/config/index.ts
diff --git a/src/pet/main.css b/src/pet/main.css
index 9d2684d2..5f5f29bc 100644
--- a/src/pet/main.css
+++ b/src/pet/main.css
@@ -7,7 +7,7 @@
- 整体下移一点,避免贴顶挤占宠物视野;
- 宽度收窄约 10%(toast.css 默认 w-[calc(100vw-2rem)])。 */
.toast-region--top-end {
- top: 2.5rem;
+ top: 0;
}
.toast-region {