feat: admin UI with auth, CRUD operations, and upload#231
Conversation
Summary of ChangesHello @fank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the application by introducing a robust administrative interface. It provides secure access to manage operations through a new authentication system and enables critical data management functionalities like editing, deleting, and retrying conversions. The accompanying frontend UI streamlines these administrative tasks, improving overall usability and control over the application's data. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive admin interface with secret-based cookie authentication, CRUD operations for mission metadata, and a drag-and-drop upload zone. The backend implementation includes an in-memory session store and protected API endpoints. Overall, the code is well-structured and follows Go and SolidJS best practices. My feedback focuses on improving security by adding the Secure flag to session cookies, enhancing reliability by checking I/O errors during file operations, and optimizing performance by removing redundant database queries in the edit handler.
- Edit button: grey → blue (background, border, text color) - Label: "ADMIN" → "ADMIN ACTIONS" with tighter spacing - Admin section: add border-top separator and proper padding
- Header with edit icon, title, and close button - Compact read-only info bar (ID, Map, Format, Status) - Tag + Date fields with proper button selection styles - Footer with border separator, Cancel and Save Changes buttons
- Centered layout with warning triangle icon - Mission name and metadata prominently displayed - Detailed warning about file removal - Delete Recording button with trash icon and red gradient
- Add Secure flag to session cookie (auto-detect TLS) - Remove redundant DB fetch in EditOperation, update in-memory instead - Log file cleanup errors in DeleteOperation instead of silently ignoring - Wrap MissionSelector tests with AuthProvider to fix 30 test failures
Coverage Report for ui
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
…ariables Move EditModal and DeleteConfirm into dialogs.tsx and replace all hardcoded color values in admin styles with existing CSS variables.
Move edit modal and delete confirm CSS classes from MissionSelector.module.css into dialogs.module.css to follow the existing convention of one CSS module per component file.
- api-client: 14 tests for login, getMe, logout, editOperation, deleteOperation, retryConversion, uploadOperation - dialogs: 8 tests for EditModal and DeleteConfirm rendering and interaction - useAuth: 6 tests for AuthProvider mount, login, logout, and context guard
Cover error branches: bad ID, not-found, not-in-failed-state for admin handlers; bad request body for login. Raises server package coverage from 84.1% to 85.2%.
Switch from HttpOnly cookie-based sessions (in-memory SessionStore) to stateless JWT authentication using HMAC-SHA256 (golang-jwt/jwt/v5). The server secret doubles as the signing key. Tokens are returned in the login response body, stored in-memory on the frontend, and sent via Authorization: Bearer header.
Add tests for authentication UI, login modal flows, edit/delete/retry operations, upload zone, drag events, and keyboard shortcuts.
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
Summary
dialogs.tsxwith co-locateddialogs.module.cssvariables.cssNew API Endpoints
POST/api/v1/auth/loginGET/api/v1/auth/mePOST/api/v1/auth/logoutPATCH/api/v1/operations/:idDELETE/api/v1/operations/:idPOST/api/v1/operations/:id/retryTest plan
go test ./internal/server/...)tsc --noEmit)