fix: 480px以下の狭い画面でディレクトリブラウザの右側が切れる問題を修正 - #46
Open
4ster1sk wants to merge 1 commit into
Open
Conversation
.directory-browser が margin: 0 auto + max-width のみで flex コンテナ内で fit-content 幅に縮み、#root の overflow: hidden により右側がクリップされて いた。width: 100% を追加して viewport に一致させる。 回帰テスト tests/narrow-browser.spec.js を追加 (480/375/320/280px で キー要素の右端が viewport 内に収まることを検証)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
480px 以下の狭い viewport でディレクトリブラウザの右側が切れる問題を修正します。
背景・問題
#root/bodyはoverflow: hiddenのため、viewport より横に広がった要素はスクロールもできず右側がクリップされます。.directory-browserはmargin: 0 auto+max-width: 800pxのみで、親がdisplay: flexのため横方向にストレッチされず fit-content 幅になりました。その結果、狭い viewport(例: 480px)でもツールバーなどのmax-content幅(実測 575px)で描画され、ファイルサイズ列・起動ボタンが右端で欠けていました。変更内容
client/src/styles/app.css.directory-browserにwidth: 100%を追加。max-width: 800px+margin: 0 autoはそのままなので、広い画面では従来どおり中央寄せのままtests/narrow-browser.spec.js(新規)回帰テストを追加。480 / 375 / 320 / 280px の 4 幅で、ディレクトリブラウザの主要要素(
.browser-toolbar/.open-split/.dir-item/.file-item/.file-download-btn/.file-size/.session-status等)の右端が viewport 内に収まることを検証します。長い名前のディレクトリ/ファイルをシードして最悪ケースを再現します。検証
.directory-browserが viewport をはみ出し(例: 480px viewport で right=575)→ テスト 4 件すべて失敗no element overflows viewport→ テスト 4 passed