fix(sheets): size sheets to their content instead of 75% of the window

Sheets rendered at the host's maximum height regardless of content, so a
one-item player queue or a two-track picker filled ~75% of a desktop window
with empty space.

BottomSheetPageScaffold now always lays out Column(mainAxisSize: .min) plus
Flexible(child:), and each sheet body shrink-wraps its own scrollable. The
scaffold's shrinkWrap flag is gone: its old true branch put the child on an
unbounded axis, where an over-tall list overflowed instead of clamping and
scrolling. Measured on a 1600x1000 window, the chapter sheet goes from 750px
to 118px for one chapter and the two-column track sheet from 750px to 154px
for one audio and one subtitle track, both still clamping at the cap.

Add SheetSplitColumns for the three side-by-side sheet layouts. A bare
VerticalDivider has no intrinsic height, so it inflated those rows to the cap
on its own; the rule now paints from a Positioned.fill that cannot size the
Stack. IntrinsicHeight is not an option because a Viewport has no intrinsics.

Because sheets are bottom-anchored, a content-driven height moves the sheet's
top edge and everything above the change point. Three surfaces opt out for
that reason and say so at the call site: SubtitleSearchSheet and its language
picker keep filling, since both refilter under an autofocused field;
FiltersBottomSheet holds the outgoing page's height through its loading
transient; and RatingBottomSheet no longer hides MAL/AniList rows
asynchronously, which used to slide live rating controls down two rows several
hundred ms after open. Wrap the shared StateMessageWidget at the filters sheet
boundary rather than editing a widget with 33 filling call sites.

The host gains an AnimatedSize keyed per sheet session so nested pushes ease
while a replacing show adopts its own height, a 720px absolute height ceiling
on desktop windows only, and a min(max(25%, 96px), 60%) drag-dismiss threshold
so short sheets neither close on a nudge nor become undismissable.

Add videoControls.noAudioDevicesAvailable so the audio output page shows a
placeholder instead of a bare header while devices load.
This commit is contained in:
edde746
2026-08-08 00:37:17 +02:00
parent e3703892b3
commit 24a041977b
71 changed files with 1210 additions and 207 deletions
+4 -2
View File
@@ -828,6 +828,7 @@ class Translations$videoControls$zh extends Translations$videoControls$en {
@override String get noChaptersAvailable => '没有可用的章节';
@override String get queue => '播放队列';
@override String get noQueueItems => '队列中没有项目';
@override String get noAudioDevicesAvailable => '没有可用的音频设备';
@override String get searchSubtitles => '搜索字幕';
@override String get language => '语言';
@override String get noSubtitlesFound => '未找到字幕';
@@ -3224,6 +3225,7 @@ extension on TranslationsZh {
'videoControls.noChaptersAvailable' => '没有可用的章节',
'videoControls.queue' => '播放队列',
'videoControls.noQueueItems' => '队列中没有项目',
'videoControls.noAudioDevicesAvailable' => '没有可用的音频设备',
'videoControls.searchSubtitles' => '搜索字幕',
'videoControls.language' => '语言',
'videoControls.noSubtitlesFound' => '未找到字幕',
@@ -3609,9 +3611,9 @@ extension on TranslationsZh {
'explore.badge.requested' => '已请求',
'explore.badge.pendingApproval' => '待批准',
'explore.badge.processing' => '处理中',
'explore.badge.declined' => '已拒绝',
_ => null,
} ?? switch (path) {
'explore.badge.declined' => '已拒绝',
'explore.badge.requestFailed' => '请求失败',
'explore.badge.requested4k' => '已请求 4K',
'explore.badge.seasonsAvailable' => ({required Object available, required Object total}) => '已有 ${available}/${total}',
@@ -4123,9 +4125,9 @@ extension on TranslationsZh {
'performanceOverlay.dropped' => '丢帧',
'performanceOverlay.dvRpus' => 'DV RPU',
'performanceOverlay.dvRpuAverage' => 'DV RPU 平均',
'performanceOverlay.dvSampleAverage' => 'DV 采样平均',
_ => null,
} ?? switch (path) {
'performanceOverlay.dvSampleAverage' => 'DV 采样平均',
'performanceOverlay.maxLuma' => '最大亮度',
'performanceOverlay.minLuma' => '最小亮度',
'performanceOverlay.maxCll' => 'MaxCLL',