Conversation
- Bump votice-sdk package dependency version to 1.0.18 in README.md - Update _version property to "1.0.18" in ConfigurationManager.swift - Modify version expectations to "1.0.18" in ConfigurationManagerTests.swift test cases no message
- Bump SwiftLintPlugins revision to ecafb5b056cb7995324f0d310a61f30661d00cad - Update SwiftLintPlugins version from 0.62.1 to 0.62.2 in Package.resolved file no message
…e views - Add optional progress property to StatusBadge component - Adjust padding order in StatusBadge text styling - Pass suggestion.progress to StatusBadge in SuggestionCard - Pass suggestion.progress to StatusBadge in TVOSSuggestionCard - Pass currentSuggestion.progress to StatusBadge in SuggestionDetailView+tvOS - Pass suggestion.progress to StatusBadge in SuggestionDetailView and update padding accordingly no message
…nd adaptive backgrounds - Add status, progress, and useLiquidGlass properties to StatusBadge - Implement conditional body view to show progress with gradient fill when status is inProgress and progress is available - Use GeometryReader and ZStack to create progress bar with rounded corners and gradient fill - Display status text with progress percentage when applicable - Apply adaptiveGlassBackground for non-progress statuses with configurable liquid glass effect - Extract statusColor and statusText as computed properties in a private extension - Add backgroundView computed property with @ViewBuilder to provide background visuals based on status and progress no message
- Extract default tag view into a computed property `defaultTagView` - Create `inProgressTagView(with:)` function to handle in-progress status rendering - Update in-progress text to show completed and remaining parts with different foreground styles - Replace inline view builder code with calls to `inProgressTagView` and `defaultTagView` - Remove unused `backgroundView` computed property - Add MARK comments for properties and functions sections in private extension no message
…acter - Modify splitIndex calculation by adding 1 to include an additional character in the completed part of the status text based on progress percentage. no message
There was a problem hiding this comment.
Pull Request Overview
This PR bumps the SDK version from 1.0.17 to 1.0.18 and adds progress indicator functionality to the StatusBadge component for suggestions in "in progress" status.
- Added progress parameter to
StatusBadgecomponent to display visual progress for in-progress suggestions - Updated version numbers across configuration, tests, and documentation
- Updated SwiftLint plugin dependency from 0.62.1 to 0.62.2
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
Sources/Votice/Core/Managers/ConfigurationManager.swift |
Updated SDK version from 1.0.17 to 1.0.18 |
Tests/VoticeTests/Managers/ConfigurationManagerTests.swift |
Updated test assertions to expect version 1.0.18 |
README.md |
Updated package dependency version in installation instructions |
Sources/Votice/UI/Components/StatusBadge.swift |
Added progress parameter and implemented visual progress indicator for in-progress status |
Sources/Votice/UI/Components/SuggestionCard.swift |
Added progress parameter to StatusBadge instantiation |
Sources/Votice/UI/Components/TVOSSuggestionCard.swift |
Added progress parameter to StatusBadge instantiation for tvOS |
Sources/Votice/UI/Views/SuggestionDetail/SuggestionDetailView.swift |
Added progress parameter to StatusBadge instantiation in detail view |
Sources/Votice/UI/Views/SuggestionDetail/SuggestionDetailView+tvOS.swift |
Added progress parameter to StatusBadge instantiation in tvOS detail view |
Example/VoticeDemo/VoticeDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved |
Updated SwiftLintPlugins dependency to version 0.62.2 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| func inProgressTagView(with progress: Int) -> some View { | ||
| let fullText = statusText | ||
| let splitIndex = Int(Double(fullText.count) * Double(progress) / 100.0) + 1 |
There was a problem hiding this comment.
The + 1 in the splitIndex calculation causes at least one character to always be displayed as completed, even when progress is 0. This means at 0% progress, the first character of the text will be shown in white (completed color), which may not be the intended behavior.
Consider removing the + 1 to make the progress indicator more accurate:
let splitIndex = Int(Double(fullText.count) * Double(progress) / 100.0)Additionally, consider adding input validation to ensure progress is within the expected 0-100 range.
| status: currentSuggestion.status ?? .pending, | ||
| progress: currentSuggestion.progress, | ||
| useLiquidGlass: false) | ||
|
|
There was a problem hiding this comment.
Inconsistent code formatting. The closing parenthesis should be on its own line without an extra blank line after it, to maintain consistency with the formatting style used in other files (see SuggestionDetailView.swift lines 251-256 and TVOSSuggestionCard.swift lines 73-77).
Suggested formatting:
StatusBadge(
status: currentSuggestion.status ?? .pending,
progress: currentSuggestion.progress,
useLiquidGlass: false
)| func inProgressTagView(with progress: Int) -> some View { | ||
| let fullText = statusText | ||
| let splitIndex = Int(Double(fullText.count) * Double(progress) / 100.0) + 1 | ||
| let completedPart = String(fullText.prefix(splitIndex)) | ||
| let remainingPart = String(fullText.dropFirst(splitIndex)) |
There was a problem hiding this comment.
The inProgressTagView function has a parameter progress that shadows the struct property progress. This creates potential confusion since statusText (line 92) uses the struct's progress property via the computed property defined at line 53. While functionally they should have the same value (due to the check on line 23), this reduces code clarity.
Consider either:
- Using
self.progressexplicitly in thestatusTextcomputation, or - Removing the function parameter and using the struct property directly since
inProgressTagViewis only called whenprogressis non-nil
This pull request introduces a new progress-aware status badge component and updates the SDK version throughout the codebase. The most significant change is the enhancement of the
StatusBadgeto visually represent progress for suggestions that are "in progress," improving the user interface and feedback. Additionally, the SDK version is incremented to1.0.18in all relevant files, and corresponding tests are updated to reflect this change.UI Component Improvements:
StatusBadgeinStatusBadge.swiftto accept aprogressparameter and display a visual progress indicator when the status is.inProgress, including a newinProgressTagViewfor dynamic coloring and progress text. [1] [2] [3]StatusBadgeinSuggestionCard.swift,TVOSSuggestionCard.swift,SuggestionDetailView+tvOS.swift, andSuggestionDetailView.swiftto pass the newprogressproperty from the suggestion entity. [1] [2] [3] [4]SDK Version Updates:
1.0.17to1.0.18inREADME.md,ConfigurationManager.swift, andPackage.resolvedto ensure consistency and reflect the latest release. [1] [2] [3]ConfigurationManagerTests.swiftto expect version1.0.18. [1] [2] [3]