Skip to content
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

action_card: display output dirs as trees #6545

Merged
merged 4 commits into from May 13, 2024

Conversation

sluongng
Copy link
Contributor

@sluongng sluongng commented May 10, 2024

Render the output directories as expandable trees so that users could
explore their contents.

This PR is based on #6525 so we should only merge this PR after.

@sluongng sluongng force-pushed the sluongng/improve-action-card branch from cfd83d0 to d255d63 Compare May 10, 2024 12:54
@sluongng sluongng force-pushed the sluongng/improve-action-card branch from d255d63 to b325623 Compare May 10, 2024 14:05
obj: new build.bazel.remote.execution.v2.DirectoryNode({ name: dir.path, digest: dir.treeDigest }),
type: "dir",
}}
treeShaToExpanded={this.state.treeShaToExpanded}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unlike input, which only has one tree, there could be multiple output directories in ActionResult, which is currently translated to multiple trees. This has aside effects:

The current implementation shares the same treeShaToExpanded state among all input/output trees. This could cause expanding 1 tree in input to also expand that tree in output. In practice, I think it's unlikely that these directories are duplicated. We could fix this later by providing a separate state for each tree.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A second problem with this approach is that if there are 2 or more output dirs, the prefix bazel-out/<target-platform>/bin prefix is not duplicated between the rendered trees.

I briefly considered deduplicating them, but when we do that, it would not be clear to the user which directories in the merged tree were the output directory specified in the ActionResult.

I plan to add Expected output paths to render the Command data in a future PR. Once that's done, I think we could reconsider merging the output trees in our UI.

@sluongng sluongng force-pushed the sluongng/improve-action-card branch from b325623 to b17c56f Compare May 10, 2024 14:25
@sluongng
Copy link
Contributor Author

A preview

image

@siggisim
Copy link
Member

siggisim commented May 10, 2024

A preview

image

Some style nits:

It looks like the two new icons need to be sized the same as the folder / download icons - and I suspect some display:flex; align-items: center; is needed on that whole new row. And maybe a little padding around the arrow

Also, is there a digest for these we could render like for the other files?

Render the output directories as expandable trees so that users could
explore their contents.

Also show output symlinks.
@sluongng sluongng force-pushed the sluongng/improve-action-card branch from b17c56f to b34b04a Compare May 10, 2024 16:09
@sluongng
Copy link
Contributor Author

Here is the latest preview which includes @bduffany CSS fix from the previous PR

image

Also, is there a digest for these we could render like for the other files?

The symlink could point to an existing file in the tree, or it could point to a file on the execution host or a non-existing file, in which case it would be a dangling symlink.

We could consider adding a digest when the file it points to does exist in the tree, but I would prefer attempting that in a separate PR.

@siggisim
Copy link
Member

siggisim commented May 10, 2024

Here is the latest preview which includes @bduffany CSS fix from the previous PR

image

The new icons look a little darker than the download / file icons. And I feel like the arrow icon should potentially be a bit smaller.

@sluongng
Copy link
Contributor Author

image

Changed the opacity of the symlink icons to be more consistent with the rest of the icons in the tree.

@sluongng sluongng merged commit eae5d56 into master May 13, 2024
18 checks passed
@sluongng sluongng deleted the sluongng/improve-action-card branch May 13, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants