Skip to content

Add copy-button to the recording link table item#11242

Merged
IsseW merged 7 commits intomainfrom
isse/link-open-button-copy
Sep 17, 2025
Merged

Add copy-button to the recording link table item#11242
IsseW merged 7 commits intomainfrom
isse/link-open-button-copy

Conversation

@IsseW
Copy link
Member

@IsseW IsseW commented Sep 17, 2025

Related

Part of #10815

What

Adds a copy button that's shown on hover in table url entries
image

  • look into if it's possible to not have to define the copy button rect

@IsseW IsseW added ui concerns graphical user interface 📺 re_viewer affects re_viewer itself include in changelog labels Sep 17, 2025
@github-actions
Copy link

github-actions bot commented Sep 17, 2025

Web viewer built successfully.

Result Commit Link Manifest
19b90c3 https://rerun.io/viewer/pr/11242 +nightly +main

Note: This comment is updated whenever you push a commit.

@abey79 abey79 self-requested a review September 17, 2025 07:31
Comment on lines 61 to 65
UiBuilder::new().max_rect(ui.max_rect()).layout(
Layout::left_to_right(Align::Center)
.with_main_justify(true)
Layout::right_to_left(Align::Center)
.with_cross_justify(true)
.with_main_align(Align::Min),
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you could use egui::Sides for this. See e.g. how the table headers (which have a right aligned menu button) is implemented, in header_cell_ui (datafusion_table_widget.rs)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh thanks! I felt like there had to be some better way to do it, still a bit finicky to get the whole cell clickable, but managed to do it :)

@abey79 abey79 self-requested a review September 17, 2025 08:15
Copy link
Member

@abey79 abey79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. I gave it a spin and it feels really nice.

Nit: the button isn't vertically centred. You may need to have some Align::Center there too.

Image

@IsseW
Copy link
Member Author

IsseW commented Sep 17, 2025

Nit: the button isn't vertically centred. You may need to have some Align::Center there too.

Good catch, wish there was some less ugly way to do this, but it seems Sides for some reason has a smaller y range than the parent UI.

Actually maybe I can use the Sides::height function here

@IsseW
Copy link
Member Author

IsseW commented Sep 17, 2025

In the design I also noticed that this is something we want for a lot of stuff, so might be nice to be able to extract adding a copy button that's only visible on hover into some util function, but can probably be left for the future.

@abey79
Copy link
Member

abey79 commented Sep 17, 2025

In the design I also noticed that this is something we want for a lot of stuff, so might be nice to be able to extract adding a copy button that's only visible on hover into some util function, but can probably be left for the future.

Yes, that's definitely something we want in the tables in general. In particular for data that is formatted for display (e.g. thousand separators, etc.). In this case, the copy button should copy the unformatted data represnetation.

@IsseW IsseW merged commit 72ac4cb into main Sep 17, 2025
40 checks passed
@IsseW IsseW deleted the isse/link-open-button-copy branch September 17, 2025 08:58
@emilk emilk changed the title Add copy button to the recording link table item Add copy-button to the recording link table item Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

include in changelog 📺 re_viewer affects re_viewer itself ui concerns graphical user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants