-
Notifications
You must be signed in to change notification settings - Fork 2
Update #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update #15
Conversation
…embed-frame 及 iframe 高度,增强响应式断点\n- JS: 新增 adjustSwaggerIframeHeight 动态高度计算,窗口尺寸变化时自动调整\n- 解决纵向高度显示异常,提升多端兼容性
…\n- 新增/调整 API 路由与中间件\n- handler 逻辑优化\n- 前端 dashboard 相关页面与样式同步
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request significantly enhances the FileCodeBox UI/UX with comprehensive theming and accessibility improvements, plus adds dedicated API Key endpoints for programmatic integration.
Key changes include:
- Complete CSS architecture overhaul with design system approach using CSS variables
- Enhanced accessibility with ARIA attributes and keyboard navigation
- New API Key authentication middleware and /api/v1 routes
- Swagger documentation integration in admin panel
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| themes/2025/js/dashboard.js | Improves tab switching with accessibility attributes and API key scope documentation |
| themes/2025/index.html | Adds semantic HTML structure and landing page styling classes |
| themes/2025/forgot-password.html | Complete redesign with new auth component system and improved UX flow |
| themes/2025/dashboard.html | Restructures dashboard with semantic HTML, accessibility improvements, and new layout system |
| themes/2025/css/*.css | Major CSS overhaul introducing design system with variables, component architecture, and responsive improvements |
| themes/2025/admin/* | Adds Swagger documentation integration with iframe embedding and dynamic height adjustment |
| internal/routes/api.go | Creates new API Key-only routes for programmatic access |
| internal/middleware/api_key_auth.go | Implements API Key authentication middleware |
| internal/handlers/*.go | Adds API Key-compatible endpoints with proper Swagger documentation |
| docs/*.yaml | Updates Swagger documentation with new API endpoints |
| tab.setAttribute('tabindex', '-1'); | ||
| }); | ||
|
|
||
| const tabButton = event?.currentTarget || event?.target || document.querySelector(`.dashboard-tabs .tab[data-tab="${tabName}"]`); |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This fallback chain is complex and could be error-prone. Consider extracting this logic into a separate helper function like findTabButton(event, tabName) to improve readability and make the intent clearer.
| if router == nil || shareHandler == nil || cfg == nil || userService == nil { | ||
| return | ||
| } |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Silent failure on nil parameters could lead to hard-to-debug issues. Consider logging a warning or error when this validation fails to help with troubleshooting during development and deployment.
| authHeader := c.GetHeader("Authorization") | ||
| if authHeader != "" { | ||
| parts := strings.SplitN(authHeader, " ", 2) | ||
| if len(parts) == 2 && strings.EqualFold(parts[0], "apikey") { |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The API key extraction from Authorization header uses case-insensitive matching with EqualFold. While this improves usability, ensure this aligns with your security requirements. Consider documenting the expected format clearly in API documentation.
| if len(parts) == 2 && strings.EqualFold(parts[0], "apikey") { | |
| if len(parts) == 2 && parts[0] == "ApiKey" { |
No description provided.