fix: make Up to Date status persistent in skill detail page#57
Merged
Conversation
…fter 2 seconds - Root cause: showUpToDate flag in SkillDetailViewModel auto-hid after 2 seconds via Task.sleep, causing users to easily miss the confirmation - Removed transient showUpToDate property and its 2-second auto-hide timer - Detail view now reads persistent updateStatuses[skill.id] from SkillManager (which already stores .upToDate after checkForUpdate completes) - "Up to Date" label stays visible until user navigates away or re-checks - Added small "Check Again" button next to the Up to Date label for convenience Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
When clicking "Check for updates" on a skill that is already up to date, the "Up to Date" message only displayed for 2 seconds before auto-dismissing. Users could easily miss the confirmation and wouldn't know whether their skill was current.
Root Cause
SkillDetailViewModel.showUpToDatewas a transient boolean flag that auto-hid after a 2-secondTask.sleep. After it disappeared, the view fell back to showing the "Check for updates" button again — as if the check never happened.Solution
Replaced the transient
showUpToDateflag with the persistentskillManager.updateStatuses[skill.id]dictionary (which already stores.upToDateafter a check completes). The "Up to Date" label now stays visible until the user navigates away or triggers another check.Changes
SkillDetailViewModel.swift:
showUpToDatepropertyshowUpToDate = trueand the 2-second auto-hideTaskincheckForUpdate()skillManager.updateStatuses[.upToDate]was already being set — no new persistence logic neededSkillDetailView.swift:
updateStatusView()now readsskillManager.updateStatuses[skill.id]instead ofviewModel.showUpToDate.upToDate, shows persistent green label + small "Check Again" button.upToDatecase check alongsideskill.hasUpdatefor the update-available stateManual Verification Required
Regression Checklist
notCheckedcheckAllUpdates()batch check still populatesupdateStatusescorrectly🤖 Generated with Claude Code