Extract asset grid core logic into asset-grid-without-scrubber component
• Move all timeline rendering and scrolling logic to new component • Keep scrubber logic and interaction handlers in original asset-grid • Use composition pattern with header snippet for scrubber integration • Simplify asset-grid to ~450 lines by extracting ~390 lines of core logic
This commit is contained in:
@@ -42,6 +42,7 @@ export class TimelineManager {
|
||||
isInitialized = $state(false);
|
||||
months: MonthGroup[] = $state([]);
|
||||
topSectionHeight = $state(0);
|
||||
bottomSectionHeight = $state(60);
|
||||
timelineHeight = $derived(this.months.reduce((accumulator, b) => accumulator + b.height, 0) + this.topSectionHeight);
|
||||
assetCount = $derived(this.months.reduce((accumulator, b) => accumulator + b.assetsCount, 0));
|
||||
|
||||
@@ -557,4 +558,13 @@ export class TimelineManager {
|
||||
getAssetOrder() {
|
||||
return this.#options.order ?? AssetOrder.Desc;
|
||||
}
|
||||
|
||||
getMaxScrollPercent() {
|
||||
const totalHeight = this.timelineHeight + this.bottomSectionHeight + this.topSectionHeight;
|
||||
return (totalHeight - this.viewportHeight) / totalHeight;
|
||||
}
|
||||
|
||||
getMaxScroll() {
|
||||
return this.topSectionHeight + this.bottomSectionHeight + (this.timelineHeight - this.viewportHeight);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user