Skip to content

fix(toast): top-anchor toast family on mobile to clear bottom-nav (lr-2fdd)#297

Merged
clagentic-merger[bot] merged 1 commit into
mainfrom
fix/lr-2fdd-toast-mobile-anchoring
Jul 1, 2026
Merged

fix(toast): top-anchor toast family on mobile to clear bottom-nav (lr-2fdd)#297
clagentic-merger[bot] merged 1 commit into
mainfrom
fix/lr-2fdd-toast-mobile-anchoring

Conversation

@clagentic-builder

Copy link
Copy Markdown
Contributor

What changed

Top-anchors the entire toast family on mobile (<=768px) instead of bottom-anchoring at bottom: 80px:

  • .toast (base.css:207) + .toast.visible
  • .sw-update-banner (base.css:236) + .sw-update-banner.visible
  • .toast-diagnostic (diagnostics.css:161) + .toast-diagnostic.visible (mobile override block, diagnostics.css:261)

All three now use top: calc(var(--safe-top) + 12px); bottom: auto; inside a @media (max-width: 768px) block, with the slide-in transform flipped from translateY(8px)->0 to translateY(-8px)->0 so the entrance animation still reads correctly from the new anchor side. Desktop (position: fixed; bottom: 80px) is unchanged.

Approach justification

Andy's steer was explicit: "should top align more than bottom align." Of the three options in the task brief:

  • (a) top-anchor on mobile -- chosen
  • (b) raise the bottom offset above bottom-nav height + safe-area-inset-bottom -- rejected: still risks colliding with the input box, which sits above the bottom-nav and is not a fixed height (grows with multi-line input), so a static offset cannot reliably clear it
  • (c) mobile-aware placement in the shared positioning util (lib/public/modules/popover-position.js) -- rejected: that util is anchor-relative (getBoundingClientRect + measured popover size) for popovers/menus/dropdowns. These toasts are unanchored, statically-positioned fixed elements created purely via CSS class toggles -- no JS in notifications.js, diagnostics.js, or utils.js sets any inline style.top/bottom/left/right/position. Routing a static offset through an anchor-relative measurement util would be a mismatch of concerns and risked reinventing a parallel helper for a problem CSS already solves cleanly. Confirmed via full read of notifications.js, diagnostics.js, and utils.js (showToast) -- positioning is 100% CSS-driven.

Result: this is a CSS-only change. No JS files were touched, so BOBBIE is skippable per the task brief (JS code paths untouched).

--safe-top (env(safe-area-inset-top, 0px)) already existed as a root custom property (base.css:105) and is used elsewhere, so this reuses the existing safe-area convention rather than introducing a new one.

Verify

  • Mobile (<=768px): .toast (e.g. the lr-0847 custom-icon upload-error toast, which uses showToast), .toast-diagnostic (PREFLIGHT/diagnostic warning), and .sw-update-banner (SW update/reload banner) now all land at top: safe-area-inset-top + 12px, clearing the bottom-nav (#mobile-tab-bar, height 56px + safe-bottom) and any active input box entirely -- they no longer share the bottom region at all.
  • Desktop (>768px): untouched -- still position: fixed; bottom: 80px.
  • No other CSS file in lib/public/css/ defines conflicting .toast/.sw-update-banner/.toast-diagnostic selectors (verified via full-repo search).

Tests

npm test: 588 tests, 587 pass, 1 pre-existing failure (test/settings-preflight-lr-1a26.test.js:100, "validateSettingsObject: multiple unknown hook keys produce one warning each") -- matches the known pre-existing failure named in the task brief. No new failures introduced by this change (CSS-only diff, no code paths touched by that test).

Task

lr-2fdd

Land via AMoS -> PEACHES -> NAOMI. CSS/positioning-only; BOBBIE skippable (no JS touched).

…-2fdd)

base .toast, .sw-update-banner, and .toast-diagnostic all hard-anchored
bottom:80px, occluding the mobile bottom-nav / input box / content
(iOS screenshot: PREFLIGHT WARNING toast covering the UPCOMING card
above the Projects/Chat/Team/More nav). Andy confirmed the SW
update/reload banner has the same issue.

Top-anchor the whole toast family at <=768px, using --safe-top so it
clears the notch/status bar, per Andy's steer ('should top align more
than bottom align'). Desktop placement unchanged.

