Repository navigation
Fix ruby text wrapping in variant vocabulary entries - #255
Merged
Merged
Conversation
Chrome 系 ruby 本來就毋會換行,變體行又多一个 badge 標籤摎 gap, 長个標音(例:發燒(作燒))就會爆出 td 右爿。原來 adjustRubyFontSize 淨有 Firefox 正會縮,現在變體行(.variant)个 ruby 無論麼个瀏覽器都縮, Firefox 照舊全部縮。順手 bump main.js 版本號到 4.5.47。 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JtgyEf1Y5Jswgrr7EgMCXz
This reverts commit 4eec581.
前一擺 JS 縮字級个做法毋著:Chrome 本來就會幫 ruby 換行,變體行毋換 係因為 .vocab-variants(inline-flex)摎 .variant 無限寬,flex item 个 min-width:auto 又讓 ruby 最小寬度變成全寬。現在容器限寬 100%、 .variant ruby 加 min-width:0,變體行就摎無變體个詞共樣會自動換行。 style.css 版本號 bump 到 4.7.33。 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JtgyEf1Y5Jswgrr7EgMCXz
Review改動小、方向合理(flex item 的 `min-width:auto` 導致不換行是常見成因),註解也有說明原因,`index.html` 的 `?v=` 也有 bump,符合快取慣例。 建議/疑慮
整體:沒有安全或效能疑慮;請確認 1、2 的實測後即可合併。 🤖 Generated with Claude Code |
Chrome ruby 个換行點係 base 提供个,隱藏 base 做 font-size:0 就寬度 0、 無任何斷點,長个 rt 會一行到底爆出 td。改做 1px(猶原 visibility:hidden、 line-height:0),實測 rt 就會摎 base 共樣換行。style.css 版本號 bump 到 4.7.34。 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JtgyEf1Y5Jswgrr7EgMCXz
Deploying hakspring with
|
| Latest commit: |
e0d4de6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://98110e54.hakspring.pages.dev |
| Branch Preview URL: | https://ccr-fa70a124-2hojxs.hakspring.pages.dev |
Review整體改動細(CSS 兩檔),意圖清楚,註解也有保留風格。幾點提醒: 1. PR 描述摎實際 diff 無對著
2.
3.
4. 暗色主題/其他
無安全或效能問題。處理完第 1 點即可 merge。 |
Chrome 算 ruby(被 blockify 成 flex item)个 min-content 係全寬, 表格 auto layout 就照最長个變體標音(加 badge 摎 gap)撐闊歸隻表格, 超出螢幕。卡片模式 tr 已經係 block,加 table-layout: fixed 就毋會。 實測 320/360/390px 頁寬都摎 viewport 共樣。style.css 版本號 bump 到 4.7.35。 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JtgyEf1Y5Jswgrr7EgMCXz
ReviewCSS 修改範圍小,註解也有說明原因,並維持既有註解。我看不出明顯 bug,另有三點建議:
其他:
整體來說可以合併,只要補上 Firefox/Safari 的驗證。 🤖 Generated with Claude Code |
Collaborator
Author
|
Firefox 𠊎自家驗核。👌 |
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.
Summary
修正主表四縣/饒平地區變體行在 Chrome 系 ruby 毋會換行、長標音爆出 td、摎撐闊頁面个問題。
Key Changes
.vocab-variants、.variant加max-width: 100%,限制 flex 容器寬度.variant ruby加min-width: 0(ruby 係.variant(flex)个直接子元素,會被 blockify,min-width有效),讓 ruby 做得縮細摎換行.variant-hidden-base(phonetic-only 變體个隱藏 base)个font-size從0改1px:Chrome ruby 个換行點係 base 提供个,base 寬度 0 就無斷點,長 rt 會一行到底;仍維持visibility: hidden、line-height: 0#generated table, #sandhi-showcase table, #comparison-table加table-layout: fixed:Chrome 算 blockify 後 ruby 个 min-content 係全寬,auto layout 會照最長个變體標音撐闊歸隻表格(360px 下頁寬 370、320px 下 362);tr 已經係 block,固定佈局無副作用style.css版本號 4.7.32 → 4.7.35驗證
Chromium 實測:320/360/390px 頁寬都摎 viewport 共樣(修前 360px 為 370~375);竹行長標音會換行;phonetic-only 長 rt 從單行 358px 變多行 244px。768px 以上版面無變化。Firefox/Safari 尚未實測(Firefox 愛看 phonetic-only 个 label 對齊)。
https://claude.ai/code/session_01JtgyEf1Y5Jswgrr7EgMCXz