-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat(dashboard): add observability features and fix event flow bugs #53
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| //! Diff view component for showing file changes with old/new content. | ||
|
|
||
| use leptos::prelude::*; | ||
|
|
||
| #[component] | ||
| pub fn DiffView( | ||
| #[prop(into)] file_path: String, | ||
| #[prop(into)] action: String, | ||
| #[prop(into, default = String::new())] old_string: String, | ||
| #[prop(into, default = String::new())] new_string: String, | ||
| #[prop(into, default = String::new())] content: String, | ||
| ) -> impl IntoView { | ||
| let path_display = file_path.clone(); | ||
|
|
||
| match action.as_str() { | ||
| "edit" => { | ||
| view! { | ||
| <div class="diff-view"> | ||
| <div class="diff-header">"Edit: " {path_display}</div> | ||
| {if !old_string.is_empty() { | ||
| let old_display = old_string.clone(); | ||
| Some(view! { | ||
| <div class="diff-block diff-removed"> | ||
| <div class="diff-block-header">"Removed"</div> | ||
| <pre class="diff-content">{old_display}</pre> | ||
| </div> | ||
| }) | ||
| } else { | ||
| None | ||
| }} | ||
| {if !new_string.is_empty() { | ||
| let new_display = new_string.clone(); | ||
| Some(view! { | ||
| <div class="diff-block diff-added"> | ||
| <div class="diff-block-header">"Added"</div> | ||
| <pre class="diff-content">{new_display}</pre> | ||
| </div> | ||
| }) | ||
| } else { | ||
| None | ||
| }} | ||
| </div> | ||
| }.into_any() | ||
| } | ||
| "write" => { | ||
| view! { | ||
| <div class="diff-view"> | ||
| <div class="diff-header">"New File: " {path_display}</div> | ||
| <div class="diff-block diff-added"> | ||
| <div class="diff-block-header">"New File"</div> | ||
| <pre class="diff-content">{content}</pre> | ||
| </div> | ||
| </div> | ||
| }.into_any() | ||
| } | ||
| _ => view! { <div></div> }.into_any(), | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
issue (complexity): Consider extracting the execution-tree event matching and mutation logic into a shared helper function that both
Appandbuild_tree_from_eventscall instead of duplicating it inline.You’ve effectively duplicated the tree‑building rules inline in
App, which does increase complexity and coupling. You can keep all functionality but centralize the logic in a reusable “tree updater” that bothAppandbuild_tree_from_eventscall.1. Extract a reusable tree update function
In a shared module (e.g.
state::execution_treeorpages::control::tree), define something like:You can iteratively migrate the remaining branches (
subagent_spawned,subagent_completed) into this function, preserving the exact behavior you added.2. Use it in
App’s event handlerReplace the large
matchblock inAppwith a narrow call that only gates onexpanded_eid:That keeps the event loop in
Appfocused on “when to update the tree” rather than “how to update the tree,” which makes the UI code easier to follow.3. Reuse in
build_tree_from_eventsIn
control.rs,build_tree_from_eventscan then delegate to the same helper instead of duplicating logic:This removes the duplicated rules for node creation, edges, and status updates, and ensures future changes to tree semantics only need to be done in one place.