Skip to content

fix(push-notice): keep Dismiss on the screen at 320 px with large Japanese text - #3531

Merged
devswha merged 1 commit into
mainfrom
fix/phone-push-notice-narrow
Nov 10, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/phone-push-notice-narrow

Conversation

@devswha

@devswha devswha commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

What was wrong

On a 320 px phone in Japanese at the 20 px interface text size, the alerts health notice (the one-line
banner from #3485) pushed its Dismiss button past the right edge of the screen. The repair button's
label (通知をもう一度オンにする, 239 px wide at that size) never shrinks, so even with the sentence
cut to nothing the row needed 341 px of a 320 px screen. Dismiss (44 px wide) sat at x 297 to 341:
its right 21 px, including most of the X glyph, was off-screen.

Reproduced on origin/main (6fa11f4) in headless Chromium against the demo build, phone emulation
at 320x568, language: "ja", uiFontSize: 20, a retired push subscription.

The fix

CSS only, in src/components/PushHealthNotice.css, for the notice's fault line (the failed-repair
layout is untouched):

  • the sentence's flex basis is 0, so it gives up its width before anything else does (it already
    ended at 0 px in this case);
  • the action button may then shrink, and its label wraps inside it (white-space: normal,
    text-wrap: balance, word-break: auto-phrase as AddPcSheet.css already does for Japanese),
    the button growing in height (height: auto, with the same minimum height as before).

Dismiss keeps its 44 px size and its place at the line's right end. Wherever the label fits, nothing
shrinks: the line stays the one-line banner of #3485.

Design reference (src/AGENTS.md): this follows the notice's own failed-repair state on a phone, where
the button's label already wraps (.is-failure > .btn), rather than another app; no layout was
copied.

Measurements (headless Chromium, phone emulation, x positions in CSS px)

320 px, Japanese, 20 px interface text:

action button Dismiss notice height
before 50 to 289 297 to 341 (viewport 320) 53
after 50 to 260, label on two lines, 58 px tall 268 to 312 taller by the label's second line (read off the screenshot, not measured)

Same result while the repair runs (通知をオンにしています…: Dismiss 292 to 336 before, 268 to 312
after).

Unchanged, identical before and after (action button and Dismiss boxes, sentence width, notice
height), at rest and while repairing: en, ko, zh and ja at the default size at 320 and 390; en, ko
and zh at 20 px at 320 and 390; ja at 20 px at 390. That is 30 of the 32 measured states; the two
that changed are the ones above.

Regression

scripts/push-health-demo-regression.ts gains checkLineAtLargeText (Japanese, 20 px): at 320 px
Dismiss is whole on the screen after the button, at the line's right end, both controls are
finger-sized, the label stays inside its button, nothing scrolls sideways, at rest and while
repairing, and a tap on Dismiss closes the line; at 390 px the button keeps its one line.

Fixes #3498

