Skip to content

feat: Implement Inspirational Message Feature#3

Open
ryanrampage1 wants to merge 1 commit intomainfrom
feature/inspirational-messages
Open

feat: Implement Inspirational Message Feature#3
ryanrampage1 wants to merge 1 commit intomainfrom
feature/inspirational-messages

Conversation

@ryanrampage1
Copy link
Owner

Adds a feature to display a new inspirational message to you each time you open the application.

Key changes:

  • Added InspirationalMessages.swift with 80 predefined quotes.
  • Integrated UserDefaultsClient into the TCA AppFeature environment using @Dependency for managing the index of the last displayed message.
  • Updated AppFeature (State, Action, Reducer) to handle the logic for:
    • Loading the last displayed message index from UserDefaults (defaulting to -1 on first launch).
    • Calculating the next message index in a sequential cycle.
    • Storing the new index to UserDefaults.
    • Updating the state with the message to be displayed.
  • Modified AppView.swift to:
    • Trigger the loading of the inspirational message on view appearance.
    • Display the current message at the top of the main screen using a SwiftUI Text view with appropriate styling.
  • The feature follows the technical requirements TR-IM-001 to TR-IM-005, ensuring messages are stored correctly, cycled sequentially, integrated with TCA, displayed in the UI, and handle the initial launch state.

Adds a feature to display a new inspirational message to you each time you open the application.

Key changes:
- Added `InspirationalMessages.swift` with 80 predefined quotes.
- Integrated `UserDefaultsClient` into the TCA `AppFeature` environment using `@Dependency` for managing the index of the last displayed message.
- Updated `AppFeature` (State, Action, Reducer) to handle the logic for:
    - Loading the last displayed message index from UserDefaults (defaulting to -1 on first launch).
    - Calculating the next message index in a sequential cycle.
    - Storing the new index to UserDefaults.
    - Updating the state with the message to be displayed.
- Modified `AppView.swift` to:
    - Trigger the loading of the inspirational message on view appearance.
    - Display the current message at the top of the main screen using a SwiftUI `Text` view with appropriate styling.
- The feature follows the technical requirements TR-IM-001 to TR-IM-005, ensuring messages are stored correctly, cycled sequentially, integrated with TCA, displayed in the UI, and handle the initial launch state.
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