Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): stop the resting composer layout loop #9393

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/9393/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 7 changed files with 101 additions and 74 deletions (loading 4).

x
0 of 7 viewed, 7 left
6 additions and 72 deletionsapps/web/src/components/chat/ChatComposer.tsxModified
View file
@@ -150,6 +150,7 @@
shouldUseCompactComposerFooter,
shouldUseRestingComposerLayout,
} from "../composerFooterLayout";
+import { measureRestingComposerControls } from "./restingComposerControlsMeasurement";
import { observeResponsiveBreakpointFade, usePanelAnimationSettings } from "../../panelAnimations";
import { type ComposerPromptEditorHandle, ComposerPromptEditor } from "../ComposerPromptEditor";
import { ProviderModelPicker } from "./ProviderModelPicker";
@@ -852,44 +853,6 @@
): boolean =>
contexts.length === ids.length && contexts.every((context, index) => context.id === ids[index]);
​
-function elementOuterWidth(element: HTMLElement): number {
- const width = element.getBoundingClientRect().width;
- if (width === 0) return 0;
- const style = getComputedStyle(element);
- return (
- width +
- (Number.parseFloat(style.marginInlineStart) || 0) +
- (Number.parseFloat(style.marginInlineEnd) || 0)
- );
-}
-​
-function elementInlineMarginWidth(element: HTMLElement): number {
- const style = getComputedStyle(element);
- return (
- (Number.parseFloat(style.marginInlineStart) || 0) +
- (Number.parseFloat(style.marginInlineEnd) || 0)
- );