Double-click a tile to zoom it - #34
Merged
Merged
Conversation
The panel is sized to be glanced at. When one tile is the reason you opened the app you want it big, and the size sliders resize every card instead. The zoom is a sheet over the panel — temporary, and Escape already means dismiss. One @State value on the dashboard holds it, so opening a second tile closes the first by construction, and it stays out of PanelArrangement: a zoom must not survive a relaunch or resize anything stored. Sampling keeps running underneath, so the panel comes back without a gap. ZoomLayout turns the measured panel size into the sheet's, bounded at both ends, and is tested on its own. Closes #29
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
@Statevalue onDashboardViewholds it, so opening a second tile closes the first by construction. It stays out ofPanelArrangement— a zoom must not survive a relaunch or resize anything stored, and the tile comes back the size it was.ZoomLayout(Sources/MonitorUI/ZoomedCard.swift) turns the measured panel size into the sheet's: 86% × 82%, bounded to 520×360 and 1400×900. The margin of panel left showing is what says "temporary"; the ceiling is where a zoom stops being reading a chart and starts being stretching one.DashboardView.chartCardextracted so the grid and the zoom build the same card at different plot heights, andgaugeTilenow takes its size so the caption scales with the dial.Closes #29
Test plan
swift test— 185 tests in 21 suites pass, 10 of them new inTests/MonitorUITests/ZoomLayoutTests.swiftswiftformat Sources Tests --lint --cache ignorecleanswift run monitor: double-click a chart, then a gauge — the second closes the firstOut of scope
A zoomed chart has room for more than a bigger version of the same picture — more x-axis labels, and a longer history window than the panel's. Worth a follow-up; this PR draws the same card at a larger size.