Flipper: Discussion: Add support for deleting a shared preference

Created on 21 May 2019  路  10Comments  路  Source: facebook/flipper

In Flipper 0.20, I can edit a shared preference item, but I can't delete one. If I delete the contents of a string preference, I end up with an empty string but I can't remove the preference item.

enhancement good first issue help wanted

Most helpful comment

I would love to merge a PR adding this feature! If anyone wants to work on this, I am happy to help answering any questions.

All 10 comments

I would love to merge a PR adding this feature! If anyone wants to work on this, I am happy to help answering any questions.

Really needed too!

@danielbuechele
There are two SharedPreferences.Editor methods that could be used.

- clear() ... remove all 
- remove(String key) ... remove individual preference

Would both be useful. What would the UI look like?

In terms of the UI, I would suggesting a toolbar on top of the plugin, which adds the buttons "Delete" and "Clear all". Delete should only be enabled, when an entry is selected.

Similar like in the logs plugin, where we have a toolbar on top:

@danielbuechele I'll take this up

@danielbuechele I'll take this up

Awesome! Do let us know if we can help you with anything. :)

@passy @danielbuechele Currently the preferences values are being displayed in DataInspector component. In order to select and deselect an entry, would it be nice to have a checkbox beside every entry in that component? or? do you suggest another approach for this?

Hey! @umasankar-yedida are you still working on this one? Because if not then I'll be happy to take it over.

@danielbuechele @passy
I started looking around and seems like prefs are displayed in ManagedDataInspector. I don鈥檛 see any property that would allow me to add a button or other action there. So I see 2 options:

  1. Add a handler for deleting entries in DataInspector (similar to setValue)
  2. Get rid of ManagedDataInspector and replace it with normal table with 3 columns: pref name, pref value (editable) and remove button.

I was thinking that this may be a good opportunity to add an option for creating a new preference key.

What do you think?

@mzgreen Thanks for investigating this! Deleting seems like an action common enough that it would make sense to add support for this to the managed table itself.

Was this page helpful?
0 / 5 - 0 ratings