Skip to content

feat: Add rail navigation for fold and small tablet#633

Open
aymericmariaux wants to merge 4 commits intomainfrom
tablet-fold-ui
Open

feat: Add rail navigation for fold and small tablet#633
aymericmariaux wants to merge 4 commits intomainfrom
tablet-fold-ui

Conversation

@aymericmariaux
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings April 30, 2026 12:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a “medium” window classification and uses it to switch navigation UI to a rail on foldables/small tablets while keeping a drawer for large screens, plus related adaptive-layout tweaks across scaffolds and top app bar usage.

Changes:

  • Introduce isWindowMedium() and adjust small/medium/large window classification thresholds and helpers.
  • Update main navigation selection to use Drawer (large) / Rail (medium) / Bottom bar (small) and add a custom AppNavigationRail.
  • Expand two-pane behavior to medium windows and update SwissTransferTopAppBar to accept a modifier (updating call sites accordingly).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
app/src/main/java/com/infomaniak/swisstransfer/ui/utils/WindowAdaptativeInfoExt.kt Adds “medium” window detection and adjusts size breakpoints / small-window logic.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreen.kt Updates SwissTransferTopAppBar call to use named title arg.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/MyAccountScreen.kt Updates SwissTransferTopAppBar call to use named title arg.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentScreen.kt Updates SwissTransferTopAppBar call to use named title arg.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt Updates SwissTransferTopAppBar call to use named title arg.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/MainScaffold.kt Switches adaptive nav type mapping to Drawer (large) / Rail (medium) / Bar (small).
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/AppNavigationSuiteScaffold.kt Adds a custom rail implementation (with FAB + divider) and wires it into the scaffold.
app/src/main/java/com/infomaniak/swisstransfer/ui/components/TwoPaneScaffold.kt Enables 2 horizontal partitions and updated selection behavior for medium windows.
app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTopAppBar.kt Adds modifier parameter to the string-title overload and makes forwarding call-site-safe via named args.
app/src/main/java/com/infomaniak/swisstransfer/ui/components/SmallWindowScreenTitle.kt Displays the “small window” title for medium windows as well.
Comments suppressed due to low confidence (1)

app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/MainScaffold.kt:123

  • calculateFromAdaptiveInfo now maps large windows to NavigationDrawer, but NavigationLargeWindowPreview in this file still renders the scaffold with NavigationRail. Consider updating the preview(s) to reflect the new large-window behavior so previews remain accurate.
private fun calculateFromAdaptiveInfo(context: Context, windowAdaptiveInfo: WindowAdaptiveInfo): NavigationSuiteType {
    return if (windowAdaptiveInfo.isWindowLarge(context)) {
        NavigationSuiteType.NavigationDrawer
    } else if (windowAdaptiveInfo.isWindowMedium(context)) {
        NavigationSuiteType.NavigationRail
    } else {
        NavigationSuiteType.NavigationBar
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aymericmariaux aymericmariaux requested a review from Copilot April 30, 2026 14:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds adaptive navigation behavior for foldables/small tablets by introducing a “medium” window tier and rendering a NavigationRail in that tier, while updating related UI scaffolds/app bars accordingly.

Changes:

  • Introduce isWindowMedium window classification and update “small”/pane behavior to account for medium devices.
  • Render NavigationRail (instead of bottom bar) for medium windows; use drawer for large windows.
  • Update top app bar call sites + add modifier support to SwissTransferTopAppBar.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
app/src/main/java/com/infomaniak/swisstransfer/ui/utils/WindowAdaptativeInfoExt.kt Adds “medium” window helper and updates small-window detection.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreen.kt Updates SwissTransferTopAppBar call to use named title.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/MyAccountScreen.kt Updates SwissTransferTopAppBar call to use named title.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentScreen.kt Updates SwissTransferTopAppBar call to use named title.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt Updates SwissTransferTopAppBar call to use named title.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/MainScaffold.kt Chooses Drawer for large, Rail for medium, Bar for small.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/AppNavigationSuiteScaffold.kt Implements AppNavigationRail variant and wires it into the scaffold.
app/src/main/java/com/infomaniak/swisstransfer/ui/components/TwoPaneScaffold.kt Expands two-pane behavior to include medium windows.
app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTopAppBar.kt Adds modifier param and makes arg passing explicit.
app/src/main/java/com/infomaniak/swisstransfer/ui/components/SmallWindowScreenTitle.kt Displays title on medium windows too.
app/src/main/java/com/infomaniak/swisstransfer/ui/components/BrandTopAppBar.kt Uses auto-sizing BasicText for app name in the top bar.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aymericmariaux aymericmariaux force-pushed the tablet-fold-ui branch 2 times, most recently from 2b41cef to db0d8db Compare May 1, 2026 07:01
@aymericmariaux aymericmariaux requested a review from Copilot May 1, 2026 07:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds “medium window” support to improve adaptive navigation on foldables and smaller tablets by switching from bottom navigation to a navigation rail, and updates related UI components to behave correctly across window sizes.

Changes:

  • Introduces isWindowMedium() window classification and updates isWindowSmall() logic accordingly.
  • Updates main navigation to use NavigationRail for medium windows and NavigationDrawer for large windows.
  • Adjusts top app bar/title components and branding app bar to better support the new adaptive layouts.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
app/src/main/java/com/infomaniak/swisstransfer/ui/utils/WindowAdaptativeInfoExt.kt Adds isWindowMedium() and refines small/medium/large window classification.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreen.kt Updates SwissTransferTopAppBar call site to use named title param.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/MyAccountScreen.kt Updates SwissTransferTopAppBar call site to use named title param.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentScreen.kt Updates SwissTransferTopAppBar call site to use named title param.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt Updates SwissTransferTopAppBar call site to use named title param.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/MainScaffold.kt Maps medium windows to NavigationRail and large to NavigationDrawer.
app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/AppNavigationSuiteScaffold.kt Implements the custom AppNavigationRail and integrates it into the scaffold.
app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItemList.kt Uses the renamed small/medium window screen title component.
app/src/main/java/com/infomaniak/swisstransfer/ui/components/TwoPaneScaffold.kt Enables 2 horizontal partitions for medium windows as well as large windows.
app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTopAppBar.kt Adds modifier parameter and updates overload to use named arguments.
app/src/main/java/com/infomaniak/swisstransfer/ui/components/SmallOrMediumWindowScreenTitle.kt Renames and expands title visibility to small + medium windows.
app/src/main/java/com/infomaniak/swisstransfer/ui/components/BrandTopAppBar.kt Switches app name rendering to auto-sizing text for better fit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +25 to +28
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.text.BasicText
import androidx.compose.foundation.text.TextAutoSize
import androidx.compose.foundation.text.TextAutoSize.Companion.StepBased
import androidx.compose.material3.CenterAlignedTopAppBar
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.Text
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorProducer
import androidx.compose.ui.graphics.toColorLong
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants