-
Notifications
You must be signed in to change notification settings - Fork 0
DT-93: Refactor and fix Project Page Settings #93
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
Conversation
…eployment management and token regeneration, update `GET/api/deployment` input, and refine UI layout.
…and introduce new reusable UI components.
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 PR refactors the project settings page by relocating and reimplementing the SettingsPage component, while also fixing API route definitions.
Changes:
- Moved SettingsPage from
web/pages/project/SettingsPage.tsxtoweb/pages/SettingsPage.tsxwith complete UI redesign - Updated API routes to correct HTTP methods and parameter structures
- Added layout improvements for proper overflow handling
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| web/pages/project/SettingsPage.tsx | Complete removal of old SettingsPage implementation |
| web/pages/SettingsPage.tsx | New SettingsPage with redesigned UI, deployment management, and token handling |
| web/pages/ProjectPage.tsx | Updated import path and added overflow handling classes |
| web/pages/DeploymentPage.tsx | Added sidebar item check to logs fetching logic |
| web/index.tsx | Enhanced main layout with flexbox and overflow classes |
| api/routes.ts | Fixed API route descriptions, HTTP methods, and parameter structures |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fn: async (_ctx, { url }) => { | ||
| const dep = DeploymentsCollection.get(url) |
Copilot
AI
Feb 2, 2026
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.
The parameter name 'url' shadows the imported 'url' from '@01edu/signal-router'. Consider renaming this parameter to 'deploymentUrl' or 'depUrl' to avoid confusion.
| fn: async (_ctx, { url }) => { | |
| const dep = DeploymentsCollection.get(url) | |
| fn: async (_ctx, { url: deploymentUrl }) => { | |
| const dep = DeploymentsCollection.get(deploymentUrl) |
| const projectId = project.data?.slug | ||
| if (!projectId) return | ||
| try { | ||
| const depUrl = new URL(fd.get('url') as string).host |
Copilot
AI
Feb 2, 2026
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.
If the URL is malformed, this will throw a generic TypeError. Consider wrapping this in a try-catch and providing a clearer error message like 'Invalid URL format' to improve user experience.
| replace: true, | ||
| }) | ||
| } catch (e) { | ||
| addDeploymentError.value = e instanceof Error ? e.message : 'Unknown error' |
Copilot
AI
Feb 2, 2026
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.
The error message 'Unknown error' is not descriptive. Consider using a more specific message such as 'Failed to add deployment' to provide better context to users.
| addDeploymentError.value = e instanceof Error ? e.message : 'Unknown error' | |
| addDeploymentError.value = e instanceof Error | |
| ? e.message | |
| : 'Failed to add deployment' |
| <select | ||
| class='select select-bordered select-sm w-full max-w-xs' | ||
| value={selectedUrl || ''} | ||
| defaultValue={selectedUrl || ''} |
Copilot
AI
Feb 2, 2026
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.
Both 'value' and 'defaultValue' are set on the same select element. The 'value' prop makes this a controlled component, so 'defaultValue' is redundant and will be ignored. Remove the 'defaultValue' prop.
| defaultValue={selectedUrl || ''} |
refactor: reimplement SettingsPage and adjust API routes.