Chore: Only support small / normal / large font sizes#2416
Conversation
WalkthroughRemoved two large font options from DisplaySettings, normalized legacy font cookie values in DefaultPageLayout, added an upgrade-time sed migration for font and tty values, increased manualSpacingOffset in VMMachines, and updated copyright years. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant Browser
participant DisplaySettings as DisplaySettings.page
participant Layout as DefaultPageLayout.php
participant VMPage as VMMachines.page
participant Upgrade as sbin/upgrade
participant Config as /boot/config/plugins/dynamix/dynamix.cfg
rect rgb(238,245,252)
note right of Upgrade: Upgrade-time migration (if config exists)
User->>Upgrade: run system upgrade
Upgrade->>Config: detect & open config
Upgrade->>Config: sed replace font (50→56.25, 75/80→68.75)
Upgrade->>Config: sed replace tty (11→13, 19/21→17)
end
rect rgb(245,252,238)
note right of Browser: Runtime rendering & UI
User->>DisplaySettings: open Display Settings
DisplaySettings-->>User: show trimmed font option lists
User->>Browser: sends saved font cookie
Browser->>Layout: request page render with cookie
Layout->>Layout: normalize legacy font values (50→56.25, 75/80→68.75)
Layout-->>Browser: render page with normalized font
Browser->>VMPage: layout fillAvailableHeight (manualSpacingOffset=50)
VMPage-->>Browser: adjusted spacing applied
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
Comment |
🔧 PR Test Plugin AvailableA test plugin has been generated for this PR that includes the modified files. Version: 📥 Installation Instructions:Install via Unraid Web UI:
Alternative: Direct Download
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
sbin/upgrade (1)
34-35: Configuration migration logic is correct.The sed command properly migrates legacy font and TTY size values in the config file:
- Font: (80|75) → 68.75, 50 → 56.25
- TTY: 11 → 13, (19|21) → 17
The mappings are consistent with the normalization logic in
DefaultPageLayout.php(lines 22-33) and align with the PR objectives. The file existence check and extended regex usage are appropriate.Consider using
sed -i.bakinstead ofsed -ito create a backup before modifying the config file, providing a rollback option if the upgrade encounters issues:-[ -f "/boot/config/plugins/dynamix/dynamix.cfg" ] && sed -ri -e 's/font="(80|75)"/font="68.75"/g' -e 's/font="50"/font="56.25"/g' -e 's/tty="11"/tty="13"/g' -e 's/tty="(19|21)"/tty="17"/g' "/boot/config/plugins/dynamix/dynamix.cfg" +[ -f "/boot/config/plugins/dynamix/dynamix.cfg" ] && sed -ri.bak -e 's/font="(80|75)"/font="68.75"/g' -e 's/font="50"/font="56.25"/g' -e 's/tty="11"/tty="13"/g' -e 's/tty="(19|21)"/tty="17"/g' "/boot/config/plugins/dynamix/dynamix.cfg"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
emhttp/plugins/dynamix/DisplaySettings.page(0 hunks)emhttp/plugins/dynamix/include/DefaultPageLayout.php(2 hunks)sbin/upgrade(2 hunks)
💤 Files with no reviewable changes (1)
- emhttp/plugins/dynamix/DisplaySettings.page
🔇 Additional comments (3)
emhttp/plugins/dynamix/include/DefaultPageLayout.php (2)
2-3: LGTM: Copyright year update.The copyright years have been correctly updated to 2025.
22-33: LGTM: Font size normalization logic is correct.The switch statement properly normalizes legacy font size values to the new supported sizes:
- 50 → 56.25
- 75 → 68.75
- 80 → 68.75
The mappings are consistent with the upgrade script in
sbin/upgradeand align with the PR objectives to remove extreme font sizes. PHP's loose comparison handles the string-to-number coercion correctly. Unsupported values pass through unchanged, which is the intended behavior.sbin/upgrade (1)
2-2: LGTM: Copyright year update.The copyright year has been correctly updated to 2025.
unraid#2411 accounted for Huge / Very Large. Just need to account for Large
Summary by CodeRabbit
Style
Bug Fixes
Chores
UI Layout