Repository navigation
fix(desktop): preserve editor state across tab switches #204
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
Changes from all commits
b4945ef
7550684
bd2544d
584428c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ impl ProbeApp { | |
| .min_h(px(0.0)) | ||
| .child(components::body_text_input( | ||
| theme, | ||
| self.request_editor.editor(key, "graphql-query"), | ||
| ("graphql-query", key.slot()), | ||
| query.to_owned(), | ||
| components::BodySyntax::Plain, | ||
|
|
@@ -74,6 +75,7 @@ impl ProbeApp { | |
| .min_h(px(0.0)) | ||
| .child(components::body_text_input( | ||
| theme, | ||
| self.request_editor.editor(key, "graphql-variables"), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ("graphql-variables", key.slot()), | ||
| variables, | ||
| components::BodySyntax::Json, | ||
|
|
@@ -177,6 +179,7 @@ impl ProbeApp { | |
| .min_h(px(0.0)) | ||
| .child(components::body_text_input( | ||
| theme, | ||
| self.request_editor.editor(key, "graphql-extensions"), | ||
| ("graphql-extensions", key.slot()), | ||
| extensions, | ||
| components::BodySyntax::Json, | ||
|
|
||
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.
Script executed:
Repository: crizant/probe
Length of output: 9908
Script executed:
Repository: crizant/probe
Length of output: 7260
Undo in a retained query editor can write the previous operation's query into the newly selected operation.
The
graphql-queryeditor is retained per request key and slot. Its identity does not include the selected GraphQL operation. If a disk reload selects a different operation whose query text matches the editor's current text, the editor keeps its undo history. An undo in that editor emits a change. The change handler then callsedit_graphql_request, which writes the restored text into the operation that is now selected and marks the request as edited.The same identity also applies to mounted editors before this change. This change keeps the editor across tab switches, so the carried undo history can also persist across tab changes.