feat: Implement Inspirational Message Feature#3
Open
ryanrampage1 wants to merge 1 commit intomainfrom
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a feature to display a new inspirational message to you each time you open the application.
Key changes:
InspirationalMessages.swiftwith 80 predefined quotes.UserDefaultsClientinto the TCAAppFeatureenvironment using@Dependencyfor managing the index of the last displayed message.AppFeature(State, Action, Reducer) to handle the logic for:AppView.swiftto:Textview with appropriate styling.