fix(ux): surface hidden notices, bound report waits, add root boundaries
Framework-level UX fixes found while auditing staging (BUG-216..220).
- chat: route 44 previously discarded composer notices to sonner with
dedupe, so recovery, cancel and archive feedback is actually visible
(BUG-216)
- chat: anchor stream auto-scroll to bottom proximity and add a
jump-to-latest control, so reading history is no longer interrupted
on every token (BUG-218)
- reports: replace the silent 120s poll cutoff with an explicit
timed-out state, an 8m budget, stepped backoff and an elapsed
counter (BUG-217)
- reports: pause polling while the tab is hidden, via a shared hook
- app: add root error, global-error and not-found boundaries (BUG-219)
- admin: add antd SSR style extraction and the React 19 render adapter,
and move admin-only css out of the global stylesheet (BUG-220)
- membership: run bootstrap fetches concurrently and pause payment
polling while hidden
- build: configure optimizePackageImports
Verified on top of 2d370f2e: tsc, eslint, next build, and the related
frontend contract suites.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
"use client";
|
||||
|
||||
import { StyleProvider, createCache, extractStyle } from "@ant-design/cssinjs";
|
||||
import { unstableSetRender } from "antd";
|
||||
import { useServerInsertedHTML } from "next/navigation";
|
||||
import { useState, type ReactNode } from "react";
|
||||
import { createRoot, type Root } from "react-dom/client";
|
||||
|
||||
type ReactRootContainer = (Element | DocumentFragment) & { _reactRoot?: Root };
|
||||
|
||||
unstableSetRender((node, container) => {
|
||||
const target = container as ReactRootContainer;
|
||||
target._reactRoot ??= createRoot(target);
|
||||
const root = target._reactRoot;
|
||||
root.render(node);
|
||||
return async () => {
|
||||
await new Promise((resolve) => {
|
||||
setTimeout(resolve, 0);
|
||||
});
|
||||
root.unmount();
|
||||
};
|
||||
});
|
||||
|
||||
export function AdminAntdRegistry({ children }: { children: ReactNode }) {
|
||||
const [cache] = useState(() => createCache());
|
||||
useServerInsertedHTML(() => {
|
||||
const styleText = extractStyle(cache, { plain: true, once: true });
|
||||
if (styleText.includes('.data-ant-cssinjs-cache-path{content:"";}')) return null;
|
||||
return (
|
||||
<style
|
||||
id="antd-cssinjs"
|
||||
data-rc-order="prepend"
|
||||
data-rc-priority="-1000"
|
||||
dangerouslySetInnerHTML={{ __html: styleText }}
|
||||
/>
|
||||
);
|
||||
});
|
||||
return <StyleProvider cache={cache}>{children}</StyleProvider>;
|
||||
}
|
||||
Reference in New Issue
Block a user