Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): settle the resting composer layout with a pixel of slack #9482

Mergedmatheustimbo(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/9482/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 107 additions and 4 deletions.

x
0 of 3 viewed, 3 left
5 additions and 1 deletionapps/web/src/components/chat/ChatComposer.tsxModified
View file
@@ -876,7 +876,11 @@
const hostWidth = currentHost.clientWidth;
​
setLayout((current) => {
- const next = resolveRestingComposerControlsLayout({ ...measurement, hostWidth });
+ const next = resolveRestingComposerControlsLayout({
+ ...measurement,
+ hostWidth,
+ previous: current,
+ });
return next.hiddenCount === current.hiddenCount && next.visible === current.visible
? current
: next;
79 additions and 0 deletionsapps/web/src/components/composerFooterLayout.test.tsModified
View file
@@ -277,3 +277,82 @@
).toEqual({ hiddenCount: 2, visible: true });
});
});
+​
+describe("resolveRestingComposerControlsLayout hysteresis", () => {
+ // Same cluster as above: picker 140 natural / 96 minimum plus a 9px
+ // separator, traits 60, mode 140, overflow 24, gap 4.
+ const base = {
+ gap: 4,
+ naturalFixedWidth: 149,
+ minimumFixedWidth: 105,
+ blockWidths: [60, 140],