Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/kimi-web/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ All via `pnpm --filter @moonshot-ai/kimi-web …`:
- `dev:stub` — offline stub daemon (`dev/stub-daemon.mjs`).
- `build` — production build into `dist/`.
- `typecheck` — `vue-tsc --noEmit`.
- `test` — `vitest run` (jsdom; setup in `test/setup.ts`).
- `test` — `vitest run` (pure logic tests only; no jsdom / component tests).
- There is **no `lint` script** in this package; linting runs at the repo root via oxlint.

## Gotchas / hard rules
Expand Down
4 changes: 1 addition & 3 deletions apps/kimi-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pnpm -C apps/kimi-web run dev:stub # then run dev in another shell

# checks
pnpm -C apps/kimi-web run typecheck # vue-tsc --noEmit
pnpm -C apps/kimi-web run test # vitest
pnpm -C apps/kimi-web run test # vitest (pure logic only)
pnpm -C apps/kimi-web run build # vite build
```

Expand Down Expand Up @@ -62,8 +62,6 @@ server (REST + WS)
protocol (`event.*`) frames; the projector converts them to `AppEvent`s.
- **i18n** (`src/i18n/`): vue-i18n, en/zh, per-namespace flat camelCase keys.
Detect order: `localStorage('kimi-locale')` → `navigator.language` → `en`.
- **Tests**: Vitest + @vue/test-utils + jsdom, colocated under `__tests__/`.

---

## Server contract — non-obvious notes
Expand Down
2 changes: 0 additions & 2 deletions apps/kimi-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
"devDependencies": {
"@tailwindcss/vite": "^4.1.4",
"@vitejs/plugin-vue": "^5.2.4",
"@vue/test-utils": "^2.4.6",
"jsdom": "^25.0.1",
"tailwindcss": "^4.1.4",
"typescript": "6.0.2",
"vite": "^6.3.3",
Expand Down
2 changes: 1 addition & 1 deletion apps/kimi-web/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const { t } = useI18n();
const debugEnabled = isTraceEnabled();

// Narrow viewports (≤640px) render the single-column mobile shell; desktop is
// unchanged. jsdom defaults to false (desktop) so component tests are unaffected.
// unchanged. Falls back to desktop when matchMedia is unavailable.
const isMobile = useIsMobile();

// Mobile sheet visibility
Expand Down
7 changes: 3 additions & 4 deletions apps/kimi-web/src/composables/useIsMobile.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// apps/kimi-web/src/composables/useIsMobile.ts
// Reactive "is the viewport narrow (phone-sized)?" flag.
//
// Drives the App.vue desktop/mobile branch. SSR/jsdom-safe: when
// window.matchMedia is unavailable (e.g. the test environment), it defaults to
// FALSE (desktop) so existing component tests keep mounting the desktop layout.
// Drives the App.vue desktop/mobile branch. When window.matchMedia is
// unavailable, it defaults to FALSE (desktop).

import { onUnmounted, ref, type Ref } from 'vue';

Expand All @@ -18,7 +17,7 @@ const MOBILE_QUERY = `(max-width: ${MOBILE_MAX_WIDTH}px)`;
export function useIsMobile(): Ref<boolean> {
const isMobile = ref(false);

// jsdom/SSR guard: no matchMedia stay desktop (false).
// SSR / no-matchMedia guard: stay desktop (false).
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {
return isMobile;
}
Expand Down
168 changes: 0 additions & 168 deletions apps/kimi-web/test/agent-group-turns.test.ts

This file was deleted.

Loading
Loading