Skip to content

refactor : Settings Navigation to Use Metadata-Driven Row Definitions#288

Open
jonahmichael wants to merge 3 commits into
ProdigyV21:mainfrom
jonahmichael:refactor/settings-metadata-navigation
Open

refactor : Settings Navigation to Use Metadata-Driven Row Definitions#288
jonahmichael wants to merge 3 commits into
ProdigyV21:mainfrom
jonahmichael:refactor/settings-metadata-navigation

Conversation

@jonahmichael
Copy link
Copy Markdown
Contributor

Summary

This PR refactors the TV Settings navigation logic by replacing hardcoded row indices with centralized metadata-driven row definitions.

Changes Made

  • Added SettingsSectionMetadata.kt to define settings rows using symbolic metadata.
  • Removed hardcoded numeric row mappings from SettingsScreen.kt.
  • Updated settings navigation and dispatch logic to use metadata-defined row identifiers.
  • Centralized row ordering and section configuration into a single source of truth.
  • Added documentation comments to improve maintainability.

Motivation

Previously, the Settings screen relied on fixed numeric row indices. This made the implementation fragile when rows were reordered or new rows were inserted.

By introducing metadata-driven row definitions:

  • Navigation becomes easier to maintain.
  • Row ordering is managed in one place.
  • Future settings additions require fewer code changes.
  • The implementation becomes less error-prone.

Testing

Tested the following:

  • Settings screen launches correctly.
  • General settings navigation works as expected.
  • D-pad and focus navigation remain functional.
  • Section transitions behave correctly.
  • No compilation issues detected.

Files Changed

  • SettingsScreen.kt
  • SettingsSectionMetadata.kt

✓ Branch created
✓ Code builds successfully
✓ Manual testing completed
✓ Files reviewed
✓ Changes committed
✓ Branch pushed
✓ PR created
✓ PR description added
✓ Write-up prepared
✓ Submission link copied

- Move SettingsRow and SettingsToggleRow to dedicated SettingsRows.kt component
- Update SettingsScreen to use extracted components
- Fix imports to use theme and skin packages instead of settings package
@ProdigyV21
Copy link
Copy Markdown
Owner

Good idea, but not ready to merge yet.

The concept is useful: moving TV Settings navigation away from hardcoded row numbers should make future settings changes safer.

But this PR currently does not merge into latest main. I tested a clean merge and there is a real conflict in:

app/src/main/kotlin/com/arflix/tv/ui/screens/settings/SettingsScreen.kt

Main has changed the Settings rows again, and this PR edits the same navigation/action block, so it needs a rebase onto latest main and manual conflict resolution.

After rebasing, please retest every TV Settings section with D-pad/Enter:

  • Language
  • Subtitles
  • AI Subtitles
  • Playback
  • Appearance
  • Profiles
  • Network

Because if one row id/order is wrong, pressing Enter can trigger the wrong setting.

So: good refactor, but please rebase and verify the row/action mapping before merge.

@jonahmichael jonahmichael reopened this Jun 1, 2026
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.

2 participants