-
-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(native): add native settings section #1414
base: main
Are you sure you want to change the base?
Conversation
Run & review this pull request in StackBlitz Codeflow. |
✅ Deploy Preview for elk-docs canceled.
|
✅ Deploy Preview for elk-zone ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
I wonder if we should add these options in elk-native itself, we should be able to add some hooks to extend the options 🤔 |
Yes. We could potentially also move the tauri module that exists in this repo -> elk native repo itself. |
I don't know how we would integrate this with the current submodule setup, but if you have any smart ideas, moving as much elk-native specific code into that repo sounds like a good solution to me generally |
I don't think it would be possible to move the tauri module into elk-native repository, as that could cause some type issues (just adding tauri-runtime-only types in this repository I had problems with types, see https://github.com/elk-zone/elk/blob/8bd02816203f5e00c7440689a877a5888107613a/modules/tauri/runtime/native-settings-undefined.ts) At least I can't think of any good and easy solution |
I've resolved the merge conflicts. Should we wait till elk-zone/elk-native#65 is resolved before merging this? I feel like for now we could just merge it and once it is decided whether we will continue to use git submodules or start using other methods, just migrate some of this code. I'll gladly migrate this into elk-native once and in case it is necessary. |
@JonasKruckenberg This method could be added to elk/modules/tauri/runtime/native-settings.ts Lines 8 to 35 in c383d93
|
@Shinigami92 any chance for a review? This PR has been sitting here without any activity for a while |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could just do a code review
I don't use the native tauri app, you should ask someone else that is more familiar with the tauri app
Co-authored-by: Shinigami92 <[email protected]>
@JonasKruckenberg could you please take a look at this when you're free? |
@@ -9,8 +9,10 @@ export default defineNuxtModule({ | |||
const nuxt = useNuxt() | |||
const { resolve } = createResolver(import.meta.url) | |||
|
|||
if (!process.env.TAURI_PLATFORM) | |||
if (!process.env.TAURI_PLATFORM) { | |||
addImports({ name: 'useNativeSettings', from: resolve('./runtime/native-settings-undefined') }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please explain why it is needed to have this -undefined
version?
Cant this be e.g. inlined like addImports({ name: 'useNativeSettings', from: () => undefined })
or similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I added the -undefined
version is, that the non-undefined version cannot be imported unless in tauri environment.
It also serves the purpose of setting the types for the function (NativeSettings | undefined
), because they wouldn't be generated in the prepare
command, as the module returned before defining the global import.
I had no idea it was possible to import it inline, I'll take a look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find any way to add an import inline, the import object requires from: string
value, and I couldn't find any other auto import releated function, that would do such a thing.
This pull request adds a settings section that is only shown in elk native app and
minimize_to_tray
configuration option.Related
elk-zone/elk-native#58