Skip to content

Add option to start app in Home/Last project - #4638

Merged
Withalion merged 6 commits into
masterfrom
feature/editable-user-spawner
Aug 19, 2026
Merged

Add option to start app in Home/Last project#4638
Withalion merged 6 commits into
masterfrom
feature/editable-user-spawner

Conversation

@xkello

@xkello xkello commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

Currently the app always auto-loads the last-opened project on startup, with no way to change this. For users with large/complex projects, this means every launch pays the load cost of a project they may just want to switch away from.

This PR adds a setting under Settings -> General -> On app startup that lets the user pick between:

  • Recent project - jump back into the last project (default, unchanged behaviour)
  • Project home - go straight to the list of downloaded projects, skipping any project load

Fixes: #4621

What changed

  • app/appsettings.h / app/appsettings.cpp - new AppSettings::StartupBehaviour enum (StartupRecentProject / StartupProjectHome), exposed as startupBehaviour property, persisted under the startupBehaviour key, following the same pattern as the existing hapticsType setting.
  • app/qml/settings/components/MMSettingsDropdown.qml - added optional drawerTitle (falls back to the row's title, so existing usages are unaffected) and secondaryText support on drawer options, needed to show the per-option subtitles in the new drawer.
  • app/qml/settings/MMSettingsPage.qml - new On app startup row under the General section (first item, before About), opening an Open on startup drawer with the two options and their subtitles, mirroring the existing "Touch Feedback" / "Interval threshold type" dropdown rows.
  • app/qml/main.qml - Component.onCompleted now checks AppSettings.startupBehaviour first; if Project home is selected it skips loading the default project and goes straight to the projects list. The Recent project path is untouched.

Behaviour

  • Default is Recent project - existing users see no change.
  • Switching to Project home: on the next app launch, the app opens directly to the downloaded projects list instead of loading a project. No project is loaded, so there's no load-time cost.
  • Switching back to Recent project: resumes the previously remembered project, since defaultProject is never cleared when in Project home mode.
  • The choice persists across restarts (QSettings) and only takes effect on the next launch, not immediately.

Video 1: App launch with "Recent project" selected - shows current/default behaviour, opens straight into the last project.

Screencast.From.2026-08-07.18-43-08.webm

Video 2: App launch with "Project home" selected - shows the app opening directly to the projects list, no project load.

Screencast.From.2026-08-07.18-42-43.webm
Screenshot From 2026-08-07 18-43-26 Screenshot From 2026-08-07 18-43-43

TLDR @Withalion

Adds an "On app startup" setting so users can choose whether the app opens their Recent project (current, default behaviour) or Project home (list of downloaded projects) on launch. New AppSettings::StartupBehaviour enum persisted via QSettings, one new settings row + drawer reusing existing MMSettingsDropdown/MMListDrawer components, and a small gate in main.qml's startup logic. No new components, no CMake changes.

@xkello xkello added this to the 2026.4.0 milestone Aug 7, 2026
@xkello
xkello requested a review from Withalion August 7, 2026 16:48
@Withalion Withalion removed this from the 2026.4.0 milestone Aug 13, 2026

@Withalion Withalion left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

British code detected! 🇬🇧🇬🇧🇬🇧

Please rebase it on current master as well

Comment thread app/qml/settings/components/MMSettingsDropdown.qml Outdated
Comment thread app/qml/settings/MMSettingsPage.qml Outdated
Comment thread app/qml/settings/MMSettingsPage.qml
Comment thread app/qml/settings/MMSettingsPage.qml Outdated
Comment thread app/qml/main.qml Outdated
Comment thread app/appsettings.cpp Outdated
@Withalion

Copy link
Copy Markdown
Collaborator

Also the option to open recent project doesn't work always. If I close the app on map screen, it opens map screen again. If I close the app on project screen it opens project screen again even if it's set to recent project

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 32240207589

Coverage decreased (-0.03%) to 59.104%

Details

  • Coverage decreased (-0.03%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 60 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

60 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
mm/app/appsettings.cpp 53 69.23%
mm/core/merginapi.cpp 7 74.79%

Coverage Stats

Coverage Status
Relevant Lines: 15691
Covered Lines: 9274
Line Coverage: 59.1%
Coverage Strength: 98.55 hits per line

💛 - Coveralls

@github-actions

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 71621 dmg Expires: 15/11/2026 #7162
linux Build 📬 Mergin Maps 71881 x86_64 Expires: 15/11/2026 #7188
win64 Build 📬 Mergin Maps 63641 win64 Expires: 15/11/2026 #6364
Android Build 📬 Mergin Maps 847311 APK [armeabi-v7a] Expires: 15/11/2026 #8473
📬 Mergin Maps 847311 APK [armeabi-v7a] Google Play Store #8473
Android Build 📬 Mergin Maps 847351 APK [arm64-v8a] Expires: 15/11/2026 #8473
📬 Mergin Maps 847351 APK [arm64-v8a] Google Play Store #8473
iOS Build 📬 Build number: 26.08.941411 #9414

@xkello
xkello requested a review from Withalion August 17, 2026 10:09

@Withalion Withalion left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Besides these small things have you solved the issue I mentioned in my other comment?

Comment thread app/qml/settings/MMSettingsPage.qml Outdated

model: startupBehaviourModel
model: startupBehaviorModel
value: model.count > 0 ? model.get(currentIndex).text : ""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

model.count will never be zero

Comment thread app/appsettings.cpp Outdated
settings.beginGroup( CoreUtils::QSETTINGS_APP_GROUP_NAME );
const QString path = settings.value( "defaultProject", "" ).toString();
const QString path = settings.value( QStringLiteral( "defaultProject" ), "" ).toString();
const QString layer = settings.value( "defaultLayer/" + path, "" ).toString();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you missed this one

@xkello

xkello commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Besides these small things have you solved the issue I mentioned in my other comment?

Do you mean the one where project would start in home even if last project was selected if app was closed in home? Yes that one has been solved.

@github-actions

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 71671 dmg Expires: 16/11/2026 #7167
linux Build 📬 Mergin Maps 71931 x86_64 Expires: 16/11/2026 #7193
win64 Build 📬 Mergin Maps 63691 win64 Expires: 16/11/2026 #6369
Android Build 📬 Mergin Maps 847851 APK [arm64-v8a] Expires: 16/11/2026 #8478
📬 Mergin Maps 847851 APK [arm64-v8a] Google Play Store #8478
Android Build 📬 Mergin Maps 847811 APK [armeabi-v7a] Expires: 16/11/2026 #8478
📬 Mergin Maps 847811 APK [armeabi-v7a] Google Play Store #8478
iOS Build 📬 Build number: 26.08.941911 #9419

@IvaKuklica

IvaKuklica commented Aug 18, 2026

Copy link
Copy Markdown

Testing note:

Tested the new "On app startup" setting under Settings → General.

Project home option works as expected — the app consistently opens to the list of downloaded projects on startup, skipping project load.

Issue 1:Recent project option (default) is inconsistent — found an issue where the behaviour changes between consecutive app closures:

  • With "Recent project" selected, closed the app while on the map screen of a project → app reopened correctly on the map screen.
  • Repeated the same action (closed the app again while on the map screen/different screen) → app instead reopened on the project list screen.
    Screenrecord:
ScreenRecording_08-18-2026.14-37-26_1.mp4

Issue 2: ❌ Issue with the Settings → General → "Startup behaviour" entry itself: - after closing and reopening the app and navigating back to Settings → General, the "Startup behaviour" " row shows an empty space on the right instead of the currently selected value (e.g. "Recent project" or "Project home").

Screenrecord:
Screenshot 2026-08-18 144047

Issue 3 ❌ UI copy mismatch: A drawer title doesn't match Figma design: this dravew should be titled "Startup behaviour".
Screenshot mobile application vs. Figma:
Screenshot 2026-08-18 162804 Screenshot 2026-08-18 163115

@xkello

xkello commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Fix startup behaviour settings issues found in testing @IvaKuklica

Issue 1: "Recent project" reopening on the projects list inconsistently
between closures. Investigated - traced to the existing crash-recovery
flag file (5s window), unrelated to this feature. Confirmed as expected
behavior, no change made.

Issue 2: Settings row showed a blank value after a fresh app start.
The model was populated in Component.onCompleted, but the row's
value binding could evaluate before that ran. Switched to static
ListElement entries so it's populated synchronously.

Issue 3: Drawer title didn't match design ("Open on startup" vs
"Startup behaviour"). Removed the drawerTitle override so it falls
back to the row's title.

@github-actions

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 71751 dmg Expires: 17/11/2026 #7175
linux Build Build failed or not found. #7201
win64 Build 📬 Mergin Maps 63771 win64 Expires: 17/11/2026 #6377
Android Build 📬 Mergin Maps 848611 APK [armeabi-v7a] Expires: 17/11/2026 #8486
📬 Mergin Maps 848611 APK [armeabi-v7a] Google Play Store #8486
Android Build 📬 Mergin Maps 848651 APK [arm64-v8a] Expires: 17/11/2026 #8486
📬 Mergin Maps 848651 APK [arm64-v8a] Google Play Store #8486
iOS Build 📬 Build number: 26.08.942711 #9427

@github-actions

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 71751 dmg Expires: 17/11/2026 #7175
linux Build 📬 Mergin Maps 72012 x86_64 Expires: 17/11/2026 #7201
win64 Build 📬 Mergin Maps 63771 win64 Expires: 17/11/2026 #6377
Android Build 📬 Mergin Maps 848611 APK [armeabi-v7a] Expires: 17/11/2026 #8486
📬 Mergin Maps 848611 APK [armeabi-v7a] Google Play Store #8486
Android Build 📬 Mergin Maps 848651 APK [arm64-v8a] Expires: 17/11/2026 #8486
📬 Mergin Maps 848651 APK [arm64-v8a] Google Play Store #8486
iOS Build 📬 Build number: 26.08.942711 #9427

@IvaKuklica

Copy link
Copy Markdown

Testing note: Retest Round 2 (after fix)

Application works correctly:
✅ Issue 1: The application behaves as expected, no change made.
✅ Issue 2: The 'Startup behaviour"section displays the currently selected value
✅ Issue 3: The application now matches the Figma design.

@Withalion
Withalion merged commit 8bc273f into master Aug 19, 2026
13 of 14 checks passed
@Withalion
Withalion deleted the feature/editable-user-spawner branch August 19, 2026 20:51
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.

Add an option to settings to load to menu by default

4 participants