openedx / openedx/openedx-app-ios

[iOS] Unification of Navigation Titles and Error Message Handling Across Multiple Views

Open
#443 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Swift
Stars
31
Forks
32
PR merge metrics
No merged PRs in 30d

Description

We have identified repetitive implementations of navigation titles and error message handling across multiple views in our project. This redundancy makes the codebase harder to maintain and less consistent. Specifically, the navigation titles are repeatedly defined in VideoDownloadQualityView, SignUpView, SettingsView, ManageAccountView, VideoSettingsView, and VideoQualityView. Additionally, the SnackBarView(message: viewModel.errorMessage) is used across various screens for error messaging but lacks a unified implementation.

To address this, I propose creating reusable components for navigation titles and error message handling. This would involve:

Implementing a NavigationTitle component that can be reused across all views requiring a navigation title.
Implementing a SnackBarView component for consistent error message display across the application.
Refactoring the views (VideoDownloadQualityView, SignUpView, SettingsView, ManageAccountView, VideoSettingsView, VideoQualityView) to use these new components.
This unification will lead to a more maintainable and consistent codebase.

An alternative would be to continue with the current implementation, making individual changes to navigation titles and error messages as needed. However, this approach is not scalable and would result in further code duplication and inconsistencies.

I've already done similar unification in a previous pull request: PR #439, where I created ErrorAlertView and NavigationTitle components. We can reuse these components for this unification effort.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PR #439 and its ErrorAlertView and NavigationTitle components. Then inspect VideoDownloadQualityView, SignUpView, SettingsView, ManageAccountView, VideoSettingsView, and VideoQualityView, along with their SnackBarView(message: viewModel.errorMessage) usage. Done means the listed views consistently reuse the shared components.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.