Skip to content

Add tree-of-models bubble component#29

Merged
wagoodman merged 3 commits intomainfrom
add-tree
Nov 15, 2023
Merged

Add tree-of-models bubble component#29
wagoodman merged 3 commits intomainfrom
add-tree

Conversation

@wagoodman
Copy link
Copy Markdown
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>
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