Skip to content

Commit 954a2ef

Browse files
committed
fix(mobile): composer chips use the light-surface accents too
1 parent c827469 commit 954a2ef

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎apps/mobile/src/native/T3ComposerEditor.ios.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { StyleSheet } from "react-native";
1818
import {
1919
composerChipSizeSuffix,
2020
contextChipIcon,
21+
contextChipAccent,
2122
contextChipPresentation,
2223
contextRecordFileName,
2324
} from "../lib/composerChipPresentation";
@@ -157,6 +158,7 @@ export function ComposerEditor({
157158
);
158159

159160
const skillLabels = useMemo(() => composerSkillLabels(skills), [skills]);
161+
const chipTextColor = createNativeComposerTheme(theme).text;
160162
const tokensJson = useMemo(() => {
161163
const tokens = collectComposerInlineTokens(props.value, {
162164
preserveTrailingFrom: confirmedTokensRef.current,
@@ -181,7 +183,7 @@ export function ComposerEditor({
181183
source: token.source,
182184
start: token.start,
183185
end: token.end,
184-
accent: presentation.accent,
186+
accent: contextChipAccent(presentation.accent, chipTextColor),
185187
label:
186188
token.type === "skill"
187189
? (skillLabels.get(token.value) ?? token.value)
@@ -194,7 +196,7 @@ export function ComposerEditor({
194196
};
195197
}),
196198
);
197-
}, [props.value, props.context, skillLabels]);
199+
}, [props.value, props.context, skillLabels, chipTextColor]);
198200
// Every render resolves against the snapshot history, so a render whose
199201
// (value, selection) lags the acknowledged native state is stamped behind
200202
// the native revision and rejected by the editor instead of re-applying a

‎apps/mobile/src/native/T3ComposerEditor.native.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { Image, Platform, StyleSheet } from "react-native";
1919
import {
2020
composerChipSizeSuffix,
2121
contextChipIcon,
22+
contextChipAccent,
2223
contextChipPresentation,
2324
contextRecordFileName,
2425
} from "../lib/composerChipPresentation";
@@ -155,6 +156,7 @@ export function ComposerEditor({
155156
);
156157

157158
const skillLabels = useMemo(() => composerSkillLabels(skills), [skills]);
159+
const chipTextColor = createNativeComposerTheme(theme).text;
158160
const tokensJson = useMemo(() => {
159161
const tokens = collectComposerInlineTokens(props.value, {
160162
preserveTrailingFrom: confirmedTokensRef.current,
@@ -179,7 +181,7 @@ export function ComposerEditor({
179181
source: token.source,
180182
start: token.start,
181183
end: token.end,
182-
accent: presentation.accent,
184+
accent: contextChipAccent(presentation.accent, chipTextColor),
183185
label:
184186
token.type === "skill"
185187
? (skillLabels.get(token.value) ?? token.value)
@@ -192,7 +194,7 @@ export function ComposerEditor({
192194
};
193195
}),
194196
);
195-
}, [props.value, props.context, skillLabels]);
197+
}, [props.value, props.context, skillLabels, chipTextColor]);
196198
// Every render resolves against the snapshot history, so a render whose
197199
// (value, selection) lags the acknowledged native state is stamped behind
198200
// the native revision and rejected by the editor instead of re-applying a

0 commit comments

Comments
 (0)