Skip to content

fix: make Up to Date status persistent in skill detail page#57

Merged
crossoverJie merged 2 commits into
mainfrom
fix/root-level-skill-update
Jun 25, 2026
Merged

fix: make Up to Date status persistent in skill detail page#57
crossoverJie merged 2 commits into
mainfrom
fix/root-level-skill-update

Conversation

@crossoverJie

Copy link
Copy Markdown
Owner

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.showUpToDate was a transient boolean flag that auto-hid after a 2-second Task.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 showUpToDate flag with the persistent skillManager.updateStatuses[skill.id] dictionary (which already stores .upToDate after a check completes). The "Up to Date" label now stays visible until the user navigates away or triggers another check.

Changes

SkillDetailViewModel.swift:

  • Removed showUpToDate property
  • Removed showUpToDate = true and the 2-second auto-hide Task in checkForUpdate()
  • skillManager.updateStatuses[.upToDate] was already being set — no new persistence logic needed

SkillDetailView.swift:

  • updateStatusView() now reads skillManager.updateStatuses[skill.id] instead of viewModel.showUpToDate
  • When status is .upToDate, shows persistent green label + small "Check Again" button
  • Added .upToDate case check alongside skill.hasUpdate for the update-available state

Manual Verification Required

  • Open a skill detail page → click "Check for updates" → verify "Up to Date" label persists (does not disappear after 2 seconds)
  • Verify the small "Check Again" button next to "Up to Date" triggers a re-check
  • Verify that after re-check, the status updates correctly (either stays "Up to Date" or switches to "Update Available")
  • Verify the dashboard row update status indicator still works correctly

Regression Checklist

  • Skill detail page: "Check for updates" button works when status is notChecked
  • Skill detail page: "Update Available" label + "Update" button still works for skills with updates
  • Skill detail page: "Updating..." progress indicator still works during update
  • Skill detail page: Error state still displays correctly
  • Dashboard: Row-level update status indicators (green checkmark, orange dot) unchanged
  • checkAllUpdates() batch check still populates updateStatuses correctly

🤖 Generated with Claude Code

crossoverJie and others added 2 commits June 25, 2026 11:49
…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>
@crossoverJie
crossoverJie merged commit 86b55f3 into main Jun 25, 2026
1 check passed
@crossoverJie
crossoverJie deleted the fix/root-level-skill-update branch June 25, 2026 03:53
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