-
Notifications
You must be signed in to change notification settings - Fork 324
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
Open Project Dialog #5607
Open Project Dialog #5607
Conversation
app/gui/src/presenter/project.rs
Outdated
fn attach_frp_to_project_list_notifications( | ||
self, | ||
notifications: Publisher<ProjectListNotification>, | ||
project_list_ready: frp::Source<()>, | ||
) -> Self { | ||
let weak = Rc::downgrade(&self.model); | ||
let notifications = notifications.subscribe(); | ||
spawn_stream_handler(weak, notifications, move |notification, _| { | ||
match notification { | ||
ProjectListNotification::ProjectListReady => project_list_ready.emit(()), | ||
} | ||
std::future::ready(()) | ||
}); | ||
self | ||
} |
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.
I feel it's a bit strange we make a publisher to publish notifications for ourselves. Cannot we just call "reset_entries" on project list in the async block where we wait for new list load?
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.
Yep, I guess it's a lot easier :) Done.
|
||
/// Show a spinner covering the whole viewport. | ||
#[allow(unsafe_code)] | ||
#[wasm_bindgen(method)] | ||
#[wasm_bindgen(js_name = showProgressIndicator)] | ||
pub fn show_progress_indicator(this: &App, progress: f32); | ||
|
||
/// Hide a spinner. | ||
#[allow(unsafe_code)] | ||
#[wasm_bindgen(method)] | ||
#[wasm_bindgen(js_name = hideProgressIndicator)] | ||
pub fn hide_progress_indicator(this: &App); |
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.
Somewhere we hide the progress indicator after project load. Can we use this method there? I think I didn't see it in this PR.
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.
We can't because it is the responsibility of the JS code that loads WASM. Spinner is tracking download progress and is hidden after it is done automatically.
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.
We CAN reuse the spinner if we want. Its API is exposed by JS app that we are connected to in Rust. I can help with it if we want it.
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.
@wdanilo what do you mean? We are using a spinner from JS app, I was just forced to add a bit of code to make it work from Rust (show_progress_indicator
and hide_progress_indicator
methods).
QA passed |
Updated the code to correctly close the project before opening a new one, now, the nodes from the previous project are not visible. The video in the description was updated. |
QA Peek.2023-02-15.15-08.mp4 |
@MichaelMauderer, that's weird, it works for me.
|
Yes, I can select them and opening a new project seems to work.
The demo scene and the CB seem to have the correct highlights. |
Perhaps the shape ordering is undefined? |
@MichaelMauderer I moved the grid to the dedicated layer, could you check it? |
Still does not appear. There appears to be a shape visible in the debug layers, see the video. Peek.2023-02-16.10-54.mp4I'm seeing the same behaviour between Chromium and Firefox (both on Linux). I can try a different machine / OS and the electron package if that helps. |
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.
app/gui/src/presenter/project.rs
Outdated
(rows, cols) | ||
})); | ||
entry_model <- project_list.grid.model_for_entry_needed.map(f!([model]((row, _)) { | ||
model.available_projects.borrow().get(*row).map(|(name, _)| (*row, 0, name.clone_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.
this is super complex. Also, the 0
is magic
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.
Fixed
|
||
/// Show a spinner covering the whole viewport. | ||
#[allow(unsafe_code)] | ||
#[wasm_bindgen(method)] | ||
#[wasm_bindgen(js_name = showProgressIndicator)] | ||
pub fn show_progress_indicator(this: &App, progress: f32); | ||
|
||
/// Hide a spinner. | ||
#[allow(unsafe_code)] | ||
#[wasm_bindgen(method)] | ||
#[wasm_bindgen(js_name = hideProgressIndicator)] | ||
pub fn hide_progress_indicator(this: &App); |
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.
We CAN reuse the spinner if we want. Its API is exposed by JS app that we are connected to in Rust. I can help with it if we want it.
Regarding this - please remember that if you do not set explicitly the ordering of shapes, it is random and can depend on different factors, liveth order of shapes created, which can be different on different machines. Looks to me like just a lack of shapes ordering specification :) |
QA: Passed. |
Pull Request Description
Closes #5022
This is basically a reimplementation of the Open Project Dialog that was present in the IDE a while ago. Now it uses the modern shiny
grid-view
instead of the old rustylist-view
.2023-02-15.18-14-32.mp4
Checklist
Please include the following checklist in your PR:
Scala,
Java,
and
Rust
style guides.
./run ide build
and./run ide watch
.