Skip to content

Commit 8084339

Browse files
committed
Restore real mobile safe-area padding
ChoicePanel relied on an undefined pb-safe utility, so the shipped CSS gave the mobile choices no actual home-indicator inset. Use the native CSS safe-area env() value directly and add a repository guard so the no-op class does not return. Constraint: The project ships static CSS bundles without a pb-safe utility. Rejected: Add Tailwind configuration or a new stylesheet utility | broader than needed for a one-off inset fix. Confidence: high Scope-risk: narrow Directive: Do not reintroduce pb-safe unless the shipped CSS generator is restored and verified. Tested: python3 -m py_compile scripts/check_repository.py; python3 scripts/check_repository.py; npm run verify; npm audit --omit=dev; git diff --check Not-tested: Physical iOS home-indicator device rendering.
1 parent 56b0412 commit 8084339

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

components/chat/ui/ChoicePanel.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ export default function ChoicePanel({ choices, onSelect, disabled = false }) {
1212
const [revealedChoiceId, setRevealedChoiceId] = useState(null);
1313

1414
return (
15-
<div className="shrink-0 bg-[#f0f0f0] border-t border-[#d9d9d9] pb-safe shadow-[0_-4px_20px_rgba(0,0,0,0.03)]">
15+
<div
16+
className="shrink-0 bg-[#f0f0f0] border-t border-[#d9d9d9] shadow-[0_-4px_20px_rgba(0,0,0,0.03)]"
17+
style={{ paddingBottom: 'env(safe-area-inset-bottom, 0px)' }}
18+
>
1619
<div className="flex items-center justify-center py-[7px] border-b border-[#e5e5e5]">
1720
<span className="text-[11px] text-[#aaa]">{revealedChoiceId ? '判定结果揭晓...' : '选择你的回复方式'}</span>
1821
</div>

scripts/check_repository.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
intro_source = (ROOT / 'components' / 'chat' / 'screens' / 'IntroView.jsx').read_text()
6666
playing_source = (ROOT / 'components' / 'chat' / 'screens' / 'PlayingView.jsx').read_text()
6767
phone_shell_source = (ROOT / 'components' / 'chat' / 'PhoneShell.jsx').read_text()
68+
choice_panel_source = (ROOT / 'components' / 'chat' / 'ui' / 'ChoicePanel.jsx').read_text()
6869
image_shim_source = (ROOT / 'components' / 'chat' / 'ui' / 'ImageShim.jsx').read_text()
6970
ai_verify_source = (ROOT / 'scripts' / 'verify_ai_integration.mjs').read_text()
7071
package_data = json.loads((ROOT / 'package.json').read_text())
@@ -156,6 +157,8 @@
156157
raise SystemExit('Playing view must pass scene timeLabel into StatusBar instead of showing only real clock time')
157158
if 'maxWidth: "calc(100vw - 64px)"' not in phone_shell_source or 'maxHeight: "calc(100svh - 64px)"' not in phone_shell_source:
158159
raise SystemExit('Phone shell must cap the fixed device frame to avoid overflowing small mobile viewports')
160+
if 'pb-safe' in choice_panel_source or 'safe-area-inset-bottom' not in choice_panel_source:
161+
raise SystemExit('Choice panel must use real safe-area bottom padding instead of an undefined pb-safe class')
159162
if 'unoptimized,' not in image_shim_source or 'placeholder,' not in image_shim_source or 'blurDataURL,' not in image_shim_source or '{...imgProps}' not in image_shim_source or '{...rest}' in image_shim_source:
160163
raise SystemExit('ImageShim must consume Next/Image-only props before spreading native img props')
161164
if 'deepseek-v4-flash' not in ai_verify_source or 'https://api.deepseek.com/chat/completions' not in ai_verify_source:

0 commit comments

Comments
 (0)