Commit graph

9 commits

Author SHA1 Message Date
dongmucat
738e8f8cee fix(web): stabilize frontend validation
Signed-off-by: dongmucat <1127093059@qq.com>
2026-06-10 18:00:10 +08:00
Cheney
81f7e3943f fix(web): scope legacy browser target to production build only
The top-level esbuild.target also applied to dev/test transforms, which
broke vitest suites that use top-level await (Chromium 83 / ES2020 does
not support it). Only build.target and optimizeDeps.esbuildOptions.target
need the legacy target; remove the global esbuild.target override.
2026-05-09 13:55:57 +08:00
Cheney
e869a4d365 fix(web): restore compatibility with Chromium 83 (Debian 10)
Publish page dropdowns (namespace/visibility) failed to open on older
Chromium because Vite 6 defaults build target to chrome87 and some
bundled deps call runtime APIs absent in Chrome 83 (replaceAll, .at,
hasOwn). Lower esbuild/vite target to chrome83, add browserslist, drop
??= in bootstrap, and inject runtime polyfills before main loads.
2026-05-09 13:55:50 +08:00
wowo
1b7bd06685 feat(web): add skill share button with e2e tests (#181)
* test(web): add Playwright e2e testing framework

Add Playwright for end-to-end testing with initial test suites for search flow and network error handling. Also enhance unit tests for network error scenarios.

- Add @playwright/test dependency and npm scripts
- Configure Playwright with chromium browser and HTML reporter
- Add e2e tests for search flow and network error handling
- Update .gitignore to exclude Playwright generated files
- Add network error test cases to api-error unit tests

* feat(web): add skill share button to detail page

Add share button to skill detail page that copies skill info to clipboard. Share text includes skill name, short description (max 30 chars), and detail page URL.

Closes #168

* test(web): add e2e tests for skill share button

Add Playwright e2e tests to verify share button functionality including clipboard copy, text formatting, and state transitions.

* fix(web): fix share button e2e tests and document Playwright workflow

Fix 3 issues in share-button e2e tests:
- Use authenticated mock (skill detail page requires login)
- Add publishedVersion to skill factory (ShareButton render condition)
- Mock versions/files sub-resource APIs to prevent server errors
- Adjust description assertion for 30-char truncation logic

Add Playwright E2E section to CLAUDE.md documenting commands,
screenshot behavior, and test-results directory conventions.

E2E test results: 10/10 passed (Chromium, Playwright 1.58.2)
- network-error.spec.ts:  3/3 passed
- search-flow.spec.ts:    3/3 passed
- share-button.spec.ts:   4/4 passed

* refactor(web): improve share button layout and text format

- Remove description truncation, display full text
- Change share text format from 2 lines to 3 lines (name, description, URL)
- Replace Button component with custom styled native button
- Move ShareButton from card to below download button
- Update tests to match new 3-line format

* fix(web): handle clipboard copy failure in fallback path

- Check document.execCommand('copy') return value
- Throw error when copy fails in fallback path
- Ensure error is properly caught and displayed to user

Fixes issue where "复制 Token 失败,请重试" was shown but the
underlying failure was not properly detected in the fallback code path.

* refactor(web): modernize clipboard with useCopyToClipboard hook

- Add useCopyToClipboard React hook for cleaner state management
- Migrate all copy buttons to use the new hook
- Remove repetitive useState + setTimeout patterns across 7 files
- Simplify clipboard.ts by removing excessive diagnostic logging
- Keep copyToClipboard utility for special cases (file-preview-dialog)

Benefits:
- More idiomatic React code with custom hook
- Consistent 2-second auto-reset behavior
- Reduced code duplication
- Better separation of concerns

* test(web): fix api-error tests and exclude e2e from vitest

- Set i18n language to 'zh' in api-error.test.ts beforeEach
- Add vitest config to exclude e2e directory from unit tests
- All 506 tests now pass

---------

Co-authored-by: xiose <huyanlin@nuaa.edu.cn>
2026-03-30 14:04:52 +08:00
dongmucat
44936b9b11 feat: Initialize Vite configuration for React development with path aliases, server settings, and API proxies. 2026-03-19 17:32:27 +08:00
dongmucat
d6913d28aa feat(web): refine app shell layout polish
变更摘要:

- 优化应用壳布局,统一 search 与 dashboard 的内容宽度与切换时机

- 恢复 search 与 dashboard 页面的上浮入场动画,并保留 sticky header 阴影效果

- 将本次新增前端测试收纳到 web/test/app,并纳入 TypeScript 检查范围

- 同步调整 landing quick start 文案字号与本地开发代理地址

关键文件:

- web/src/app/layout.tsx

- web/src/app/layout-main-content.ts

- web/src/app/page-shell-style.ts

- web/test/app/layout-main-content.test.ts

- web/vite.config.ts
2026-03-19 17:32:27 +08:00
dongmucat
b7fd95459c feat(web): improve skill detail overview UX and markdown highlighting 2026-03-18 16:30:21 +08:00
yun-zhi-ztl
a5d6b6246b fix(auth): localize login errors and align API error handling 2026-03-14 19:05:20 +08:00
vsxd
e6956e79fc feat(web): implement login page, dashboard, and API token management
- Login page with dynamic OAuth provider buttons from /api/v1/auth/providers
- Dashboard with AuthGuard, user info display, and token management
- TokenList component with create/delete operations via TanStack Query
- CreateTokenDialog with one-time token display and copy functionality
- API client with typed auth and token endpoints
- shadcn/ui components: Button, Card, Dialog, Table, Input, Label
- Tailwind CSS with CSS variables theming
- TanStack Router with Home, Login, Dashboard routes
- ESLint + TypeScript strict mode configuration
2026-03-12 00:13:50 +08:00