fix(dashboard): write ChatView visualViewport vars imperatively
The mobile composer/footer slid over the message list when the user swiped with the keyboard up. Cause: --vv-height / --vv-offset-top were routed through React state via useMobileKeyboard, so on iOS — which fires visualViewport scroll/resize on the same frame as its keyboard animation — the .chat-thread translation lagged by one paint, visible as the composer momentarily floating over messages. Now those two vars are written imperatively in a useLayoutEffect directly to the .chat-thread DOM node on every visualViewport event, mirroring the working pattern at QuickChatFAB.tsx:1032-1052 (which already works correctly on mobile). Only --keyboard-overlap (a structural open/close signal, not per-frame) still flows through React state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -51,7 +51,8 @@ describe("HermesRuntimeAdapter — promptWithFallback", () => {
|
||||
await adapter.promptWithFallback(session, "first prompt");
|
||||
expect(mockInvoke).toHaveBeenCalledTimes(1);
|
||||
const [prompt, settings, resumeId] = mockInvoke.mock.calls[0];
|
||||
expect(prompt).toBe("first prompt");
|
||||
expect(prompt).toContain("User request:\nfirst prompt");
|
||||
expect(prompt).toContain("Fusion runtime context:");
|
||||
expect(settings.model).toBe("claude-sonnet-4-5");
|
||||
expect(resumeId).toBeUndefined();
|
||||
expect(onText).toHaveBeenCalledWith("hello from hermes");
|
||||
@@ -66,7 +67,8 @@ describe("HermesRuntimeAdapter — promptWithFallback", () => {
|
||||
});
|
||||
await adapter.promptWithFallback(session, "p1");
|
||||
await adapter.promptWithFallback(session, "p2");
|
||||
const [, , resume2] = mockInvoke.mock.calls[1];
|
||||
const [prompt2, , resume2] = mockInvoke.mock.calls[1];
|
||||
expect(prompt2).toBe("p2");
|
||||
expect(resume2).toBe("20260427_120000_abc123");
|
||||
});
|
||||
it("propagates CLI errors", async () => {
|
||||
|
||||
Reference in New Issue
Block a user