Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/ui/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ const PATHS: Record<IconName, React.ReactNode> = {
),
gear: (
<>
{/* 톱니는 Lucide `settings`(lucide-static 0.460.0, ISC — https://lucide.dev/license)의 경로 그대로다. 옛 그림은 이가 뾰족하고 잘려 보였다(2026-11-05) */}
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2Z" />
<circle cx="12" cy="12" r="3" />
<path d="M19.4 13.5a7.6 7.6 0 0 0 0-3l2-1.5-2-3.5-2.4 1a7.5 7.5 0 0 0-2.6-1.5L14 2.5h-4l-.4 2.5A7.5 7.5 0 0 0 7 6.5l-2.4-1-2 3.5 2 1.5a7.6 7.6 0 0 0 0 3l-2 1.5 2 3.5 2.4-1a7.5 7.5 0 0 0 2.6 1.5l.4 2.5h4l.4-2.5a7.5 7.5 0 0 0 2.6-1.5l2.4 1 2-3.5Z" />
</>
),
arrow: <path d="M5 12h13m-5-5.5L18.5 12 13 17.5" />,
Expand Down
3 changes: 2 additions & 1 deletion mobile/src/app/me/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Icon } from '@/ui/icons';
import { Logo } from '@/ui/logo';
import { SecondaryButton } from '@/ui/parts';
import { COLOR, ELEMENT_TONE, FONT, RADIUS, TYPE } from '@/ui/tokens';
import { KEEP_VIEW } from '@/ui/keep-view';