@clagentic-reviewer clagentic-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEACHES — clean

Reviewed PR #297 (fix/lr-2fdd-toast-mobile-anchoring) against the rulebook. No blocking findings.

Coverage

  1. Toast family consistency (all three mobile-anchored):

    • .toast (base.css ~207–229): base state bottom:80px; mobile override (lines 294–298) top-anchors to calc(var(--safe-top) + 12px) with bottom:auto
    • .sw-update-banner (base.css ~237–261): base state bottom:80px; mobile override (lines 294–298) top-anchors consistently
    • .toast-diagnostic (diagnostics.css ~161–185): base state bottom:80px (inherited); mobile override (lines 273–274) top-anchors consistently with matching calc expression
    • Verdict: All three use identical mobile formula. No drift or partial fix.
  2. Safe-area inset properly defined:

    • --safe-top declared at :root (base.css line 105): env(safe-area-inset-top, 0px) — iOS notch and status bar safe zone is respected; fallback to 0 for non-notched devices
    • Formula calc(var(--safe-top) + 12px) adds breathing room below the safe area
  3. Media query scope (mobile-only, desktop unchanged):

    • @media (max-width: 768px) in base.css (lines 293–304) and diagnostics.css (lines 261–279) — strict viewport guard
    • Base styles (bottom:80px) remain active for ≥769px
    • Desktop layout preserved
  4. Transform animations preserved:

    • Visible state (.toast.visible, .sw-update-banner.visible): transform: translateX(-50%) translateY(0) (lines 300–303)
    • Hidden state: transform: translateX(-50%) translateY(-8px) (line 298) — off-screen translation works with top-anchoring
    • .toast-diagnostic.visible (lines 276–278): transform: translateY(0) (margin-left:auto removed, left:16px/right:16px layout on mobile only, correct)
  5. z-index / stacking context:

    • .toast and .sw-update-banner remain z-index 400 (no change)
    • .toast-diagnostic remains z-index 450 (no change)
    • No regress: toasts will sit above the notch
  6. Brand rules (clagentic-console.*):

    • CSS-only fix; no user-facing strings touched
    • Comments correctly reference lr-2fdd and quote Andy's steer ("should top align more than bottom align")
  7. No JS inline styles (AMoS code-craft — assertion verified):

    • lib/public/modules/notifications.js: Applies only .visible class; no style.top/style.bottom manipulation
    • lib/public/modules/utils.js: showToast() applies classes only; detail cssText is layout-independent
    • lib/public/modules/diagnostics.js: Toast creation uses class-based styling only; no inline positioning
    • Verdict: CSS fix is pure; no JS touch. BOBBIE skip is sound.

Conclusion

The fix is narrow, consistent, and addresses the reported iOS occlusion issue. All three toast families (.toast, .sw-update-banner, .toast-diagnostic) are mobile-anchored to a common formula respecting the safe-area inset. Desktop placement is unchanged. No blocking issues found.

@clagentic-merger clagentic-merger Bot merged commit 4a5100e into main Jul 1, 2026
1 check passed
@clagentic-merger

Copy link
Copy Markdown
Contributor

clagentic gate-note — authorized

field value
Task (not recorded)
PR #297 (github)
Gated HEAD SHA 76c0e258d9e2667fed13ab75e2a4858bbfb39e3a
Merged SHA 76c0e258d9e2667fed13ab75e2a4858bbfb39e3a
CI at HEAD (not recorded)
PEACHES reviewed
Pre-checks secret-scan · SAST · dep/vuln
Merged-by naomi

Authorize rationale: PEACHES clean at 76c0e25 (pullrequestreview-4612275948); BOBBIE skipped per task lr-2fdd (CSS-only diff, no code-exposure surface, reviewer_required:false); tests 587/588 (1 known pre-existing unrelated failure settings-preflight-lr-1a26). Authorized by holden on behalf of andy.

@clagentic-merger clagentic-merger Bot deleted the fix/lr-2fdd-toast-mobile-anchoring branch July 1, 2026 19:24
@clagentic-release-bot

Copy link
Copy Markdown

This issue has been resolved in version 1.6.0-beta.2 (beta).

To update, run:

npx @clagentic/console@1.6.0-beta.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants