Skip to content

feat: [PREFERENCES] Delete a preference entry from the desktop - #731

Merged
florent37 merged 1 commit into
mainfrom
feat/preferences-delete-entry
Oct 30, 2026
Merged

florent37 merged 1 commit into
mainfrom
feat/preferences-delete-entry

Conversation

@florent37

Copy link
Copy Markdown
Contributor

Description

Delete a preference key from the desktop Preferences screen: right-click a row → Delete → confirm, and the connected app removes the key, then sends back the refreshed values.

Built on the typed table from #730 (already merged, so this targets main directly).

  • Protocol: new desktop → mobile method remove_shared_preference_value (requestId, sharedPreferenceName, key) in both Protocol.kt, documented in protocol/shared-preferences.md. Older SDKs ignore it.
  • SDK: FloconPreference.remove(columnName), which does nothing by default so custom implementations still compile. It's implemented for Android SharedPreferences, DataStore and iOS UserDefaults, plus the no-op parity and the multiplatform SamplePreferences. JVM and wasm have no built-in preferences to implement. FloconSharedPrefsPlugin handles the message and answers like a set does. Added jvmTest cases.
  • Desktop: RemoveSharedPrefFieldUseCase → repository → remote datasource. The row uses the existing ContextualMenu, the confirmation uses FloconDialog, and SharedPreferencesViewModel.onDeleteClicked is new. Strings are in EN and FR.
  • MCP: unchanged. The shared-preference tools are read-only, so I didn't add a delete tool.
  • Docs: docs/sharedpref.md (feature + optional remove override in the custom example).

Checks: :sharedprefs:jvmTest, :sharedprefs-no-op / :datastores* / :sample-multiplatform compile, :sample:android:assembleDebug assembleRelease, :composeApp:allTests :mcp:allTests ktlintCheck, mkdocs build --strict.

/gemini review

New remove_shared_preference_value method: FloconPreference.remove (no-op by
default), implemented for SharedPreferences, DataStore and UserDefaults. The
desktop adds a Delete item to the row right-click menu, with a confirmation.
@florent37
florent37 marked this pull request as ready for review October 30, 2026 11:59
@florent37
florent37 merged commit 08f06d6 into main Oct 30, 2026
5 of 6 checks passed
@florent37
florent37 deleted the feat/preferences-delete-entry branch October 30, 2026 11:59
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.

1 participant