/** 웹 머리글의 `MEMBER_TABS` 와 같은 넷 · 같은 글자다. 궁합의 첫 화면은 앱에서 `/me/compat` 다. 인연이 닫힌 동안은 홈 · 궁합 둘이다(ADR 0222) */
const TABS = [
Expand Down Expand Up @@ -136,7 +137,7 @@ export default function MeLayout() {
onPress={() => goTab(tab.href)}
style={styles.tab}
>
<View style={[styles.tabMark, active && styles.tabMarkOn]}>
<View {...KEEP_VIEW} style={[styles.tabMark, active && styles.tabMarkOn]}>
<Icon name={tab.icon} color={active ? ELEMENT_TONE.木.ink : COLOR.secondary} />
</View>
<Text style={[styles.tabLabel, active && styles.tabLabelOn]}>{tab.label}</Text>
Expand Down
3 changes: 2 additions & 1 deletion mobile/src/app/me/chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { noteActivity, readRoomListScreen, type ChatRoom, type RoomListScreen }
import { Icon } from '@/ui/icons';
import { LoadingMark } from '@/ui/loading';
import { COLOR, FONT, RADIUS, TYPE } from '@/ui/tokens';
import { KEEP_VIEW } from '@/ui/keep-view';

/** 한 물결의 변경을 묶어 다시 읽는 간격 — 웹의 `REDRAW_AFTER_MS` 와 같다 */
const REREAD_AFTER_MS = 400;
Expand Down Expand Up @@ -146,7 +147,7 @@ function RoomRow({ room }: { room: ChatRoom }) {
accessibilityRole="link"
accessibilityLabel={unread > 0 ? `${name} ${unread}건 안 읽음` : name}
onPress={() => router.push(`/me/chat/${room.matchId}` as never)}
style={({ pressed }) => [styles.row, pressed && styles.pressed]}
{...KEEP_VIEW} style={({ pressed }) => [styles.row, pressed && styles.pressed]}
>
<Avatar nickname={name} size={56} tone={null} dim={closed} userId={room.partnerUserId} hasPhoto={room.partnerHasPhoto} focus={room.partnerPhotoFocus} />
<View style={styles.rowBody}>
Expand Down
3 changes: 2 additions & 1 deletion mobile/src/chart/parts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { Rich as RichParts, RichPart } from '@saju-view/notes';

import { Card as CardFace } from '@/ui/surfaces';
import { COLOR, CONTROL, FONT, RADIUS, TYPE } from '@/ui/tokens';
import { KEEP_VIEW } from '@/ui/keep-view';

/** 한자 — 부산단디명조에 없어 기기 서체다(웹의 `.glyph`) */
const GLYPH_FONT = Platform.select({ ios: 'System', android: 'sans-serif', default: 'system-ui' });
Expand Down Expand Up @@ -147,7 +148,7 @@ export function Tabs({ tabs, initial, label, small = false }: { tabs: readonly T
accessibilityRole="tab"
accessibilityState={{ selected }}
onPress={() => setView(tab.key)}
style={[styles.tab, selected && styles.tabChosen]}
{...KEEP_VIEW} style={[styles.tab, selected && styles.tabChosen]}
>
<T size={small ? 'small' : 'sm'} tone={selected ? 'foreground' : 'secondary'} bold>
{tab.label}
Expand Down
3 changes: 2 additions & 1 deletion mobile/src/chat/dialogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Icon } from '@/ui/icons';
import { ConfirmDialog, DialogText } from '@/ui/confirm-dialog';
import { DialogPanel } from '@/ui/surfaces';
import { COLOR, CONTROL, FONT, RADIUS, TYPE } from '@/ui/tokens';
import { KEEP_VIEW } from '@/ui/keep-view';

import { blockUser, reportMessage, reportUser, type SaveAnswer } from './reads';

Expand Down Expand Up @@ -129,7 +130,7 @@ export function ReportDialog({
accessibilityRole="button"
accessibilityState={{ selected: chosen }}
onPress={() => setPicked(chosen ? null : message.id)}
style={[styles.pick, chosen && styles.picked]}
{...KEEP_VIEW} style={[styles.pick, chosen && styles.picked]}
>
<View style={styles.pickText}>
<Text numberOfLines={2} style={styles.pickBody}>
Expand Down
3 changes: 2 additions & 1 deletion mobile/src/matching/people.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Photo } from '@/ui/photo';
import { ConfirmDialog, DialogText } from '@/ui/confirm-dialog';
import { DetailSheet } from '@/ui/sheet';
import { COLOR, ELEMENT_TONE, FONT, RADIUS, TYPE } from '@/ui/tokens';
import { KEEP_VIEW } from '@/ui/keep-view';
import { Tile } from '@/ui/surfaces';

import { blockUser, reportUser } from './doors';
Expand Down Expand Up @@ -254,7 +255,7 @@ export function ReportBlock({ userId, nickname, onPhoto = false, onBlocked }: {
accessibilityRole="button"
accessibilityLabel="신고 · 차단"
onPress={() => setMenu(true)}
style={[styles.more, onPhoto && styles.moreOnPhoto]}
{...KEEP_VIEW} style={[styles.more, onPhoto && styles.moreOnPhoto]}
>
<Icon size={20} name="more" color={onPhoto ? '#ffffff' : COLOR.foreground} />
</Pressable>
Expand Down
3 changes: 2 additions & 1 deletion mobile/src/settings/discovery-rows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { PREFER_GENDER_KO } from '@discovery/copy';
import { saveFailureOf, setParticipation } from '@/reading/chart-writes';
import { followRefusal } from '@/reading/panel';
import { COLOR, FONT, RADIUS, TYPE } from '@/ui/tokens';
import { KEEP_VIEW } from '@/ui/keep-view';

import { FailureLine, SwitchRow, useDoneNote } from './parts';
import { savePreferGender } from './settings';
Expand Down Expand Up @@ -109,7 +110,7 @@ export function PreferenceRow({ current }: { current: PreferGender }) {
{PREFER_GENDER_ORDER.map((value) => {
const on = chosen === value;
return (
<Pressable key={value} accessibilityRole="radio" accessibilityState={{ checked: on }} onPress={() => choose(value)} style={[styles.choice, on && styles.chosen]}>
<Pressable key={value} accessibilityRole="radio" accessibilityState={{ checked: on }} onPress={() => choose(value)} {...KEEP_VIEW} style={[styles.choice, on && styles.chosen]}>
<Text style={[styles.choiceText, on && styles.chosenText]}>{PREFER_GENDER_KO[value]}</Text>
</Pressable>
);
Expand Down
3 changes: 2 additions & 1 deletion mobile/src/ui/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ const shapes = (color: string): Record<IconName, ReactNode> => ({
),
gear: (
<>
{/* 톱니는 Lucide `settings`(lucide-static 0.460.0, ISC — https://lucide.dev/license)의 경로 그대로다. 옛 그림은 이가 뾰족하고 잘려 보였다(2026-11-05) */}
<Path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2Z" />
<Circle cx="12" cy="12" r="3" />
<Path d="M19.4 13.5a7.6 7.6 0 0 0 0-3l2-1.5-2-3.5-2.4 1a7.5 7.5 0 0 0-2.6-1.5L14 2.5h-4l-.4 2.5A7.5 7.5 0 0 0 7 6.5l-2.4-1-2 3.5 2 1.5a7.6 7.6 0 0 0 0 3l-2 1.5 2 3.5 2.4-1a7.5 7.5 0 0 0 2.6-1.5l.4 2.5h4l.4-2.5a7.5 7.5 0 0 0 2.6-1.5l2.4 1 2-3.5Z" />
</>
),
reading: <Path d="M12 6.5C10.2 5 7.6 4.5 4 4.8v13.4c3.6-.3 6.2.2 8 1.8 1.8-1.6 4.4-2.1 8-1.8V4.8c-3.6-.3-6.2.2-8 1.7Zm0 0V20" />,
Expand Down
12 changes: 12 additions & 0 deletions mobile/src/ui/keep-view.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* **모서리를 지키는 뷰** — 처음에 바탕이 없다가 고르거나 누르면 바탕이 서는 둥근 자리에 펼친다(`<View {...KEEP_VIEW} style={…}>`).
*
* 안드로이드(새 구조, RN 0.88.1)는 바탕 · 테두리가 없는 뷰를 펼쳐 없앤다(view flattening). 나중에 바탕이 서면 그 자리에 네이티브 뷰를
* 새로 짓는데, 바뀐 값(`backgroundColor`)만 받고 `borderRadius` 는 못 받아 **둥근 표시가 네모로 선다** — 2026-11-05 운영 APK 의 하단 탭이
* 그랬다. https://github.com/react/react-native/issues/52415 · 고치는 PR https://github.com/react/react-native/pull/56588 은 아직
* 머지 전이고, 그 깃발(`enableAccumulatedUpdatesInRawPropsAndroid`)은 0.88.1 에서 꺼져 있다.
* `collapsable: false` 면 처음부터 네이티브 뷰라 모서리를 첫 값으로 받는다(`ViewShadowNode.cpp` 의 `formsStackingContext`).
*
* 그 자리를 빠뜨리면 `scripts/mobile-surfaces.test.ts` 가 붉다. 위 PR 이 들어간 판으로 올리면 이 파일과 그 시험을 함께 걷는다.
*/
export const KEEP_VIEW = { collapsable: false } as const;
48 changes: 48 additions & 0 deletions scripts/mobile-surfaces.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,51 @@ describe('앱 화면의 면', () => {
for (const fine of ['borderRadius: RADIUS.cell', 'borderRadius: RADIUS.pill']) expect(handMadeIn(fine), fine).toEqual([]);
});
});

/**
* **바탕이 나중에 서는 둥근 자리는 `KEEP_VIEW` 를 펼친다**(`mobile/src/ui/keep-view.ts`). 안드로이드는 바탕 없는 뷰를 펼쳐 없앴다가 바탕이
* 서면 새로 짓는데, 그때 `borderRadius` 를 잃어 둥근 표시가 네모로 선다(RN #52415 — 2026-11-05 운영 APK 의 하단 탭). 웹 번들 · 단위 시험은
* 이것을 못 본다 — 글자로 읽는다. 한 줄로 쓴 스타일만 읽는다: 모서리만 있고 바탕 · 테두리가 없는 스타일에 `조건 && styles.X` 로 바탕이나
* 테두리를 붙이는 자리. `ui/` 의 부품은 위 `files` 처럼 빠진다 — 거기서 같은 꼴을 쓰면 손으로 펼친다.
*/
const STYLE_LINE = /^\s+(\w+): \{(.*)\},?$/gm;
const TOGGLED = /styles\.(\w+)\b[^\]\n]*?&&[^\]\n]*?styles\.(\w+)/g;
const PAINTS = /\b(?:backgroundColor|borderWidth):/;

function roundedWithoutKeep(text: string): string[] {
const styles = new Map([...text.matchAll(STYLE_LINE)].map((match) => [match[1], match[2]]));
const bare = (key: string) => /\bborderRadius:/.test(styles.get(key) ?? '') && !PAINTS.test(styles.get(key) ?? '');
const paints = (key: string) => PAINTS.test(styles.get(key) ?? '');
return [...text.matchAll(TOGGLED)]
/* 같은 배열에 늘 서는 바탕(`{ backgroundColor: soft }`)이 끼면 처음부터 네이티브 뷰다 */
.filter((match) => bare(match[1]) && paints(match[2]) && !PAINTS.test(match[0].split('&&')[0]))
.filter((match) => {
const before = text.slice(0, match.index);
const tag = Math.max(...[...before.matchAll(/<[A-Z]/g)].map((open) => open.index ?? 0), 0);
return !before.slice(tag).includes('KEEP_VIEW');
})
.map((match) => `styles.${match[1]} + styles.${match[2]}`);
}

describe('앱의 둥근 자리', () => {
it('바탕이 나중에 서는 둥근 자리는 `KEEP_VIEW` 를 펼친다', () => {
const found = files.flatMap(({ file, text }) => roundedWithoutKeep(text).map((what) => `${file}: ${what}`));
expect(found).toEqual([]);
});

it('빠뜨린 자리를 잡는다 — 누를 때 · 고를 때 둘 다', () => {
const sheet = `
mark: { width: 56, height: 32, borderRadius: RADIUS.pill },
markOn: { backgroundColor: COLOR.accent },
row: { padding: 8, borderRadius: RADIUS.cell },
pressed: { backgroundColor: COLOR.surfaceSoft },
face: { borderRadius: RADIUS.pill, backgroundColor: COLOR.surface },
`;
expect(roundedWithoutKeep(`<View style={[styles.mark, on && styles.markOn]} />${sheet}`)).toEqual(['styles.mark + styles.markOn']);
expect(roundedWithoutKeep(`<Pressable\n onPress={go}\n style={({ pressed }) => [styles.row, pressed && styles.pressed]}\n>${sheet}`)).toEqual(['styles.row + styles.pressed']);
expect(roundedWithoutKeep(`<View {...KEEP_VIEW} />\n<View style={[styles.mark, on && styles.markOn]} />${sheet}`)).toEqual(['styles.mark + styles.markOn']);
expect(roundedWithoutKeep(`<View {...KEEP_VIEW} style={[styles.mark, on && styles.markOn]} />${sheet}`)).toEqual([]);
expect(roundedWithoutKeep(`<View style={[styles.face, on && styles.markOn]} />${sheet}`)).toEqual([]);
expect(roundedWithoutKeep(`<View style={[styles.mark, { backgroundColor: soft }, on && styles.markOn]} />${sheet}`)).toEqual([]);
});
});
Loading