ItemSelectionProvider: promote toot expansion

state

* used in Profile, TrendTimelinePanel,
  TimelinePanel
This commit is contained in:
thislight 2024-11-25 20:08:03 +08:00
parent dafc2c47a8
commit 9499182a8d
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E
5 changed files with 120 additions and 68 deletions

View file

@ -26,11 +26,18 @@ import { useStore } from "@nanostores/solid";
import TrendTimelinePanel from "./TrendTimelinePanel";
import TimelinePanel from "./TimelinePanel";
import { useSessions } from "../masto/clients";
import {
createSingluarItemSelection,
default as ItemSelectionProvider,
} from "./toots/ItemSelectionProvider";
const Home: ParentComponent = (props) => {
let panelList: HTMLDivElement;
useDocumentTitle("Timelines");
const now = createTimeSource();
const [, selectionState] = createSingluarItemSelection(
undefined as string | undefined,
);
const settings$ = useStore($settings);
@ -115,7 +122,6 @@ const Home: ParentComponent = (props) => {
}
};
css`
.tab-panel {
overflow: visible auto;
@ -195,40 +201,42 @@ const Home: ParentComponent = (props) => {
</AppBar>
}
>
<TimeSourceProvider value={now}>
<Show when={!!client()}>
<div
class="panel-list"
ref={panelList!}
onScroll={requestRecalculateTabIndicator}
>
<div class="tab-panel">
<div>
<TimelinePanel
client={client()}
name="home"
prefetch={prefetching()}
/>
<ItemSelectionProvider value={selectionState}>
<TimeSourceProvider value={now}>
<Show when={!!client()}>
<div
class="panel-list"
ref={panelList!}
onScroll={requestRecalculateTabIndicator}
>
<div class="tab-panel">
<div>
<TimelinePanel
client={client()}
name="home"
prefetch={prefetching()}
/>
</div>
</div>
</div>
<div class="tab-panel">
<div>
<TrendTimelinePanel client={client()} />
<div class="tab-panel">
<div>
<TrendTimelinePanel client={client()} />
</div>
</div>
</div>
<div class="tab-panel">
<div>
<TimelinePanel
client={client()}
name="public"
prefetch={prefetching()}
/>
<div class="tab-panel">
<div>
<TimelinePanel
client={client()}
name="public"
prefetch={prefetching()}
/>
</div>
</div>
<div></div>
</div>
<div></div>
</div>
</Show>
</TimeSourceProvider>
</Show>
</TimeSourceProvider>
</ItemSelectionProvider>
</Scaffold>
</>
);