Skip to content

Fix/mobile hide typewriter#74

Open
fallleave001 wants to merge 20 commits into
agegr:mainfrom
fallleave001:fix/mobile-hide-typewriter
Open

Fix/mobile hide typewriter#74
fallleave001 wants to merge 20 commits into
agegr:mainfrom
fallleave001:fix/mobile-hide-typewriter

Conversation

@fallleave001

Copy link
Copy Markdown

Summary

Fix mobile portrait mode flickering on iQOO 10 (and other narrow-screen devices). The page content jumped up/down every ~5 seconds when viewing the new session landing page in portrait mode.

Root Cause

The Typewriter component cycles through 18 placeholder phrases (e.g., "ready when you are.", "ask me anything.", "fix that pesky bug.") by typing and deleting characters one by one:

  • Type: 55ms per char → ~1s per phrase
  • Pause: 1.8s
  • Delete: 28ms per char → ~0.5s
  • Total cycle: ~3.5s–6s depending on phrase length

On wide screens (>640px, e.g. desktop/landscape), the varying text width is absorbed naturally. On narrow screens (≤640px, e.g. mobile portrait, ~412px wide), the expanding text overflows the flex container, causing the entire "π Pi Agent Web" title line to wrap to two lines. This pushes the chat input below it up/down by one line height, creating a visible "jump" synchronized with the typewriter animation.

Fix

Hide the typewriter component on screens ≤640px via CSS:

  • Added CSS class typewriter-hint to the typewriter's wrapper span
  • Added @media (max-width: 640px) rule to display: none it on narrow screens

The breakpoint matches pi-web's existing mobile/desktop boundary (used by the sidebar overlay, layout adjustments, etc.), so the behavior is consistent with the rest of the UI.

Design decision

Alternative approaches considered and rejected:

  •  This fix: CSS-hide on narrow screens — minimal change, preserves decoration on desktop/landscape
  • ❌ Remove typewriter entirely — loses visual appeal on desktop
  • ❌ Limit typewriter width — still risk of overflow edge cases
  • ❌ Change justify-content to padding-top — didn't work, not the root cause
  • ❌ 100svh → 100dvh flip — didn't work, not the root cause

Changes

File | Change -- | -- components/ChatWindow.tsx | Added className="typewriter-hint" to typewriter wrapper app/globals.css | Added @media (max-width: 640px) { .typewriter-hint { display: none !important } }

Testing

  • ✅ iQOO 10 portrait (412px): no flicker
  • ✅ iQOO 10 landscape (915px): typewriter visible, no flicker
  • ✅ Desktop / wide screen: typewriter visible, no change
  • ✅ Session list page: unaffected (no typewriter)
  • ✅ Active chat page: unaffected (no typewriter)

fallleave and others added 20 commits May 31, 2026 15:10
… settings.json

- New ToolsConfig component with per-tool toggle switches (built-in + extensions)
- New /api/tools endpoint for tool enumeration and config persistence
- Tools button in left sidebar replaces old wrench-icon preset dropdown
- Config stored in settings.json 'activeTools' field, shared with pi-cli
- startRpcSession reads saved config on session creation
- getPresetFromTools uses superset matching for extension compatibility
…low on long linear sessions

sm.getTree() produces a deeply nested chain for long linear sessions
(3000+ messages = 3000-level depth), causing JSON.stringify to overflow
the call stack. The tree field is unused by the UI.
NEXT_PUBLIC_* env vars are resolved at build time, so upgrading
pi-coding-agent after building won't update the displayed version.
Fix by reading versions via /api/version at runtime.
…gify stack overflow

Instead of removing the tree field (which breaks BranchNavigator), apply a
compression that collapses consecutive single-child nodes into their parent.
This reduces depth from 2000+ to the number of branching points, avoiding
the JSON.stringify call stack limit while preserving all branch navigation.
…gify stack overflow

Instead of removing the tree field (which breaks BranchNavigator), apply a
compression that collapses consecutive single-child nodes into their parent.
…gify stack overflow

Instead of removing the tree field (which breaks BranchNavigator), apply a
compression that collapses consecutive single-child nodes into their parent.
This reduces depth from 2000+ to the number of branching points, avoiding
the JSON.stringify call stack limit while preserving all branch navigation.
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.

3 participants