From cdf20c4586d480cb057da707261a115a3e532cda Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sat, 13 Jun 2026 17:55:51 -0500 Subject: [PATCH] minor size adjustments for some icons --- src/app/components/icons/phosphor.tsx | 6 ++ .../components/image-viewer/ImageViewer.tsx | 6 +- .../components/room-avatar/RoomAvatar.css.ts | 66 ++++++++-------- .../components/user-profile/CreatorChip.tsx | 4 +- src/app/components/user-profile/PowerChip.tsx | 4 +- src/app/components/user-profile/UserChips.tsx | 12 +-- src/app/components/user-profile/UserHero.tsx | 4 +- .../user-profile/UserModeration.tsx | 8 +- .../user-profile/UserRoomProfile.tsx | 19 +++-- src/app/features/call/CallControls.tsx | 58 +++++++------- src/app/features/create-room/CreateRoom.tsx | 76 +++++++++---------- src/app/features/settings/Settings.tsx | 3 +- 12 files changed, 136 insertions(+), 130 deletions(-) diff --git a/src/app/components/icons/phosphor.tsx b/src/app/components/icons/phosphor.tsx index d7ab528d1..5dfb3a89c 100644 --- a/src/app/components/icons/phosphor.tsx +++ b/src/app/components/icons/phosphor.tsx @@ -114,6 +114,7 @@ import { UserCircle, UserMinus, UserPlus, + UsersThree, VideoCamera, VideoCameraSlash, Warning, @@ -179,6 +180,10 @@ export function chipIcon(Icon: PhosphorIcon, props?: IconProps): ReactNode { return ; } +export function profileIcon(Icon: PhosphorIcon, props?: IconAtProps): ReactNode { + return iconAt(Icon, '100', props); +} + /** Caret in chip `after` slots — flex-centered so Phosphor glyphs align with label text. */ export function chipCaretIcon(Icon: PhosphorIcon, props?: IconProps): ReactNode { const { style, ...rest } = props ?? {}; @@ -339,6 +344,7 @@ export { UserCircle, UserMinus, UserPlus, + UsersThree, VideoCamera, VideoCameraSlash, Warning, diff --git a/src/app/components/image-viewer/ImageViewer.tsx b/src/app/components/image-viewer/ImageViewer.tsx index 48d1a6aa3..ee911fcf0 100644 --- a/src/app/components/image-viewer/ImageViewer.tsx +++ b/src/app/components/image-viewer/ImageViewer.tsx @@ -92,7 +92,7 @@ export const ImageViewer = as<'div', ImageViewerProps>(
- {iconAt(ArrowLeft, '50')} + {iconAt(ArrowLeft, '200')} {alt} @@ -125,7 +125,7 @@ export const ImageViewer = as<'div', ImageViewerProps>( aria-label="View Original Size" title="View Original Size" > - {iconAt(Image, '50')} + {iconAt(Image, '200')} ( aria-label="Reset Zoom" title="Zoom to Fill Container" > - {iconAt(ArrowsClockwise, '50')} + {iconAt(ArrowsClockwise, '200')} } + before={cords ? profileIcon(CaretDown) : } after={tagIconSrc ? : undefined} onClick={open} aria-pressed={!!cords} diff --git a/src/app/components/user-profile/PowerChip.tsx b/src/app/components/user-profile/PowerChip.tsx index 81a3dca7a..2ee150453 100644 --- a/src/app/components/user-profile/PowerChip.tsx +++ b/src/app/components/user-profile/PowerChip.tsx @@ -18,7 +18,7 @@ import { Text, toRem, } from 'folds'; -import { CaretDown, iconAt, menuIcon, X } from '$components/icons/phosphor'; +import { CaretDown, menuIcon, profileIcon, X } from '$components/icons/phosphor'; import type { CSSProperties } from 'react'; import type { MouseEventHandler } from 'react'; import { useCallback, useState } from 'react'; @@ -367,7 +367,7 @@ export function PowerChip({ } before={ cords ? ( - iconAt(CaretDown, '50') + profileIcon(CaretDown) ) : ( <> {!changing && } diff --git a/src/app/components/user-profile/UserChips.tsx b/src/app/components/user-profile/UserChips.tsx index 1b57a7e33..a3a40d411 100644 --- a/src/app/components/user-profile/UserChips.tsx +++ b/src/app/components/user-profile/UserChips.tsx @@ -25,9 +25,9 @@ import { Check, DotsThree, HardDrives, - iconAt, Link, PencilSimple, + profileIcon, Prohibit, } from '$components/icons/phosphor'; import { useMatrixClient } from '$hooks/useMatrixClient'; @@ -195,7 +195,7 @@ export function ServerChip({ setEditingNick(true)} className={css.UserHeroMenuItem} style={heroMenuItemStyle( @@ -752,7 +752,7 @@ export function OptionsChip({ className={css.UserHeroMenuItem} style={heroMenuItemStyle({ backgroundColor: menuItemBg }, chipHoverBrightness)} before={ - ignoring ? : iconAt(Prohibit, '50') + ignoring ? : profileIcon(Prohibit) } disabled={ignoring} > @@ -777,7 +777,7 @@ export function OptionsChip({ chipHoverBrightness )} > - {ignoring ? : iconAt(DotsThree, '50')} + {ignoring ? : profileIcon(DotsThree)} ); diff --git a/src/app/components/user-profile/UserHero.tsx b/src/app/components/user-profile/UserHero.tsx index e6c4d8be2..d98284e46 100644 --- a/src/app/components/user-profile/UserHero.tsx +++ b/src/app/components/user-profile/UserHero.tsx @@ -27,7 +27,7 @@ import { useBlobCache } from '$hooks/useBlobCache'; import { ImageViewer } from '$components/image-viewer'; import { AvatarPresence, PresenceBadge } from '$components/presence'; import { UserAvatar } from '$components/user-avatar'; -import { CaretDown, CaretUp, iconAt, userFallbackIcon } from '$components/icons/phosphor'; +import { CaretDown, CaretUp, profileIcon, userFallbackIcon } from '$components/icons/phosphor'; import { ClientSideHoverFreeze } from '$components/ClientSideHoverFreeze'; import { useUserProfile } from '$hooks/useUserProfile'; import { shadeColor, areColorsTooSimilar } from '$utils/shadeColor'; @@ -213,7 +213,7 @@ export function UserHero({ userId, avatarUrl, bannerUrl, presence, autoplayGifs alignSelf: isFullStatus ? 'flex-start' : 'center', }} > - {iconAt(isFullStatus ? CaretUp : CaretDown, '50')} + {profileIcon(isFullStatus ? CaretUp : CaretDown)} )} diff --git a/src/app/components/user-profile/UserModeration.tsx b/src/app/components/user-profile/UserModeration.tsx index 5427d751c..bc796cc7f 100644 --- a/src/app/components/user-profile/UserModeration.tsx +++ b/src/app/components/user-profile/UserModeration.tsx @@ -1,5 +1,5 @@ import { Box, Button, color, config, Spinner, Text, Input } from 'folds'; -import { ArrowLeft, ArrowRight, iconAt, Prohibit } from '$components/icons/phosphor'; +import { ArrowLeft, ArrowRight, profileIcon, Prohibit } from '$components/icons/phosphor'; import { useCallback, useRef } from 'react'; import { useRoom } from '$hooks/useRoom'; import { AsyncStatus, useAsyncCallback } from '$hooks/useAsyncCallback'; @@ -296,7 +296,7 @@ export function UserModeration({ userId, canKick, canBan, canInvite }: UserModer inviteState.status === AsyncStatus.Loading ? ( ) : ( - iconAt(ArrowRight, '50') + profileIcon(ArrowRight) ) } onClick={invite} @@ -316,7 +316,7 @@ export function UserModeration({ userId, canKick, canBan, canInvite }: UserModer kickState.status === AsyncStatus.Loading ? ( ) : ( - iconAt(ArrowLeft, '50') + profileIcon(ArrowLeft) ) } onClick={kick} @@ -336,7 +336,7 @@ export function UserModeration({ userId, canKick, canBan, canInvite }: UserModer banState.status === AsyncStatus.Loading ? ( ) : ( - iconAt(Prohibit, '50') + profileIcon(Prohibit) ) } onClick={ban} diff --git a/src/app/components/user-profile/UserRoomProfile.tsx b/src/app/components/user-profile/UserRoomProfile.tsx index bbf33a4f1..974e47266 100644 --- a/src/app/components/user-profile/UserRoomProfile.tsx +++ b/src/app/components/user-profile/UserRoomProfile.tsx @@ -11,10 +11,9 @@ import { CaretDown, CaretUp, ChatCircle, - chipIcon, Clock, Heart, - iconAt, + profileIcon, User, } from '$components/icons/phosphor'; import { mxcUrlToHttp } from '$utils/matrix'; @@ -206,7 +205,7 @@ function UserExtendedSection({ }} onClick={() => handleMiscSelector(-1)} > - {iconAt(CaretUp, '50')} + {profileIcon(CaretUp)} Show less {unknownFields.map(([key], index) => ( @@ -232,7 +231,7 @@ function UserExtendedSection({ size="300" className={css.MiscDataToggleButton} onClick={() => setShowMisc(!showMisc)} - after={iconAt(miscDataIndex === -1 ? CaretDown : CaretUp, '50')} + after={profileIcon(miscDataIndex === -1 ? CaretDown : CaretUp)} style={{ padding: '1rem', justifyContent: 'flex-start', @@ -258,7 +257,7 @@ function UserExtendedSection({ {pronouns && ( - {chipIcon(User, { style: { opacity: 0.5 } })} + {profileIcon(User, { style: { opacity: 0.5 } })} {pronouns} @@ -266,7 +265,7 @@ function UserExtendedSection({ )} {localTime && profile.timezone && ( - {iconAt(Clock, '50', { style: { opacity: 0.5 } })} + {profileIcon(Clock, { style: { opacity: 0.5 } })} {localTime} ({profile.timezone.replaceAll(/^["']|["']$/g, '')}) @@ -274,7 +273,7 @@ function UserExtendedSection({ )} {catStatusText && ( - {iconAt(Heart, '50', { style: { opacity: 0.5 } })} + {profileIcon(Heart, { style: { opacity: 0.5 } })} {catStatusText} @@ -343,7 +342,7 @@ function UserExtendedSection({ } style={{ color: textColor }} > - {iconAt(ArrowLeft, '50')} + {profileIcon(ArrowLeft)} )} {miscHeader} @@ -355,7 +354,7 @@ function UserExtendedSection({ onClick={() => setMiscDataIndex((miscDataIndex + 1) % unknownFields.length)} style={{ color: textColor }} > - {iconAt(ArrowRight, '50')} + {profileIcon(ArrowRight)} )} @@ -589,7 +588,7 @@ export function UserRoomProfile({ userId, initialProfile }: Readonly callEmbed.hangup(), [callEmbed]) + useCallback(() => callEmbed.hangup(), [callEmbed]), ); const exiting = hangupState.status === AsyncStatus.Loading || hangupState.status === AsyncStatus.Success; @@ -92,15 +92,15 @@ export function CallControls({ callEmbed }: CallControlsProps) { justifyContent="Center" alignItems="Center" style={{ - maxWidth: '100%', + maxWidth: "100%", padding: compact ? `0 ${toRem(8)}` : undefined, - overflowX: 'auto', + overflowX: "auto", }} > callEmbed.control.toggleVideo()} /> @@ -140,7 +140,7 @@ export function CallControls({ callEmbed }: CallControlsProps) { shrink="No" alignItems="Center" justifyContent="Center" - gap={compact ? '100' : '200'} + gap={compact ? "100" : "200"} direction="Row" > {room?.isCallRoom() && } @@ -155,8 +155,8 @@ export function CallControls({ callEmbed }: CallControlsProps) { initialFocus: false, onDeactivate: () => setCords(undefined), clickOutsideDeactivates: true, - isKeyForward: (evt: KeyboardEvent) => evt.key === 'ArrowDown', - isKeyBackward: (evt: KeyboardEvent) => evt.key === 'ArrowUp', + isKeyForward: (evt: KeyboardEvent) => evt.key === "ArrowDown", + isKeyBackward: (evt: KeyboardEvent) => evt.key === "ArrowUp", escapeDeactivates: stopPropagation, }} > @@ -169,7 +169,7 @@ export function CallControls({ callEmbed }: CallControlsProps) { onClick={handleSpotlightClick} > - {spotlight ? 'Grid View' : 'Spotlight View'} + {spotlight ? "Grid View" : "Spotlight View"} {composerIcon(DotsThreeOutlineVerticalIcon, { - weight: cords ? 'fill' : 'regular', + weight: cords ? "fill" : "regular", })} @@ -224,7 +224,7 @@ export function CallControls({ callEmbed }: CallControlsProps) { exiting ? ( ) : ( - iconAt(PhoneDisconnect, '200', { filled: true }) + iconAt(PhoneDisconnect, "200", { filled: true }) ) } disabled={exiting} diff --git a/src/app/features/create-room/CreateRoom.tsx b/src/app/features/create-room/CreateRoom.tsx index 52bc833a3..ef6837aa5 100644 --- a/src/app/features/create-room/CreateRoom.tsx +++ b/src/app/features/create-room/CreateRoom.tsx @@ -1,16 +1,16 @@ -import type { ReactNode, FormEventHandler } from 'react'; -import { useCallback, useEffect, useState } from 'react'; -import type { Room } from '$types/matrix-sdk'; -import { MatrixError, JoinRule, RoomType } from '$types/matrix-sdk'; -import { Box, Button, Chip, color, config, Input, Spinner, Switch, Text, TextArea } from 'folds'; -import { SettingTile } from '$components/setting-tile'; -import { SequenceCard } from '$components/sequence-card'; -import { useMatrixClient } from '$hooks/useMatrixClient'; -import { millisecondsToMinutes, replaceSpaceWithDash } from '$utils/common'; -import { AsyncStatus, useAsyncCallback } from '$hooks/useAsyncCallback'; -import { useCapabilities } from '$hooks/useCapabilities'; -import { useAlive } from '$hooks/useAlive'; -import type { CreateRoomData } from '$components/create-room'; +import type { ReactNode, FormEventHandler } from "react"; +import { useCallback, useEffect, useState } from "react"; +import type { Room } from "$types/matrix-sdk"; +import { MatrixError, JoinRule, RoomType } from "$types/matrix-sdk"; +import { Box, Button, Chip, color, config, Input, Spinner, Switch, Text, TextArea } from "folds"; +import { SettingTile } from "$components/setting-tile"; +import { SequenceCard } from "$components/sequence-card"; +import { useMatrixClient } from "$hooks/useMatrixClient"; +import { millisecondsToMinutes, replaceSpaceWithDash } from "$utils/common"; +import { AsyncStatus, useAsyncCallback } from "$hooks/useAsyncCallback"; +import { useCapabilities } from "$hooks/useCapabilities"; +import { useAlive } from "$hooks/useAlive"; +import type { CreateRoomData } from "$components/create-room"; import { AdditionalCreatorInput, createRoom, @@ -20,10 +20,10 @@ import { RoomVersionSelector, useAdditionalCreators, CreateRoomType, -} from '$components/create-room'; +} from "$components/create-room"; -import { CreateRoomTypeSelector } from '$components/create-room/CreateRoomTypeSelector'; -import { getRoomIconComponent } from '$components/icons/roomIcons'; +import { CreateRoomTypeSelector } from "$components/create-room/CreateRoomTypeSelector"; +import { getRoomStandaloneIconComponent } from "$components/icons/roomIcons"; import { CaretDown, CaretUp, @@ -32,22 +32,22 @@ import { SpeakerHigh, Warning, type IconSizeToken, -} from '$components/icons/phosphor'; -import { createDebugLogger } from '$utils/debugLogger'; +} from "$components/icons/phosphor"; +import { createDebugLogger } from "$utils/debugLogger"; import { restrictedSupported, creatorsSupported, knockSupported, knockRestrictedSupported, -} from '$utils/roomSupport'; -import { ErrorCode } from '../../cs-errorcode'; +} from "$utils/roomSupport"; +import { ErrorCode } from "../../cs-errorcode"; -const debugLog = createDebugLogger('CreateRoom'); +const debugLog = createDebugLogger("CreateRoom"); const getCreateRoomAccessToIcon = ( access: CreateRoomAccess, type?: CreateRoomType, - size: IconSizeToken = '400' + size: IconSizeToken = "400", ): ReactNode => { const isVoiceRoom = type === CreateRoomType.VoiceRoom; @@ -56,14 +56,14 @@ const getCreateRoomAccessToIcon = ( if (access === CreateRoomAccess.Private) joinRule = JoinRule.Knock; return iconAt( - getRoomIconComponent(isVoiceRoom ? RoomType.UnstableCall : undefined, joinRule), - size + getRoomStandaloneIconComponent(isVoiceRoom ? RoomType.UnstableCall : undefined, joinRule), + size, ); }; const getCreateRoomTypeToIcon = (type: CreateRoomType): ReactNode => { - if (type === CreateRoomType.VoiceRoom) return iconAt(SpeakerHigh, '400'); - return iconAt(Hash, '400'); + if (type === CreateRoomType.VoiceRoom) return iconAt(SpeakerHigh, "400"); + return iconAt(Hash, "400"); }; type CreateRoomFormProps = { @@ -82,18 +82,18 @@ export function CreateRoomForm({ const alive = useAlive(); const capabilities = useCapabilities(); - const roomVersions = capabilities['m.room_versions']; - const [selectedRoomVersion, selectRoomVersion] = useState(roomVersions?.default ?? '1'); + const roomVersions = capabilities["m.room_versions"]; + const [selectedRoomVersion, selectRoomVersion] = useState(roomVersions?.default ?? "1"); useEffect(() => { // capabilities load async - selectRoomVersion(roomVersions?.default ?? '1'); + selectRoomVersion(roomVersions?.default ?? "1"); }, [roomVersions?.default]); const allowRestricted = space && restrictedSupported(selectedRoomVersion); const [type, setType] = useState(defaultType ?? CreateRoomType.TextRoom); const [access, setAccess] = useState( - defaultAccess ?? (allowRestricted ? CreateRoomAccess.Restricted : CreateRoomAccess.Private) + defaultAccess ?? (allowRestricted ? CreateRoomAccess.Restricted : CreateRoomAccess.Private), ); const allowAdditionalCreators = creatorsSupported(selectedRoomVersion); const { additionalCreators, addAdditionalCreator, removeAdditionalCreator } = @@ -115,7 +115,7 @@ export function CreateRoomForm({ }; const [createState, create] = useAsyncCallback( - useCallback((data) => createRoom(mx, data), [mx]) + useCallback((data) => createRoom(mx, data), [mx]), ); const loading = createState.status === AsyncStatus.Loading; const error = createState.status === AsyncStatus.Error ? createState.error : undefined; @@ -147,7 +147,7 @@ export function CreateRoomForm({ let roomType: RoomType | undefined; if (type === CreateRoomType.VoiceRoom) roomType = RoomType.UnstableCall; - debugLog.info('ui', 'Create room button clicked', { + debugLog.info("ui", "Create room button clicked", { roomName, access, type, @@ -170,7 +170,7 @@ export function CreateRoomForm({ allowFederation: federation, additionalCreators: allowAdditionalCreators ? additionalCreators : undefined, }).then((roomId) => { - debugLog.info('ui', 'Room created successfully', { + debugLog.info("ui", "Room created successfully", { roomId, roomName, access, @@ -209,7 +209,7 @@ export function CreateRoomForm({ Name setAdvance(!advance)} type="button" > @@ -326,7 +326,7 @@ export function CreateRoomForm({ {advance && ( - {iconAt(Warning, '100', { filled: true })} + {iconAt(Warning, "100", { filled: true })} {error instanceof MatrixError && error.name === (ErrorCode.M_LIMIT_EXCEEDED as string) ? `Server rate-limited your request for ${millisecondsToMinutes( - (error.data.retry_after_ms as number | undefined) ?? 0 + (error.data.retry_after_ms as number | undefined) ?? 0, )} minutes!` : error.message} diff --git a/src/app/features/settings/Settings.tsx b/src/app/features/settings/Settings.tsx index 92ecb7b09..bf22676a0 100644 --- a/src/app/features/settings/Settings.tsx +++ b/src/app/features/settings/Settings.tsx @@ -42,6 +42,7 @@ import { Smiley, Terminal, User, + UsersThree, X, } from '$components/icons/phosphor'; import { About } from './about'; @@ -90,7 +91,7 @@ const settingsMenuIcons: Record< > = { general: { icon: GearSix }, account: { icon: User }, - persona: { icon: User }, + persona: { icon: UsersThree }, appearance: { icon: Palette }, notifications: { icon: Bell }, devices: { icon: DevicesIcon },