fix(stream-header): tighten Segment paddings and cluster gaps so plus/search icons stop clipping past the right edge on 360 px Android viewports

This commit is contained in:
heaven 2026-05-27 23:48:49 +03:00
parent 443213b4b6
commit 136aacded1
2 changed files with 28 additions and 8 deletions

View file

@ -82,7 +82,14 @@ export const tabsRow = style({
height: toRem(TABS_ROW_PX), height: toRem(TABS_ROW_PX),
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
padding: `0 ${toRem(8)}`, // Horizontal padding is tuned for the narrowest target: Android 360 px
// viewport (Pixel/Galaxy base) must fit 3 RU segments (Личные/Каналы/
// Роботы) + Plus + Search without iconsCluster being pushed past the
// right edge. Reducing this from 8 → 6 saves 4 px across the row;
// combined with the tightened Segment / cluster gaps below, the floor
// drops from ≈378 px to ≈350 px. See sidebarWidth.ts for the desktop
// resize floor that mirrors this measurement.
padding: `0 ${toRem(6)}`,
selectors: { selectors: {
'[data-platform="web"] &': { '[data-platform="web"] &': {
height: toRem(WEB_TABS_ROW_PX), height: toRem(WEB_TABS_ROW_PX),
@ -94,14 +101,17 @@ export const tabsRow = style({
export const tabsCluster = style({ export const tabsCluster = style({
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
gap: toRem(4), // Tightened from 4 → 2 px so the 3 RU segments + 2 action icons fit
// inside a 360 px viewport (standard Android base width). See the
// `tabsRow` padding comment for the full row-fit budget.
gap: toRem(2),
alignSelf: 'stretch', alignSelf: 'stretch',
}); });
export const iconsCluster = style({ export const iconsCluster = style({
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
gap: toRem(4), gap: toRem(2),
flexShrink: 0, flexShrink: 0,
}); });
@ -242,6 +252,13 @@ export const bottomPinnedSlot = style({
}); });
// Segment button (Direct / Channels / Bots). // Segment button (Direct / Channels / Bots).
//
// Horizontal padding (8 px) and dot-to-label gap (6 px) are the tightest
// values that still keep the tap target comfortable on touch. They're
// load-bearing for the row-fit budget on 360 px Android viewports — see
// `tabsRow` above. Vertical padding (8 px) is kept full for hit-target
// height; the row is height-fixed by `TABS_ROW_PX` so trimming vertical
// padding wouldn't buy any width.
export const segment = recipe({ export const segment = recipe({
base: { base: {
appearance: 'none', appearance: 'none',
@ -249,14 +266,14 @@ export const segment = recipe({
background: 'transparent', background: 'transparent',
color: color.Background.OnContainer, color: color.Background.OnContainer,
cursor: 'pointer', cursor: 'pointer',
padding: `${toRem(8)} ${toRem(10)}`, padding: toRem(8),
borderRadius: toRem(8), borderRadius: toRem(8),
font: 'inherit', font: 'inherit',
fontSize: toRem(14), fontSize: toRem(14),
lineHeight: 1.2, lineHeight: 1.2,
display: 'inline-flex', display: 'inline-flex',
alignItems: 'center', alignItems: 'center',
gap: toRem(8), gap: toRem(6),
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
fontWeight: 500, fontWeight: 500,
WebkitAppearance: 'none', WebkitAppearance: 'none',

View file

@ -7,9 +7,12 @@ import {
export const SIDEBAR_WIDTH_KEY = 'vojo_sidebar_width'; export const SIDEBAR_WIDTH_KEY = 'vojo_sidebar_width';
// Floor must fit the StreamHeader tabs row in full: 3 segment buttons // Floor must fit the StreamHeader tabs row in full: 3 segment buttons
// (Личные/Каналы/Роботы — RU is the widest locale) plus the two // (Личные/Каналы/Роботы — RU is the widest locale) plus the two
// action icons (Plus / Search) plus the row's 8px horizontal padding. // action icons (Plus / Search) plus the row's horizontal padding.
// Measured at ≈378px in RU; 384 gives a few px of breathing room and // After tightening Segment / cluster paddings + gaps (see StreamHeader.
// keeps the icon cluster from clipping at the curtain's right edge. // css.ts::tabsRow comment) the row now fits at ≈350px; 384 keeps a
// comfortable margin for desktop chat-list readability without being
// the binding constraint anymore. Lowering this further is a list-row
// usability decision, not a header-fit one.
export const SIDEBAR_WIDTH_MIN = 384; export const SIDEBAR_WIDTH_MIN = 384;
export const SIDEBAR_WIDTH_DEFAULT = 416; export const SIDEBAR_WIDTH_DEFAULT = 416;