Sprint 1 - 安全基线修复(5项): - 修复 DOM XSS 漏洞(seal-library.js, batch-processing.js) - 修复 settings 导入 schema 注入 - CDN 锁版本 + SRI 完整性校验 - 外链添加 rel="noopener noreferrer" - 替换 confirm/prompt 为自定义对话框 Sprint 2 - 状态管理重构(4项): - 新建 state.js 单例模式管理全局状态 - 解耦 window.* 全局变量 - 修复印章库状态同步 bug - localStorage 添加错误处理 Sprint 3 - 性能优化(4项): - 删除死代码(loadScript, cleanupDistantCanvases 等) - 实现缩略图懒加载(前3页+可视区) - 添加文件大小限制(PDF 50MB / 图片 5MB) - 完善 Canvas 内存清理 修复总计: 13项(3 P0 + 3 P1 + 6 P2 + 1 P3) [CC] [CX]
3.6 KiB
3.6 KiB
Toast Notification System - Test Checklist
Test Environment
- Server: http://localhost:8000
- Test Page: http://localhost:8000/test-toast.html
- Main App: http://localhost:8000/index.html
Manual Test Cases
1. Basic Toast Display
- Success toast displays with green border and checkmark icon
- Error toast displays with red border and X icon
- Warning toast displays with yellow border and warning icon
- Info toast displays with blue border and info icon
2. Toast Animations
- Toast slides in from right smoothly
- Toast slides out to right when dismissed
- Animation duration is appropriate (~300ms)
3. Auto-Dismiss Functionality
- Success toast auto-dismisses after ~3 seconds
- Error toast auto-dismisses after ~5 seconds
- Warning toast auto-dismisses after ~3 seconds
- Info toast auto-dismisses after ~3 seconds
4. Manual Close
- Close button (×) is visible and clickable
- Clicking close button dismisses toast immediately
- Close button hover state works
5. Multiple Toasts
- Multiple toasts stack vertically
- Toasts maintain 10px gap between them
- New toasts appear at bottom of stack
- Dismissing one toast doesn't affect others
6. Long Messages
- Long messages wrap correctly
- Toast width adjusts appropriately (max 500px)
- Text remains readable
7. Integration with Main App
- PDF file validation errors show error toast
- PDF file too large shows error toast with size info
- Seal image validation errors show error toast
- Seal image loaded successfully shows success toast
- PDF loaded successfully shows success toast
- Add seal without seal image shows warning toast
- Add straddle seal without seal shows warning toast
- Delete seal without selection shows warning toast
- Export PDF success shows success toast
- Export PDF with no seals shows warning toast
8. Edge Cases
- Rapid clicking doesn't break toast system
- Clear all toasts works correctly
- Toast container is created only once
- No memory leaks after many toasts
Test Results
Test Page (test-toast.html)
Date: 2026-01-08 Status: ⏳ Pending manual testing
Instructions:
- Open http://localhost:8000/test-toast.html
- Click each button and verify the toast appears correctly
- Test multiple toasts by clicking "Test Multiple Toasts"
- Test long message display
- Test manual close button
- Test "Clear All Toasts" button
Main Application (index.html)
Date: 2026-01-08 Status: ⏳ Pending manual testing
Instructions:
- Open http://localhost:8000/index.html
- Try uploading a PDF file > 50MB (should show error toast)
- Try uploading a valid PDF (should show success toast)
- Try uploading an image > 5MB as seal (should show error toast)
- Try uploading a valid seal image (should show success toast)
- Try adding seal without selecting seal image (should show warning toast)
- Try deleting seal without selection (should show warning toast)
- Try exporting PDF without seals (should show warning toast)
- Complete full workflow and export PDF (should show success toast)
Code Review Checklist
- notifications.js loaded before main.js in index.html
- All alert() calls replaced with Toast methods
- Toast CSS styles added to style.css
- Toast container positioned correctly (fixed, top-right)
- Z-index high enough (10000) to appear above all content
- No console errors in browser
Notes
- Server started on port 8000
- Test page created for isolated testing
- All 12 alert() calls in main.js have been replaced
- Toast system uses window.Toast global object