[SideNav] v1 Component Clean-Up#241114
Conversation
|
Pinging @elastic/appex-sharedux (Team:SharedUX) |
There was a problem hiding this comment.
Some README files can still be updated:
diff --git src/core/packages/chrome/browser-internal/src/project_navigation/README.md src/core/packages/chrome/browser-internal/src/project_navigation/README.md
index a400f8055a6..5ae983f706a 100644
--- src/core/packages/chrome/browser-internal/src/project_navigation/README.md
+++ src/core/packages/chrome/browser-internal/src/project_navigation/README.md
@@ -34,20 +34,8 @@ The following diagram illustrates how navigation state flows through the system
| |
+--------+--------+
|
- | NavigationKibanaProvider
- | adapts streams
- v
- +------------------+
- | NavigationProvider|
- | |
- | +-----------+ |
- | | Context | |
- | +-----------+ |
- | |
- +--------+--------+
- |
- | useNavigation() hook
- | consumes context
+ | Props passed directly
+ | via useObservable()
v
+------------------+
| Navigation |
@@ -56,8 +44,8 @@ The following diagram illustrates how navigation state flows through the system
| - Renders UI |
| - Highlights |
| active items |
- | - Shows |
- | breadcrumbs |
+ | - Manages panel |
+ | state |
+------------------+
```
@@ -78,8 +66,8 @@ The service does not contain any UI. Instead, it processes navigation trees regi
This is the most common function of the service. It determines the currently active link and broadcasts it to the UI.
-- **State Stream**: The active state is exposed as an RxJS observable, `activeNodes$`, which streams the active link and its parent breadcrumbs.
-- **UI Consumption**: The `ChromeService` subscribes to this stream using the `useObservable` hook and passes the static result to the React UI as a prop.
+- **State Stream**: The active state is exposed as an RxJS observable, `activeNodes$`, which streams the active link and its parent nodes.
+- **UI Consumption**: The `ChromeService` subscribes to this stream using the `useObservable` hook and passes the result directly to the Navigation component as props.
- **Detection Algorithm**: The active node is found by the `findActiveNodes` utility, which uses two methods:
1. **Custom Logic (`getIsActive`)**: A node can define its own function for complex activation logic.
2. **Longest URL Match**: As a fallback, the utility finds the most specific link by matching the longest URL prefix.
@@ -95,9 +83,9 @@ Breadcrumbs are automatically generated from the navigation tree structure:
#### Active Item Highlighting
-UI components use the `activeNodes$` observable to highlight the currently active navigation item:
+The Navigation component uses the active nodes information to highlight the currently active navigation item:
-1. The `SideNavComponent` subscribes to `activeNodes$` to determine which items to highlight
+1. The Navigation component receives `activeNodes$` data via props
2. When rendering the navigation tree, each item compares its ID with the active node's ID
3. If they match, the item is rendered with an "active" state (different styling)
4. Parent nodes of the active item may also receive special styling to show the active path
diff --git src/core/packages/chrome/layout/core-chrome-layout-feature-flags/README.md src/core/packages/chrome/layout/core-chrome-layout-feature-flags/README.md
index 70eb206b5a1..3530e9663dd 100644
--- src/core/packages/chrome/layout/core-chrome-layout-feature-flags/README.md
+++ src/core/packages/chrome/layout/core-chrome-layout-feature-flags/README.md
@@ -8,19 +8,16 @@ Feature flag utilities for Kibana's Chrome layout system.
import {
getLayoutVersion,
getLayoutDebugFlag,
- getSideNavVersion,
} from '@kbn/core-chrome-layout-feature-flags';
const layoutType = getLayoutVersion(featureFlags); // 'legacy-fixed' | 'grid'
const isDebug = getLayoutDebugFlag(featureFlags); // boolean
-const sideNavVersion = getSideNavVersion(featureFlags); // 'v1' | 'v2' | 'both'
```
## Feature Flags
- **`LAYOUT_FEATURE_FLAG_KEY`**: Layout type selection
- **`LAYOUT_DEBUG_FEATURE_FLAG_KEY`**: Debug mode toggle
-- **`LAYOUT_PROJECT_SIDENAV_FEATURE_FLAG_KEY`**: Side navigation version
## FunctionsAnd, src/platform/test/functional/page_objects/solution_navigation.ts can probably be substantially updated.
|
thanks @tsullivan, I updated the readmes! This is the first pass, I will follow with the NavigationTree types clean up and functional tests utils clean up. These changes will touch solutions code and I didn't want to trigger them in this pr |
tsullivan
left a comment
There was a problem hiding this comment.
LGTM! Thanks for updating the read me files :)
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
Total ESLint disabled count
History
|
## Summary Follow up to #241114 This time we cleaning up everything related to the navigation trees structure that is no longer needed in new nav - [x] Platform @Dosant - [x] Search @Dosant (@TattdCodeMonkey to review) - [x] Oblt @justinkambic - [x] Security @ashokaditya Guidance: - Use TypeScript errors to see what needs to be cleaned up: - All V1 property no longer needed. Please Review. V1 branches no longer needed - V2 properties renamed: iconV2 -> icon; badgeTypeV2 -> badgeType - Body and Footer no longer need intermediate root nodes! The nav nodes should go directly under body: [/* nodes */ ], footer: [/* footer */] - @justinkambic, @ashokaditya, use search trees as an example. I cleaned it up. --------- Co-authored-by: Justin Kambic <jk@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Ashokaditya <ashokaditya@elastic.co>
## Summary Follow up to elastic#241114 This time we cleaning up everything related to the navigation trees structure that is no longer needed in new nav - [x] Platform @Dosant - [x] Search @Dosant (@TattdCodeMonkey to review) - [x] Oblt @justinkambic - [x] Security @ashokaditya Guidance: - Use TypeScript errors to see what needs to be cleaned up: - All V1 property no longer needed. Please Review. V1 branches no longer needed - V2 properties renamed: iconV2 -> icon; badgeTypeV2 -> badgeType - Body and Footer no longer need intermediate root nodes! The nav nodes should go directly under body: [/* nodes */ ], footer: [/* footer */] - @justinkambic, @ashokaditya, use search trees as an example. I cleaned it up. --------- Co-authored-by: Justin Kambic <jk@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Ashokaditya <ashokaditya@elastic.co>
## Summary Follow up to elastic#241114 This time we cleaning up everything related to the navigation trees structure that is no longer needed in new nav - [x] Platform @Dosant - [x] Search @Dosant (@TattdCodeMonkey to review) - [x] Oblt @justinkambic - [x] Security @ashokaditya Guidance: - Use TypeScript errors to see what needs to be cleaned up: - All V1 property no longer needed. Please Review. V1 branches no longer needed - V2 properties renamed: iconV2 -> icon; badgeTypeV2 -> badgeType - Body and Footer no longer need intermediate root nodes! The nav nodes should go directly under body: [/* nodes */ ], footer: [/* footer */] - @justinkambic, @ashokaditya, use search trees as an example. I cleaned it up. --------- Co-authored-by: Justin Kambic <jk@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Ashokaditya <ashokaditya@elastic.co>
## Summary Follow up to elastic#241114 This time we cleaning up everything related to the navigation trees structure that is no longer needed in new nav - [x] Platform @Dosant - [x] Search @Dosant (@TattdCodeMonkey to review) - [x] Oblt @justinkambic - [x] Security @ashokaditya Guidance: - Use TypeScript errors to see what needs to be cleaned up: - All V1 property no longer needed. Please Review. V1 branches no longer needed - V2 properties renamed: iconV2 -> icon; badgeTypeV2 -> badgeType - Body and Footer no longer need intermediate root nodes! The nav nodes should go directly under body: [/* nodes */ ], footer: [/* footer */] - @justinkambic, @ashokaditya, use search trees as an example. I cleaned it up. --------- Co-authored-by: Justin Kambic <jk@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Ashokaditya <ashokaditya@elastic.co>
## Summary Follow up to elastic#241114 This time we cleaning up everything related to the navigation trees structure that is no longer needed in new nav - [x] Platform @Dosant - [x] Search @Dosant (@TattdCodeMonkey to review) - [x] Oblt @justinkambic - [x] Security @ashokaditya Guidance: - Use TypeScript errors to see what needs to be cleaned up: - All V1 property no longer needed. Please Review. V1 branches no longer needed - V2 properties renamed: iconV2 -> icon; badgeTypeV2 -> badgeType - Body and Footer no longer need intermediate root nodes! The nav nodes should go directly under body: [/* nodes */ ], footer: [/* footer */] - @justinkambic, @ashokaditya, use search trees as an example. I cleaned it up. --------- Co-authored-by: Justin Kambic <jk@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Ashokaditya <ashokaditya@elastic.co>
Summary
Next steps: