Skip to content

fix: keep page height fixed and scroll editor/preview panes internally#151

Merged
wendyyuchensun merged 2 commits into
mainfrom
bugbash/layout
Jun 29, 2026
Merged

fix: keep page height fixed and scroll editor/preview panes internally#151
wendyyuchensun merged 2 commits into
mainfrom
bugbash/layout

Conversation

@wendyyuchensun

@wendyyuchensun wendyyuchensun commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

問題

設計師希望「空狀態的轉換結果高度,應該要跟編輯題目區域同高 ; 若內容超過高度,應該要有 scroll bar 可以滾動」。
https://docs.google.com/document/d/1o80SD1jfOYbKEKcX0WodZ-PL8xgvA8Xii2GAVOXJzYc/edit?tab=t.0

變更

  • 版面更改為填滿「視窗高度減去 header」的空間,不需寫死高度。
  • 預覽區高度改為與編輯區一致,內容過長時在區塊內部捲動。
  • 預覽區加上 relative,讓 see-mark 產生的 .sr-only MathML span 實際位置不會超出預覽區。

Demo

Before

Screenshot 2026-06-22 at 13 54 21

After

Screen.Recording.2026-06-22.at.13.55.09.mov

Pin the editor/preview area to viewport height and let each pane
scroll internally instead of growing the document:

- Wrap Home in a flex-column app shell (lg:h-screen lg:overflow-hidden)
  with main as flex-1, so panes fill viewport-minus-header without a
  hard-coded height.
- Make editor box and preview box flex-1 + min-h-0 so they scroll
  internally; preview box matches editor box height.
- Give preview box `relative` so see-mark's absolutely-positioned
  .sr-only MathML spans clip here instead of resolving against the
  viewport and adding phantom page scroll.
- EditIconsTab fills its container (h-full) and adds min-h-0 on flex
  ancestors so the category/template lists scroll to the last item
  instead of overflowing.
@wendyyuchensun wendyyuchensun changed the title fix: keep page fixed and scroll editor/preview panes internally fix: keep page height fixed and scroll editor/preview panes internally Jun 22, 2026
@wendyyuchensun wendyyuchensun merged commit 722dfcc into main Jun 29, 2026
1 check passed
@wendyyuchensun wendyyuchensun deleted the bugbash/layout branch June 29, 2026 14:01
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.

2 participants