fix(webui): show latest button for hidden content (#6605)

* fix(webui): show latest button for hidden content

* fix(webui): preserve latest navigation after focus scroll
This commit is contained in:
chengyongru authored and GitHub committed 2026-11-09 10:56:26 +08:00
1 parent c5f2ce5089
commit f62dfe0ee8
7 files changed
+243 -23

No files matched your search

+6 -2
View File
@@ -110,7 +110,9 @@ const parameters = new URLSearchParams(location.search);
const railClient = new NanobotClient({ url: "ws://127.0.0.1:8765", reconnect: false });
const railHistory: UIMessage[] = Array.from({ length: 5 }, (_, index) => [
{ id: `u${1995 + index}`, role: "user" as const, content: `Question ${1995 + index}`, createdAt: index + 1 },
{ id: `a${1995 + index}`, role: "assistant" as const, content: "A synthetic answer.\n\n".repeat(8), createdAt: index + 1 },
{ id: `a${1995 + index}`, role: "assistant" as const, content: parameters.has("focus-links") && index === 4
? Array.from({ length: 45 }, (_, i) => `[Reference ${i}](https://example.test/ref${i})`).join("\n")
: "A synthetic answer.\n\n".repeat(8), createdAt: index + 1 },
]).flat();
function RailFixture() {
const [messages, setMessages] = useState(parameters.has("real") ? [] : railHistory);
@@ -148,7 +150,9 @@ function RailFixture() {
<button onClick={() => setStreaming(true)} disabled={streaming}>{streaming ? "Streaming" : "Simulate stream"}</button>
</div>}
{parameters.has("workbench") ? <PaneWorkbench
panes={[{ key: "rail", title: "Rail conversation" }]} activePaneKey="rail" layout="columns" showLayoutControl={false}
panes={parameters.has("focus-links")
? [{ key: "rail", title: "Rail conversation" }, { key: "other", title: "Other conversation" }]
: [{ key: "rail", title: "Rail conversation" }]} activePaneKey="rail" layout="columns" showLayoutControl={false}
onActivatePane={() => {}} onAddPane={() => {}} onLayoutChange={() => {}} onPaneOrderChange={() => {}}
renderPane={(_pane, context) => <>
{viewport(context.composerPortalTarget !== undefined, context.navigationFrame)}