-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Labels
Description
Description
The current window/pane system in KHI is built on a custom ResizingCalculator and SidePaneComponent within AppComponent. While functional, it is limited to a fixed set of panels (Timeline, Logs, History) with restricted resizing capabilities (horizontal only) and no support for complex layouts like tabs, vertical splits, or popping windows out.
To improve the user experience and flexibility, we should replace this custom implementation with Golden-Layout, a robust window management library.
Motivation
- Flexibility: Users can arrange views (Timeline, Logs, Graph, etc.) functionality according to their workflow (e.g., side-by-side logs, vertical timelines).
- Tabs: Support multiple views of the same type or grouping different views.
- Popouts: Native support for popping windows into new browser windows (useful for multi-monitor setups).
- Maintainability: Offload complex resizing/docking logic to a maintained library instead of our custom
ResizingCalculator.
Current State Analysis
- Main Controller:
web/src/app/pages/main/main.component.ts(AppComponent) currently manages the layout. - Layout Logic:
web/src/app/common/resizable-pane/resizing-calculator.tshandles manual pixel calculations. - Components:
TimelineComponent: Main view, fixed at the left/center.LogViewComponent: Right side pane.DiffViewComponent(History): Right side pane.SidePaneComponent: Wrapper for collapsible panes.
Proposed Changes
1. Dependency Integration
- Add
golden-layout(v2+) to the project. - Ensure generic stylesheet definitions are imported.
2. Angular Integration (LayoutAdapter)
- Create a
LayoutManagerServiceorLayoutComponentthat initializes the Golden-Layout instance. - Since Angular components need to be rendered inside Golden-Layout containers, we need a bridge (ComponentFactoryResolver is deprecated, so usage of
ViewContainerRefandComponentRefwill be needed to inject Angular components into GL slots). - Target Components to Register:
TimelineComponentLogViewComponentDiffViewComponentArchitectureGraphComponent(Currently a separate page, should be a dockable panel!)
3. Replace AppComponent Layout
- Remove
ResizingCalculatorandmain-view-wrappercustom CSS. - Replace the template of
AppComponentwith the Golden-Layout container. - Implement a default layout configuration:
- Row:
- Column (70%):
TimelineComponent - Stack (30%):
LogViewComponentDiffViewComponent(History)
- Column (70%):
- Row:
4. Graph View Integration
- The
/session/:id/graphroute could potentially be deprecated or redirected to a layout configuration where the Graph is maximized. - Register
ArchitectureGraphComponentas a panel type, allowing users to open the graph alongside the timeline.
Implementation Tasks
- Install
golden-layoutpackage. - Create
LayoutWrapperComponent(or similar) to handle GL initialization and component binding. - Refactor
TimelineComponent,LogViewComponent, etc., to handle resize events from GL (if they rely on window resize, they might needResizeObserveror GL callbacks). - Remove
ResizingCalculatorandSidePaneComponent. - Define and implement the default JSON configuration for the initial layout.
- Verify Popout functionality works (ensure styles/scripts are loaded in popouts).
Migration
- This is a breaking change for the UI structure.
SidePaneComponentusages will be removed.- Tests relying on specific DOM structure of the main split panes will need updates.
Reactions are currently unavailable