Skip to content

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

Open
xkello wants to merge 3 commits into
masterfrom
feature/editable-user-spawner
Open

Add option to start app in Home/Last project#4638
xkello wants to merge 3 commits into
masterfrom
feature/editable-user-spawner

Conversation

@xkello

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-26Screenshot 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.

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

@WithalionWithalion 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 threadapp/qml/settings/components/MMSettingsDropdown.qml Outdated
MMSettingsComponents.MMSettingsDropdown {
width: parent.width

title: qsTr("On app startup")

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.

This is nitpick for @gabriel-bolbotina, on every other setting name we use noun and here we don't. Wouldn't it be better to name it "Startup behaviour"?

"Manage GPS receivers" is the only offender

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Start up behaviour sounds good to me, I'll change it in figma

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.

@xkello change this as well then

Comment threadapp/qml/settings/MMSettingsPage.qml
Comment threadapp/qml/settings/MMSettingsPage.qml Outdated
Comment threadapp/qml/main.qml Outdated
Comment threadapp/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

Copy link
Copy Markdown

Coverage Report for CI Build 32012645284

Coverage decreased (-0.01%) to 59.117%

Details

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

Uncovered Changes

No uncovered changes found.

Coverage Regressions

62 previously-covered lines in 4 files lost coverage.

FileLines Losing CoverageCoverage
mm/app/appsettings.cpp5369.23%
mm/core/merginapi.cpp774.79%
mm/app/layerfeaturesmodel.cpp181.77%
mm/core/merginuserinfo.cpp179.08%

Coverage Stats

Coverage Status
Relevant Lines:15691
Covered Lines:9276
Line Coverage:59.12%
Coverage Strength:97.83 hits per line

💛 - Coveralls

@github-actions

Copy link
Copy Markdown

📦 Build Artifacts Ready

OSStatusBuildInfoWorkflow run
macOS Build📬Mergin Maps 71621 dmgExpires: 15/11/2026#7162
linux Build📬Mergin Maps 71881 x86_64Expires: 15/11/2026#7188
win64 Build📬Mergin Maps 63641 win64Expires: 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 WithalionAugust 17, 2026 10:09

@WithalionWithalion 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?


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 threadapp/appsettings.cpp
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

Sign up for freeto 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

3 participants

@xkello@Withalion@gabriel-bolbotina