fix: fix external editor lagging a lot#140
Open
JayanAXHF wants to merge 1 commit into
Open
Conversation
Contributor
Greptile SummaryThis PR refactors the external editor integration by moving the editor invocation out of a fire-and-forget
|
| Filename | Overview |
|---|---|
| src/ui/mod.rs | Core refactor: introduces EventPump lifecycle management and run_external_editor_session; early-error returns from finish_teardown/setup_terminal still leave in_editor=true and event_pump=None, which can freeze the app (flagged in previous review thread) |
| src/ui/components/issue_conversation.rs | Simplified: delegate editor invocation to App via OpenExternalEditor action instead of spawning an inline async task; target mapping and action send are straightforward |
Sequence Diagram
sequenceDiagram
participant IC as IssueConversation
participant TX as action_tx
participant App as App
participant EP as EventPump
participant Ed as ExternalEditor
IC->>TX: "OpenExternalEditor {issue_number, target, initial_body}"
TX->>App: "dispatch in run() loop"
App->>App: "in_editor = true"
App->>EP: "stop_event_pump() cancel + join"
App->>App: "ratatui::restore() + finish_teardown()?"
App->>Ed: "spawn_blocking(edit::edit)"
Ed-->>App: "Result<String, String>"
App->>App: "ratatui::init() + setup_terminal()?"
App->>EP: "start_event_pump()"
App->>App: "in_editor = false"
App->>TX: "IssueBodyEditFinished or IssueCommentEditFinished"
App->>TX: "ForceRender"
Reviews (2): Last reviewed commit: "fix: fix external editor lagging a lot" | Re-trigger Greptile
f6609df to
60297d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.