-
Notifications
You must be signed in to change notification settings - Fork 2
Instance name and description editing #85
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
base: yerek
Are you sure you want to change the base?
Instance name and description editing #85
Conversation
…luding new API functions for updating and renaming instances.
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 implements inline editing for instance names and descriptions in the instance header. The key changes enable users to edit these fields directly without navigating to a separate page, with proper handling of the rename operation's asynchronous nature.
- Add inline editing UI with pencil icons that appear on hover for both name and description fields
- Implement API functions for updating instance descriptions and renaming instances with operation polling
- Handle race condition during instance rename by suppressing "Instance not found" errors during the transition period
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| deps/ui-web | Updated ui-web subproject commit reference |
| app/(main)/instance/layout.tsx | Added inline editing UI for instance name and description with save/cancel controls and rename state management |
| app/(main)/instance/_lib/instance.ts | Implemented updateInstance and renameInstance API functions with operation polling for async rename operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
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
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
app/(main)/instance/_lib/instance.ts:1
- The dynamic width calculation
Math.max(...length, 1) + 4}chis duplicated. Consider extracting this to a helper function likecalculateInputWidth(text: string, minChars = 1, padding = 4)to improve maintainability.
import { Instance } from '../../instances/_lib/instances.d';
app/(main)/instance/_lib/instance.ts:1
- The dynamic width calculation
Math.max(...length, 1) + 4}chis duplicated. Consider extracting this to a helper function likecalculateInputWidth(text: string, minChars = 1, padding = 4)to improve maintainability.
import { Instance } from '../../instances/_lib/instances.d';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Refine instance polling and input sizing
Hye-Dev
left a comment
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.
Use the events socket for checking if an operation is done rather than continuous polling
…ssues-in-pull-request-85-xvxcw6
…85-xvxcw6 Use events socket for async operations and standardize input sizing
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
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| settled = true; | ||
| socket.close(); | ||
| reject(new Error('Operation timed out')); | ||
| }, OPERATION_EVENT_TIMEOUT_MS); |
Copilot
AI
Dec 29, 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.
The constant OPERATION_EVENT_TIMEOUT_MS is referenced but not defined anywhere in this file. This will cause a ReferenceError at runtime when the WebSocket fallback is triggered.
|
|
||
| socket.onmessage = (event) => { | ||
| try { | ||
| const data = JSON.parse(event.data) as OperationEvent; |
Copilot
AI
Dec 29, 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.
The type OperationEvent is not defined or imported in this file. This will cause a TypeScript compilation error.
| }); | ||
| setIsEditingName(false); | ||
| // Redirect to new URL | ||
| router.push(`/instance?name=${encodeURIComponent(newName)}`); |
Copilot
AI
Dec 29, 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.
After renaming, onRenameEnd() is never called in the success path. This leaves isRenaming permanently true, preventing the error message from displaying if the user navigates back. Call onRenameEnd() after the router.push or in a useEffect cleanup.
| router.push(`/instance?name=${encodeURIComponent(newName)}`); | |
| router.push(`/instance?name=${encodeURIComponent(newName)}`); | |
| onRenameEnd(); |
feat: implement inline editing for instance name and description
Textareacomponent (though switched toInputfor description)Closes #62