* 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>
* fix(scanner): migrate scan stream to redisson
* fix(web): update security audit pending labels
* fix(scanner): support redis sentinel in redisson config
* fix(db): allow deleting skill versions with audit history
* fix(publish): flush replaced versions before recreation
* fix(i18n): localize agent setup command in Chinese locale
Translate the agent quick-start prompt from English to Chinese and add
a test to verify both locale strings.
* fix(clipboard): add fallback for insecure contexts
navigator.clipboard is undefined in HTTP/iframe/WebView contexts,
causing TypeError on copy. Extract copyToClipboard() utility with
execCommand fallback and apply across all 6 call sites.
- Reset form fields and mutation state when create-token dialog reopens
- Fix delete pagination: check items.length === 0 (post-delete) instead of 1
- Restrict skill download to PUBLISHED versions only
Add responsive text wrapping and overflow handling to token-related
components to prevent layout breaking with long token names or descriptions.
Changes:
- Add min-w-0 to dialog headers to allow flex shrinking
- Add break-all/break-words to prevent text overflow
- Add overflow-hidden to token display container
- Apply max-w-48 constraint to token name column
- Add sticky header with LanguageSwitcher and UserMenu to landing page
- Update token dialog and i18n translations
- Fix dev process script and compose release config
- Remove stale skillhub submodule reference
Replace hardcoded Chinese strings with t() calls across 36 files.
Expand translation keys from ~160 to 412 covering all pages, features,
and shared components. Fix date formatting to use dynamic i18n locale.
- Add ApiError class with status code for structured error handling
- Add global QueryCache/MutationCache error handlers with auto-toast
- Auto-redirect to login on 401, show appropriate messages for 403/404/5xx
- Add i18n to review-detail.tsx, token-list.tsx, confirm-dialog.tsx
- Add review, token, apiError translation keys to zh.json and en.json
- Added sonner toast library for notifications
- Created Toaster component with custom styling
- Created toast utility with success/error/warning/info methods
- Created ConfirmDialog component for confirmations
- Replaced browser alert() with toast notifications in:
- Publish page: added review notice and toast feedback
- Token list: replaced confirm() with ConfirmDialog
- Review detail: replaced alert/confirm with toast and dialogs
- Added review notice in publish page explaining admin approval process
- Improved user experience with in-page notifications instead of browser popups
Database changes:
- Added SKILL_ADMIN role to user usr_da52079c-3329-4a5c-a631-8eadfb865a79