Validation

  • bun run check fast (through the heavy queue, on the pushed commit): pass. Workflow syntax,
    generated types and themes, typecheck, build, unit tests 14386 pass / 0 fail / 50 skip.
  • bun scripts/push-health-demo-regression.ts in the CI runner image (herdr-ci-runner:local, a
    throwaway container as the host user, Bun 1.4.2, the image's Chromium): pass, all ten lines,
    including the two new ones. It ran on the same file contents as the pushed commit, before the
    commit was made.
  • Before/after measurements above: a one-off headless script on this PC (not in the tree), on
    origin/main and on the fix. The final CSS differs from the measured "after" run only by a
    dropped padding-block on the button; the 320 px Japanese numbers above are from the final CSS
    (the regression run's screenshot).
  • Skipped: bun run check integration browser / full, every other browser script, any desktop
    (fine pointer) before/after measurement (the existing regression's 1440 cases pass), real
    devices, Safari and Firefox. text-wrap: balance and word-break: auto-phrase are refinements a
    browser without them ignores; the label still wraps.

🤖 Generated with Claude Code

…anese text

On a 320 px phone in Japanese at the 20 px interface text size, the alerts
notice's repair label was wider than the room beside the dismiss button even
with the sentence cut to nothing, so the dismiss button ended 21 px past the
right edge. The sentence now gives up its width first and the label then wraps
inside its button, which grows in height; the dismiss button keeps its size
and place. Where the label fits, the line is unchanged.

Fixes #3498

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Fixed alerts notices on narrow screens where the Dismiss button label could extend beyond the screen edge. The label now wraps within the button when space is limited, while the button remains visible and retains an appropriate touch target.
    • When the label fits, it stays on one line. The notice’s message can yield space to the button to help keep both controls usable.

The push notice now allows its alert button label to wrap in narrow layouts. A regression checks Japanese phone layouts at 320px and 390px with 20px interface text. The design documentation, development instructions, and changelog describe the behavior and test case.

Changes: Push notice layout

Layer / File(s) Summary
Alert button wrapping
src/components/PushHealthNotice.css, DESIGN.md
Non-failure alerts allow the sentence to shrink and the button label to wrap. Coarse-pointer devices use a touch-target minimum height. The design documentation describes the narrow-layout behavior.
Japanese layout regression
scripts/push-health-demo-regression.ts, docs/development.md, changelog.d/push-notice-narrow-dismiss.md
The regression checks button visibility, placement, touch sizing, label containment, and horizontal overflow at 320px and 390px. It also checks the in-progress label and notice dismissal. The development instructions and changelog document the test case and wrapping behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: haeminway1

Merge Risk: Minimal · up to 6abb8

The narrow-phone notice change has no identified issue requiring resolution before merge; normal checks remain appropriate.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly summarizes the main change: keeping Dismiss on-screen for narrow Japanese layouts with large text.
Linked Issues check Passed Issue #3498 requires the push-notice Dismiss control to stay onscreen at 320 px with Japanese text at 20 px. PushHealthNotice.css lets the sentence yield space and lets the repair button label wrap,…
Out of Scope Changes check Passed The CSS change and browser regression test implement issue #3498. The design note, changelog, and development command description document the fix and its regression coverage. No unrelated changes app…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Description check Passed The description explains the problem, the resulting behavior, and the fix. It links issue #3498 and lists validation results and skipped checks.
Full details: Linked Issues check

Explanation

Issue #3498 requires the push-notice Dismiss control to stay onscreen at 320 px with Japanese text at 20 px. PushHealthNotice.css lets the sentence yield space and lets the repair button label wrap, while preserving the button minimum height. The regression test checks Dismiss position, touch size, label containment, horizontal overflow, repair-in-progress state, and dismissal at 320 px; it also checks that the label stays on one line at 390 px.

Full details: Out of Scope Changes check

Explanation

The CSS change and browser regression test implement issue #3498. The design note, changelog, and development command description document the fix and its regression coverage. No unrelated changes appear in the reviewed diff.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (4 skipped: 4 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e94ef44 and 6abb85e.

Files selected for processing: 5

  • DESIGN.md
  • changelog.d/push-notice-narrow-dismiss.md
  • docs/development.md
  • scripts/push-health-demo-regression.ts
  • src/components/PushHealthNotice.css

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@devswha
devswha merged commit 3f5e178 into main Nov 10, 2026
14 checks passed
@devswha

devswha commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 6abb85e4c731 as 3f5e1788bc1f on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
claude CLEAR
codex CLEAR

Merged with these checks red, none of them required: ssh;

  • Reviewers: a Claude agent (Opus 5.5) and Codex Terra 6.1 (team proxy), both CLEAR at 6abb85e, no findings. By reading the CSS: only a line that already overflowed changes (the action wraps), every wider layout is as on main. Neither reviewer opened a browser; the PR's regression ran in CI.

@devswha
devswha deleted the fix/phone-push-notice-narrow branch November 10, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phone: push notice Dismiss off-screen at 320 px with large Japanese text

1 participant