Skip to content

feat(settings): add child mode toggle to hide download/delete buttons#1615

Open
Thomas05000005 wants to merge 2 commits into
finamp-app:redesignfrom
Thomas05000005:feat/child-mode-559
Open

feat(settings): add child mode toggle to hide download/delete buttons#1615
Thomas05000005 wants to merge 2 commits into
finamp-app:redesignfrom
Thomas05000005:feat/child-mode-559

Conversation

@Thomas05000005

@Thomas05000005 Thomas05000005 commented May 4, 2026

Copy link
Copy Markdown

Summary

Adds a new "Enable child mode" toggle in Interaction Settings that hides every UI affordance for downloading or deleting items in the app. Originally requested by @yringler in #559: an offline-mode-friendly setting so kids using the app for playback can't accidentally delete the parent's downloaded library.

Closes #559

Implementation

Followed the "Adding a New Setting" guide in CONTRIBUTING.md:

  • lib/models/finamp_models.dart: new enableChildMode field on FinampSettings (@HiveField(148)) + DefaultSettings.enableChildMode = false.
  • lib/services/finamp_settings_helper.dart: reset added to resetInteractionsSettings().
  • lib/screens/interaction_settings_screen.dart: new EnableChildModeToggle placed right after ShowDeleteFromServerOptionToggle (both are protective settings).
  • lib/l10n/app_en.arb: enableChildModeTitle / enableChildModeSubtitle.
  • Generated files (finamp_models.g.dart, finamp_settings_helper.g.dart) regenerated via dart run build_runner build --delete-conflicting-outputs.

To make sure the toggle covers the actual issue text ("the app just wouldn't show the ability to download or delete downloaded files anywhere"), I patched every entry point I could find while testing the build on Windows desktop:

  • Inline DownloadButton (Album/Artist/Genre/Library tile): lib/components/AlbumScreen/download_button.dart returns SizedBox.shrink() when child mode is on.
  • Per-item context menus (3-dots) - five menu entries, each with both a Visibility(visible: ...) gate in build() and an isVisible getter for the HideableMenuEntry interface:
    • lib/menus/components/menuEntries/download_menu_entry.dart
    • lib/menus/components/menuEntries/delete_from_device_menu_entry.dart
    • lib/menus/components/menuEntries/delete_from_server_menu_entry.dart
    • lib/menus/components/menuEntries/lock_download_menu_entry.dart
    • lib/menus/components/menuEntries/adaptive_download_lock_delete_menu_entry.dart
  • Navigation drawer: lib/menus/music_screen_drawer.dart was converted to a ConsumerWidget and the "Downloads" ListTile is conditionally rendered. Other entries (Playback History, Saved Queues, Logs, Settings) are kept - none of them expose a way to delete downloaded files.

flutter analyze returns 0 new errors. Code formatted with dart format.

Question for reviewers - scope of "anywhere"

While testing I hit one ambiguity: the drawer's "Saved Queues" entry uses an Icons.auto_delete icon and the screen's tiles use TablerIcons.restore. Reading the code, that screen only restores past playback queues; it doesn't delete any downloaded file. So I left it visible in child mode. Happy to also gate it behind enableChildMode if you prefer the stricter interpretation - let me know.

Test plan

Tested on Windows desktop (flutter run -d windows) against a real Jellyfin server. With child mode on:

  • Toggle persists across app restarts
  • Album screen header has no download / delete icons
  • Album screen 3-dots menu has no Download / Delete / Lock entries
  • Same on Artist, Genre, and individual track menus (same 5 menu entries are reused)
  • Drawer no longer shows the "Downloads" link
  • Saved Queues entry still works (intentionally - see question above)
  • Reset button on Interaction Settings restores enableChildMode = false

With child mode off, every download/delete affordance reappears unchanged.

Code assistance

Used Claude (LLM) to scaffold the new setting following CONTRIBUTING.md, to grep for every download/delete entry point after the first round of manual testing surfaced gaps in the initial fix, and to verify the screens that were left visible (Saved Queues) actually don't expose any download/delete action.

Adds a new toggle in Interaction Settings that, when enabled, hides
the download and delete buttons across the app to prevent accidental
changes. Closes finamp-app#559.
Thomas05000005 added a commit to Thomas05000005/finamp that referenced this pull request May 4, 2026
Avoids collision with finamp-app#1615 which also reserves HiveField 148 for
enableChildMode. If finamp-app#1615 lands first, this branch will rebase cleanly;
if this lands first, the other PR can update similarly.
Initial PR only hid the inline DownloadButton on Album/Artist/etc.
screens. Manual testing on Windows desktop revealed the same
download/delete actions were still reachable through:
  - the per-item 3-dots context menus (5 menu entries: download,
    delete-from-device, delete-from-server, lock-download, and the
    adaptive wrapper that picks one of them)
  - the navigation drawer's "Downloads" entry, which opens the full
    download management screen

Each menu entry already had a Visibility/isVisible gate; I extended
those gates with !enableChildMode (using ref.watch in the build path
and FinampSettingsHelper.finampSettings.enableChildMode in the
isVisible getter, since the latter has no widget context). The drawer
got converted to a ConsumerWidget so it can read the same flag and
omit the Downloads list tile when child mode is on. Other drawer
entries (Playback History, Saved Queues, Logs, Settings) are kept,
since they don't expose any way to delete downloaded files.
@Thomas05000005
Thomas05000005 marked this pull request as ready for review May 8, 2026 14:38
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