Skip to content

Improve apps import connector status cards#6366

Merged
kodjima33 merged 1 commit into
mainfrom
codex/apps-imports-sync-status-ui
Apr 6, 2026
Merged

Improve apps import connector status cards#6366
kodjima33 merged 1 commit into
mainfrom
codex/apps-imports-sync-status-ui

Conversation

@kodjima33
Copy link
Copy Markdown
Collaborator

Summary

  • improve the Apps imports cards to surface real connector sync counts and freshness
  • persist connector source/memory metrics and show actionable connected states
  • fix the Apps-page crash by resolving bundled connector logos from the installed app resource bundle

Verification

  • agent-swift connect --bundle-id com.omi.desktop-dev
  • agent-swift click @e12 to open Apps successfully without crashing
  • verified Omi Dev stayed alive and rendered import cards with sync status

@kodjima33 kodjima33 merged commit 73afbf1 into main Apr 6, 2026
3 checks passed
@kodjima33 kodjima33 deleted the codex/apps-imports-sync-status-ui branch April 6, 2026 20:56
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 6, 2026

Greptile Summary

This PR improves the import connector cards on the Apps page by surfacing real sync counts, freshness timestamps, and actionable connected states, and fixes the Apps-page crash by correctly resolving connector logos from the installed app resource bundle. The persistence logic in ImportConnectorStatusStore is solid for all numeric metrics; the only gap is that availabilityText (e.g. "Imported manually" for chatgpt/claude) is not written to UserDefaults and is therefore lost on app restart.

Confidence Score: 4/5

Safe to merge; no blocking defects — the unpersisted availabilityText is a cosmetic regression limited to chatgpt/claude secondary labels after restart.

One P2 data-persistence gap (availabilityText not written to UserDefaults) and one redundant computation; all other metrics are correctly persisted, the crash fix is solid, and the isConnected state remains accurate.

desktop/Desktop/Sources/MainWindow/Pages/AppsPage.swift — review the availabilityText persistence gap in markSynced().

Important Files Changed

Filename Overview
desktop/Desktop/Sources/ConnectorBrandIcon.swift Introduces a multi-strategy bundle search (allBundles + allFrameworks + .bundle subdirectory scan) to resolve connector logos from the installed app resource bundle, fixing the Apps-page crash.
desktop/Desktop/Sources/MainWindow/Pages/AppsPage.swift Adds ImportConnectorStatusStore with UserDefaults-backed metrics and live DB queries; minor gap: availabilityText is never persisted and is lost across app restarts for chatgpt/claude connectors.

Sequence Diagram

sequenceDiagram
    participant U as User
    participant AP as AppsPage
    participant SS as ImportConnectorStatusStore
    participant UD as UserDefaults
    participant DB as RewindDatabase
    participant SVC as AppleNotesReaderService

    U->>AP: Opens Apps page
    AP->>SS: .task { await refresh() }
    SS->>DB: SELECT COUNT(*), MAX(indexedAt) FROM indexed_files
    DB-->>SS: (count, lastIndexedAt)
    SS->>SS: metricsByID["local-files"] = updated
    SS->>SVC: readRecentNotes(maxResults: 250)
    SVC-->>SS: notes array
    SS->>SS: metricsByID["apple-notes"] = updated
    SS-->>AP: @Published metricsByID triggers re-render

    U->>AP: Taps connector card
    AP->>AP: selectedConnector = connector
    AP->>U: Shows ImportConnectorSheet

    U->>AP: Taps sync button
    AP->>SS: markSynced(connectorID, sourceCount, memoryCount, lastDeltaCount)
    SS->>UD: set(sourceCount) + set(memoryCount) + set(lastSyncedAt) + set(lastDeltaCount)
    SS->>SS: metricsByID[connectorID] = updated
    SS-->>AP: @Published triggers card re-render with new snapshot
Loading

Reviews (1): Last reviewed commit: "Improve apps import connector status car..." | Re-trigger Greptile

Comment on lines +812 to +813
if let availabilityText = metrics.availabilityText, availabilityText != primaryText(for: connector, metrics: metrics, isConnected: isConnected) {
return availabilityText
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 secondaryText recomputes primaryText redundantly

primaryText(for:metrics:isConnected:) is called a second time here purely to avoid echoing it as the secondary label. Since snapshot(for:) already computes both values separately, the duplicated call adds unnecessary work on every card render and creates a maintenance coupling — any future change to primaryText must be mirrored in this comparison to keep the dedup working. Consider passing the already-computed primary text in as a parameter to secondaryText.

Comment on lines +664 to +667
}
if let availabilityText {
metrics.availabilityText = availabilityText
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 availabilityText is not persisted to UserDefaults

Every other metric (sourceCount, memoryCount, lastSyncedAt, lastDeltaCount) is written to UserDefaults with a keyed prefix, but availabilityText is only stored in the in-memory metricsByID dict. On the next app launch, load() won't restore it (it only has a special-case for apple-notes via appleNotesFolderDefaultsKey). For chatgpt/claude connectors the secondary label "Imported manually" will silently disappear after a restart. isConnected stays correct because memoryCount is persisted, but the attribution text is lost. Adding a availabilityTextKeyPrefix parallel to the other prefixes would fix it.

Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
## Summary
- improve the Apps imports cards to surface real connector sync counts
and freshness
- persist connector source/memory metrics and show actionable connected
states
- fix the Apps-page crash by resolving bundled connector logos from the
installed app resource bundle

## Verification
- `agent-swift connect --bundle-id com.omi.desktop-dev`
- `agent-swift click @e12` to open Apps successfully without crashing
- verified Omi Dev stayed alive and rendered import cards with sync
status
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