-
Notifications
You must be signed in to change notification settings - Fork 1
Implement Git status SSE updates #106
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
The Git status bar consistently floats on the editor canvas and receives the Git status through server sent events.
Do not send an event when a file was modified, but the status did not change.
17378ec to
600c28b
Compare
backend/git2-ox/src/status.rs
Outdated
| } | ||
| } | ||
|
|
||
| impl TryFrom<&Repository> for Status { |
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.
nit: I would probably prefer a method e.g. Status::try_from_repository in this case. As TryFrom is more about type conversions.
Alternatively we could just have an impl block:
impl Repository {
pub fn status() Result<Status> {
....
}
}
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.
used Status::try_from_repository I don't like to have all this logic in git2_ox::Repository
| @@ -0,0 +1,54 @@ | |||
| import log from "loglevel"; | |||
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.
Don't want to introduce rxjs 👿 ?
Instead of implementing typed events and event stream by hand (or vibe)
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.
only halfway vibed 🗡️
I would need to read into rxjs
This PR contains multiple changes, related to the Git status.
std::sync::mpsc::channeltokio::sync::broadcast::channelto the individual event streamsOn the client side there are also some changes:
EventSourceAPI - although we should evaluate if we switch to WebSockets in the future as SSE only supports 6 connections to one host per browser instance. Maybe this also does not matter asdebug-flowwould anyways fall apart with different flows in different tabs as thezustandstores would overwrite each other.useEventStreamhook to declare subscription to an event typeCloses #102