Fix camera polaroid overflow and chrome WB chips; move GPS watermark to top

This commit is contained in:
2026-09-08 17:06:22 +07:00
parent bfdc964f65
commit b5a257e033
2 changed files with 125 additions and 107 deletions
+55 -28
View File
@@ -72,8 +72,12 @@ export default function AdjustmentPanel({
// The single parameter whose slider row is open — a new selection replaces
// the previous row (one row at a time, above the chips).
const [openParam, setOpenParam] = useState<string | null>(null);
// The single color-chrome group whose OFF/WEAK/STRONG strip is open above the
// chips (same one-row-at-a-time pattern as openParam, but for choice chips).
const [openGroup, setOpenGroup] = useState<'cx' | 'cxb' | null>(null);
useEffect(() => {
setOpenParam(null);
setOpenGroup(null);
}, [activeTab]);
const toggleParam = (key: string) => {
@@ -81,6 +85,11 @@ export default function AdjustmentPanel({
setOpenParam((prev) => (prev === key ? null : key));
};
const toggleGroup = (g: 'cx' | 'cxb') => {
haptic();
setOpenGroup((prev) => (prev === g ? null : g));
};
const a = adjustments;
const renderChip = (c: ChipDef) => {
@@ -201,6 +210,23 @@ export default function AdjustmentPanel({
}
};
// Color-chrome groups: one toggle chip among the WB chips (COLOR CHROME /
// CHROME BLUE); tapping it reveals the OFF/WEAK/STRONG strip above the chip
// row. Amber text while an effect is active, amber border while its strip is
// open — same affordances as the parameter chips.
const chromeGroup: Record<
'cx' | 'cxb',
{ label: string; value: ColorAdjustments['colorChrome']; onChange: (v: ColorAdjustments['colorChrome']) => void }
> = {
cx: { label: 'COLOR CHROME', value: a.colorChrome || 'none', onChange: (v) => onUpdateAdjustments({ colorChrome: v }) },
cxb: { label: 'CHROME BLUE', value: a.colorChromeBlue || 'none', onChange: (v) => onUpdateAdjustments({ colorChromeBlue: v }) },
};
const chromeOptions = [
{ v: 'none', d: 'OFF' },
{ v: 'weak', d: 'WEAK' },
{ v: 'strong', d: 'STRONG' },
];
// ---- per-tab chip rows (bottom, above the tool rail) -----------------------
const chipsRow = (() => {
switch (activeTab) {
@@ -267,34 +293,6 @@ export default function AdjustmentPanel({
case 'wb':
return (
<View>
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
contentContainerStyle={{ alignItems: 'center', paddingHorizontal: 8, paddingVertical: 6 }}
>
{renderChip({ key: 'sep-cx', label: 'COLOR CHROME', disabled: true, active: false, onPress: () => {} })}
{choiceChips(
'cx',
[
{ v: 'none', d: 'OFF' },
{ v: 'weak', d: 'WEAK' },
{ v: 'strong', d: 'STRONG' },
],
a.colorChrome || 'none',
(val) => onUpdateAdjustments({ colorChrome: val as ColorAdjustments['colorChrome'] })
)}
{renderChip({ key: 'sep-cxb', label: 'CHROME BLUE', disabled: true, active: false, onPress: () => {} })}
{choiceChips(
'cxb',
[
{ v: 'none', d: 'OFF' },
{ v: 'weak', d: 'WEAK' },
{ v: 'strong', d: 'STRONG' },
],
a.colorChromeBlue || 'none',
(val) => onUpdateAdjustments({ colorChromeBlue: val as ColorAdjustments['colorChromeBlue'] })
)}
</ScrollView>
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
@@ -315,6 +313,15 @@ export default function AdjustmentPanel({
wbApply
)}
{paramChips(paramDefs.wb)}
{(['cx', 'cxb'] as const).map((g) =>
renderChip({
key: `grp-${g}`,
label: chromeGroup[g].label,
active: openGroup === g,
amberValue: openGroup !== g && chromeGroup[g].value !== 'none',
onPress: () => toggleGroup(g),
})
)}
</ScrollView>
</View>
);
@@ -401,6 +408,26 @@ export default function AdjustmentPanel({
</View>
</View>
)}
{openGroup && (
<View className="border-b border-zinc-800/60">
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
contentContainerStyle={{ alignItems: 'center', paddingHorizontal: 8, paddingVertical: 6 }}
>
{renderChip({
key: `grp-hint-${openGroup}`,
label: chromeGroup[openGroup].label,
disabled: true,
active: false,
onPress: () => {},
})}
{choiceChips(openGroup, chromeOptions, chromeGroup[openGroup].value, (v) =>
chromeGroup[openGroup].onChange(v as ColorAdjustments['colorChrome'])
)}
</ScrollView>
</View>
)}
{chipsRow}
</View>
);