-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: remove edit as a mode #5801
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
✅ Deploy Preview for continuedev canceled.
|
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.
Lot of code changes here because of file renames/reorg, cleanup of linting errors (eg adding void
s), etc
The meat of the logic is the following:
- Make edit a boolean instead of a mode
- Enhance the lump toolbar, primarily by moving apply states into it
- When a user enters edit, clear the editor, but save the previous content and restore it when the user exits Edit
<span>Accept</span> | ||
<span className="xs:inline-block hidden">All</span> | ||
</div> | ||
<span |
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.
Removed this because of space constraints on the lump, and moved it into a tooltip
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.
This was moved into LumpToolbar/
folder where we colocate all the other toolbars
// Array because of previous multi-file edit functionality | ||
// Keeping array to not break persisted redux for now | ||
codeToEdit: SetCodeToEditPayload[]; | ||
applyState: ApplyState; | ||
returnToMode: MessageModes; | ||
lastNonEditSessionWasEmpty: boolean; | ||
previousModeEditorContent: JSONContent | undefined; |
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.
this is how we cache/return the editor content between edits
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.
One more thing to think about, should we persist isInEdit to redux? Maybe not
}; | ||
|
||
useEffect(() => { | ||
document.addEventListener("keydown", handleKeyDown); |
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.
assuming this wasn't changed on this PR but this might cause a bug bc the toolCallState = generated check should be in the use effect adding/removing the listener, not in the listener itself?
gui/src/components/mainInput/TipTapEditor/MainEditorProvider.tsx
Outdated
Show resolved
Hide resolved
🚨 Code Review Error GitHub API error (422): Unprocessable Entity Please check the logs or contact the maintainers for assistance. |
🚨 Code Review Error GitHub API error (422): Unprocessable Entity Please check the logs or contact the maintainers for assistance. |
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.
📝 Incremental review for latest commit: Found 1 issues in the latest commit
gui/src/pages/gui/Chat.tsx
Outdated
@@ -292,9 +294,11 @@ export function Chat() { | |||
|
|||
return ( | |||
<> | |||
{!!showSessionTabs && mode !== "edit" && <TabBar ref={tabsRef} />} | |||
{!!showSessionTabs && isInEdit && <TabBar ref={tabsRef} />} |
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 logic change appears inconsistent. The condition changed from mode !== "edit"
to isInEdit
, which inverts the behavior. This means TabBar with ref will now show when in edit mode instead of when not in edit mode. Please verify this is the intended behavior, as it contradicts the logic on line 300 where !isInEdit
is used to show TabBar without ref.
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.
📝 Incremental review for latest commit: Found 1 issues in the latest commit
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.
✅ Latest commit looks good |
Closes CON-1937
Summary by cubic
Removed "edit" as a selectable mode and replaced it with a simpler edit state, streamlining the UI and related logic.
isInEdit
state to track when editing is active.isInEdit
instead of mode checks.Screenshots
Edit
Edit outcome
Mode select
Chat/Agent apply actions
Testing instructions
Don't switch between your main editor and your debug editor while testing, it will mess with redux state.
Edit
Chat/Agent
Send a message that triggers an apply, confirm UI/behavior