Match tablet camera surface to mobile

Signed-off-by: kenny lopez <klopez4212@gmail.com>
This commit is contained in:
kenny lopez
2026-08-02 09:42:21 +01:00
parent e0e4b7f75f
commit 94b052faef
2 changed files with 3 additions and 15 deletions
@@ -9,8 +9,6 @@ const _attachmentMenuItemSpacing = Grid.xxs;
const _attachmentMenuIconSize = 24.0;
const _attachmentMenuIconSlotWidth = 28.0;
const _attachmentExpandedHeight = 372.0;
const _tabletAttachmentCameraMaxHeight = 640.0;
const _tabletShortestSideBreakpoint = 600.0;
@immutable
class _AttachmentMenuLayout {
@@ -172,17 +170,7 @@ class _AttachmentSurfacePanel extends HookWidget {
return LayoutBuilder(
builder: (context, constraints) {
final expandedWidth = constraints.maxWidth;
final isTablet =
MediaQuery.sizeOf(context).shortestSide >=
_tabletShortestSideBreakpoint;
final expandedHeight =
visibleExpandedSurface == _AttachmentSurface.camera && isTablet
// Use the available chat-pane width rather than a fixed landscape
// height. On a tablet's three-pane layout this keeps the camera
// preview close to square, even though the pane itself is narrower
// than the full device width.
? math.min(expandedWidth, _tabletAttachmentCameraMaxHeight)
: _attachmentExpandedHeight;
const expandedHeight = _attachmentExpandedHeight;
final width =
_attachmentMenuWidth +
((expandedWidth - _attachmentMenuWidth) * sizeProgress);
@@ -1402,7 +1402,7 @@ void main() {
}
});
testWidgets('uses a taller camera surface on tablet-width layouts', (
testWidgets('keeps the mobile camera surface geometry on tablet widths', (
tester,
) async {
final previousPlatform = debugDefaultTargetPlatformOverride;
@@ -1429,7 +1429,7 @@ void main() {
expect(
tester.getSize(find.byKey(const ValueKey('camera-preview'))).height,
640,
372,
);
} finally {
debugDefaultTargetPlatformOverride = previousPlatform;