move the quota to the prompt
CI / verify (pull_request) Failing after 8s

This commit is contained in:
2026-09-18 10:08:13 +02:00
parent df61d9a282
commit d39408afc4
2 changed files with 57 additions and 22 deletions
+27 -16
View File
@@ -60,32 +60,43 @@ export default Plugin.define({
setRevision((value) => value + 1);
});
const Slot = (props: { instance: string }) => {
const Slot = (props: { instance: string; centered?: boolean; visible?: () => boolean }) => {
const [status] = createResource(
() => `${props.instance}:${revision()}`,
() => (props.visible?.() === false ? false : `${props.instance}:${revision()}`),
() => loadQuotaStatus(() => quota.status({})),
);
const Content = () => (
<box flexDirection="column">
<text fg={context.theme.text.default}>
<b>ChatGPT quota ({status()!.plan})</b>
</text>
<For each={status()!.windows}>
{(window) => (
<text fg={context.theme.text.muted}>{formatQuotaWindow(window)}</text>
)}
</For>
</box>
);
return (
<Show when={status()}>
<box flexDirection="column">
<text fg={context.theme.text.default}>
<b>ChatGPT quota ({status()!.plan})</b>
</text>
<For each={status()!.windows}>
{(window) => (
<text fg={context.theme.text.muted}>
{formatQuotaWindow(window)}
</text>
)}
</For>
</box>
<Show when={props.centered} fallback={<Content />}>
<box width="100%" alignItems="center">
<Content />
</box>
</Show>
</Show>
);
};
const removeHome = context.ui.slot({
append: "home.footer.status",
render: () => <Slot instance="home" />,
after: "prompt.footer",
render: () => (
<Slot
instance="home"
centered
visible={() => context.ui.router.current().type === "home"}
/>
),
});
const removeSidebar = context.ui.slot({
append: "sidebar.footer",