Introduce variant UIs in re_component_ui#10034
Conversation
…component_ui[_raw]`
…itOrViewCallback`s
|
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
|
|
||
| let uri = RedapUri::from_str(url_str)?; | ||
|
|
||
| //TODO(ab): we should provide feedback if the URI is already loaded, e.g. have "go to" instead of "open" |
There was a problem hiding this comment.
is that hard? we know all the open stores and we know their source, right?
There was a problem hiding this comment.
shouldn't be hard, basically about the URI <-> StoreId matching, which might be slightly dirty at this point. I've already an issue open about this so I'll reference it from there.
| .clicked() | ||
| { | ||
| let url = if ui.input(|i| i.modifiers.command) { | ||
| egui::OpenUrl::new_tab(uri) |
There was a problem hiding this comment.
Well probably not in the way you think.
Regular click -> open the recording in the current viewer and display it.
Cmd-click -> open the recording in the current viewer, but do not switch to it (aka leave the DisplayMode alone)
IMO this is defo the intended behaviour on native. What should happen on web is debatable. I can see myself wanting either same viewer or separate browser tab, depending on whether I'm focused on latency or ram :) Anyways, orthogonal to this PR. This is dealt with by the bit that hooks into egui and custom handles rerun url schemes.
There was a problem hiding this comment.
Well, after testing this in the next PR, it appears that this is broken. But again, this has to do with the way we handle it, so orthogonal to this PR.
There was a problem hiding this comment.
problem with separate browser tab is that we don't know what the user may have built around rerun
There was a problem hiding this comment.
we should probably behave differently if we are in a SPA vs. integrated context (which we currently don't know about), but I digress 😅
| fallback_ui(ui, ui_layout, component_raw); | ||
| } | ||
|
|
||
| /// Show a UI corresponding to the provided variant name. |
There was a problem hiding this comment.
should document that this falls back to component name based if there's no variant found!
There was a problem hiding this comment.
We don't though? Or am I missing something? The fallback is basically the arrow array thrown at arrow_ui
There was a problem hiding this comment.
oh I misread because of gh collapsing. Should have expanded more in the diff view
Given that we have a component descriptor.. maybe we should though?
There was a problem hiding this comment.
I've got mixed feelings about this. Asking for a non-existent variant is likely a bug. I'll add a todo and a debug log for now, but definitely something we could revisit.
… button in the partition table recording links (#10035) ### Related - fixes #9795 - follow-up to #10034 - part of #9741 - future work #10036 ### What This PR introduces the ability to specify on a per-column basis a specific variant ui (see #10034) to use. To that end, a new `ColumnBlueprint` structure is introduced and a bunch of things around that is refactored. This PR also uses the recently introduced `redap_url` variant UI to display the recording link as an "open" button instead of a fully URL. 
Related
DataFusionTableWidget#9795What
This PR add the capability to register and use arbitrary pieces of Arrow-based UI that are not necessarily linked to a specific component. They are called "variant UI", as opposed to "component UI".
To summarise, component UIs:
In contrast, variant UIs (for now):
VariantName(conceptually a&'static strconstant)Implementation notes:
add_variant_uiand used withvariant_ui_raw, which is mostly an independent, parallel path from the pre-existing stuff.UntypedComponentEditOrViewCallback, because thesearewill be convenient to have in variant ui impls.redap_uri_buttonvariant ui, which handles data that happens to be rerun-conforming URIs.