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

Add tree-of-models bubble component #29

Merged
merged 3 commits into from
Nov 15, 2023
Merged

Add tree-of-models bubble component #29

merged 3 commits into from
Nov 15, 2023

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Nov 14, 2023

This adds a new component to render a tree of generic tea.Models:

 ✔ a
   ├── ✔ a-a
   ├── ✔ a-b
   │     ├── ✔ a-b-a
   │     ├── ✔ a-b-b
   │     └── ✔ a-b-c
   ├── ⠼ a-c
   │     └── ⠼ a-c-a
   └── ⠼ a-d
 ⠼ b
   ├── ⠼ b-a
   │     ├── ⠼ b-a-a
   │     │     └── ⠼ b-a-a-a
   │     │           └── ⠼ b-a-a-a-a
   │     └── ⠼ b-a-b
   └── ⠼ b-b

This will ultimately drive a future version of syft's ui output:

 ✔ Parsed image
 ⠹ Cataloging contents             ━━━━━━━━━━━━━━━━━━━━    
   ├── ⠹ Packages                        [183 packages]
   │     └── ⠹ Java archive cataloger
   ├── ✔ File digests                    [14,771 digests]
   └── ✔ File metadata                   [16,428 locations]

This adds the concept of a VisibleModel:

type VisibleModel interface {
	IsVisible() bool
	tea.Model
}

This is useful when using models that may exist but are effectively no longer useful. This changes the existing taskprogress model to implement this interface.

Requires that #28 is merged first merged!

@wagoodman wagoodman requested a review from a team November 14, 2023 21:52
Base automatically changed from return-cmd to main November 15, 2023 13:36
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman marked this pull request as ready for review November 15, 2023 13:38
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman merged commit def0aba into main Nov 15, 2023
3 checks passed
@wagoodman wagoodman deleted the add-tree branch November 15, 2023 13:49
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.

2 participants