[GH-314] Persist user settings in native Linux app #1018
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds persistence for the user settings in the native Linux app. The settings are written to
$XDG_CONFIG_HOME/focalboard/settings
. IfXDG_CONFIG_HOME
is unset, the app falls back to$HOME/.config
.The change hooks into the existing settings export already used in the native macOS app which means the settings are persisted immediately on change.
Unfortunately, the golang webview package uses a custom native binding technology and doesn't allow to define WebKit message handlers. As a result, a dedicated message handler function was added to the existing
NativeApp
object. In the native macOS app, said handler is short-circuited towindow.webkit.messagehandlers.[NAME].postMessage
. This has the benefit that the web app remains agnostic of the particular native binding mechanism.I have virtually zero experience with Go so while this appears to be working in my testing, the code very likely is an abomination. I'm looking forward to candid feedback. 🙂
I'd also appreciate some more testing. When running the Linux app on a mac, I once got a blank screen on launch but didn't manage to reproduce again. When testing on Linux, I didn't observe any issues so far.
Ticket Link
Relates to #314.