Skip to content

Add permission step to onboarding#545

Merged
cjpais merged 5 commits intocjpais:mainfrom
anchpop:@anchpop/perms
Jan 14, 2026
Merged

Add permission step to onboarding#545
cjpais merged 5 commits intocjpais:mainfrom
anchpop:@anchpop/perms

Conversation

@anchpop
Copy link
Contributor

@anchpop anchpop commented Jan 7, 2026

This PR adds an onboarding step on MacOS that explicitly asks the user to grant permissions. Once permissions are granted, it automatically moves on to the next screen. It also fixes a bug where the app would crash if it did not have the necessary permissions, by removing input::EnigoState::new().expect("...");

CleanShot.2026-01-06.at.22.00.25.mp4

The most important architectural change is that input::EnigoState::new() is longer be called from initialize_core_logic, because this triggers a permission prompt, and I wanted the permission prompt not to appear until after the user clicked a "grant permission" button. (I didn't put too much thought into phrasing – "open settings" might be better, but a permission prompt does appear first.)

See discussion in #544

@anchpop
Copy link
Contributor Author

anchpop commented Jan 7, 2026

Looked over the code, I think it's ready for review now.

I experienced a bug during testing where the app got stuck in the "loading" state according to the model selector, and transcriptions didn't work. It happened on the second open (e.g. open → onboard → close → open → stuck in "loading"). Unfortunately I stopped being able to reproduce it, and I'm not sure if it's related to my changes or a coincidence.

@anchpop anchpop marked this pull request as ready for review January 7, 2026 09:42
@cjpais
Copy link
Owner

cjpais commented Jan 7, 2026

Okay, thank you for this. I'll take a look soon, but give me maybe a week or two. I'm quite busy right now, but I do wanna bring this in for sure.

@anchpop
Copy link
Contributor Author

anchpop commented Jan 12, 2026

Oh yeah, probably a good call on the translations haha. I forgot about that. Does the code need to be updated to use them?

@cjpais cjpais merged commit e1c6007 into cjpais:main Jan 14, 2026
2 checks passed
@cjpais
Copy link
Owner

cjpais commented Jan 14, 2026

Should help to fix #564

@anchpop
Copy link
Contributor Author

anchpop commented Jan 14, 2026

@cjpais I can confirm that this PR fixed #564 on my machine (when I tested it)! The crash was caused by this line:

fn initialize_core_logic(app_handle: &AppHandle) {
    let enigo_state = input::EnigoState::new().expect("Failed to initialize input state (Enigo)"); // ← crash!
    // [...]
}

@anchpop anchpop deleted the @anchpop/perms branch January 14, 2026 17:40
@cjpais
Copy link
Owner

cjpais commented Jan 15, 2026

Thanks yea, I was unable to replicate the crash on my machine even toggling the permission off

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