Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Update documentation for TreeView

Henriette Darge11c58a59d5fc
diff --git a/lookbook/docs/components/tree-view/filterable-tree-view.md.erb b/lookbook/docs/components/tree-view/filterable-tree-view.md.erb
index 0019e891ba1..dcccdb1fbd4 100644
--- a/lookbook/docs/components/tree-view/filterable-tree-view.md.erb
+++ b/lookbook/docs/components/tree-view/filterable-tree-view.md.erb
@@ -37,6 +37,11 @@ The search field enables text-based filtering of the tree.
- Non-matching nodes in a visible path are **greyed out and disabled** (not clickable).
- Matching characters in results are **highlighted**.
+**Single-select considerations:**
+
+- Selections made **before** filtering are preserved, even if they are not visible in the current filter.
+- On form submission, **the selected item** is submitted, even if it is currently not shown (e.g filtered out).
+
**Multi-select considerations:**
- Selections made **before** filtering are preserved, even if they are not visible in the current filter.
@@ -63,7 +68,7 @@ A segmented control toggles the visible tree scope:
The labels as well as the logic for the segmented control are configurable. For details, please check the technical notes section at the bottom.
-The segmented control can be disabled and hidden by passing `:none` as `filter_mode_control_arguments`. Please have a look at [this preview](../../../inspect/primer/open_project/filterable_tree_view/hide_segmented_control) for details.
+The segmented control can be disabled and hidden by passing `hidden: true` as `filter_mode_control_arguments`. Please have a look at [this preview](../../../inspect/primer/open_project/filterable_tree_view/hide_segmented_control) for details.
---
diff --git a/lookbook/docs/components/tree-view/tree-view.md.erb b/lookbook/docs/components/tree-view/tree-view.md.erb
index 02e55ff84a1..2f764f981bd 100644
--- a/lookbook/docs/components/tree-view/tree-view.md.erb
+++ b/lookbook/docs/components/tree-view/tree-view.md.erb
@@ -24,7 +24,8 @@ Basically, we follow Primer's specification of a TreeView:
In addition to Primer's guidelines, we introduced an option called `select_variant` which can either be
* `none` (default)
-* `multiple`: Whe `multiple` is chosen, there is a checkbox rendered between the leading action and the leading visual to afford multi-selection
+* `single`: When `single` is chosen, one item can be selected. The selection is indicated via an arrow in the slot of the trailing visual
+* `multiple`: When `multiple` is chosen, there is a checkbox rendered between the leading action and the leading visual to afford multi-selection
Further, in multi-select mode, a `selection_strategy` can also be configured. This determines the influence checking a parent has on its children:
@@ -38,7 +39,7 @@ Further, in multi-select mode, a `selection_strategy` can also be configured. Th
We support two loading strategies:
* static (default): All items are loaded when the component is rendered
-* dynamic: Sub-nodes are loaded from the server as soon as a node is expanded. Please note, that this option is currently not available in combination with the `select_variant: :multiple`.
+* dynamic: Sub-nodes are loaded from the server as soon as a node is expanded. Please note, that this option is currently not available in combination with the `select_variant: :multiple` or `select_variant: :single`.
For more examples have a look [here](../../../inspect/primer/alpha/tree_view/loading_skeleton).