Fix the small mechanical rules. [skip build]
Checks / checks (push) Successful in 2m12s
Trigger cinny-mobile / dispatch (push) Successful in 1s

This commit is contained in:
2026-11-01 10:28:59 +11:00
parent bb85cd9778
commit 73554ecf7f
45 changed files with 331 additions and 347 deletions
+6 -6
View File
@@ -88,12 +88,12 @@ export function RouteTransition({ children }: RouteTransitionProps) {
};
}, [location, displayLocation]);
const className =
transitionStage === 'entering'
? `${transitionContent} ${animateIn}`
: transitionStage === 'exiting'
? `${transitionContent} ${animateOut}`
: transitionContent;
let className = transitionContent;
if (transitionStage === 'entering') {
className = `${transitionContent} ${animateIn}`;
} else if (transitionStage === 'exiting') {
className = `${transitionContent} ${animateOut}`;
}
return (
<div className={transitionContainer}>
@@ -119,16 +119,17 @@ export function RoomMentionAutocomplete({
}
const parentsList = Array.from(parents);
const [firstParent] = parentsList;
let chosenParent: string;
if (parentsList.length === 1) {
chosenParent = parentsList[0];
chosenParent = firstParent;
} else {
const orphanParents = parentsList.filter((p) => !roomToParents.has(p));
if (orphanParents.length > 0) {
chosenParent = guessPerfectParent(mx, currentRoomId, orphanParents) ?? orphanParents[0];
} else {
chosenParent = parentsList[0];
chosenParent = firstParent;
}
}
+8 -7
View File
@@ -21,17 +21,18 @@ export const Icon = forwardRef<SVGSVGElement, IconProps>(
) => {
const pixelSize = ICON_PIXEL_SIZES[size];
let iconStyle = style;
if (size === 'Inherit') {
iconStyle = { width: '1em', height: '1em', ...style };
} else if (pixelSize) {
iconStyle = { width: pixelSize, height: pixelSize, ...style };
}
return (
<LucideIconComponent
ref={ref}
className={classNames(iconStyles.Icon({ size }), className)}
style={
size === 'Inherit'
? { width: '1em', height: '1em', ...style }
: pixelSize
? { width: pixelSize, height: pixelSize, ...style }
: style
}
style={iconStyle}
// Lucide icons are stroke-based; solid fill turns faces (e.g. Smile) into blobs.
// Emphasize selection with a heavier stroke instead.
strokeWidth={filled ? 2.75 : 2}
@@ -70,10 +70,10 @@ function cornerPeelPaths(
const px = cx + ux * size;
const py = cy + uy * size;
let ax = 0;
let ay = 0;
let bx = 0;
let by = 0;
let ax;
let ay;
let bx;
let by;
if (id === 'tr') {
ax = clamp(Math.abs(ux) > eps ? px + (py * uy) / ux : px, 0, w);
+1 -1
View File
@@ -25,7 +25,7 @@ export const Time = as<'span', TimeProps & ComponentProps<typeof Text>>(
({ compact, hour24Clock, dateFormatString, ts, ...props }, ref) => {
const formattedTime = timeHourMinute(ts, hour24Clock);
let time = '';
let time;
if (compact) {
time = formattedTime;
} else if (today(ts)) {
@@ -24,17 +24,14 @@ export function SpeechBubble({
}: SpeechBubbleProps) {
const isMenu = variant === 'menu';
let tailClass: string | undefined;
if (tail === 'top') {
tailClass = isMenu ? css.SpeechBubbleMenuTailTop : css.SpeechBubbleTailTop;
}
return (
<div
className={classNames(
isMenu ? css.SpeechBubbleMenu : css.SpeechBubble,
tail === 'top'
? isMenu
? css.SpeechBubbleMenuTailTop
: css.SpeechBubbleTailTop
: undefined,
className,
)}
className={classNames(isMenu ? css.SpeechBubbleMenu : css.SpeechBubble, tailClass, className)}
style={{
...(tailX ? ({ ['--speech-tail-x' as string]: tailX } as React.CSSProperties) : null),
...style,
+3 -2
View File
@@ -564,10 +564,11 @@ export function TitleBar({ mx, children }: TitleBarProps) {
// Pick the best parent (or first if only one)
const parentsList = Array.from(parents);
const [firstParent] = parentsList;
let chosenParent: string;
if (parentsList.length === 1) {
chosenParent = parentsList[0];
chosenParent = firstParent;
} else {
// Use heuristic to pick best parent
// Prefer a parent that is itself a top-level space (orphan)
@@ -577,7 +578,7 @@ export function TitleBar({ mx, children }: TitleBarProps) {
chosenParent = guessPerfectParent(mx, currentRoomId, orphanParents) ?? orphanParents[0];
} else {
// All parents have parents themselves, just pick first and continue
chosenParent = parentsList[0];
chosenParent = firstParent;
}
}
@@ -133,7 +133,6 @@ export function UserHero({ userId, avatarUrl, avatarMxc, presence, children }: U
type UserHeroNameProps = {
displayName?: string;
userId: string;
avatarMxc?: string;
};
export function UserHeroName({ displayName, userId }: UserHeroNameProps) {
const username = getMxIdLocalPart(userId);