Skip to content

feat: add ability to archive data sources#1033

Merged
stevenle merged 4 commits intomainfrom
claude/add-data-source-archiving-2gxUj
Apr 15, 2026
Merged

feat: add ability to archive data sources#1033
stevenle merged 4 commits intomainfrom
claude/add-data-source-archiving-2gxUj

Conversation

@stevenle
Copy link
Copy Markdown
Member

Summary

This PR adds the ability to archive/unarchive data sources and introduces filtering capabilities to the data sources list. Archived data sources cannot be synced or published, and users can toggle between viewing active, unpublished, published, and archived data sources.

Key Changes

  • Archive/Unarchive Functionality: Added archiveDataSource() and unarchiveDataSource() methods to both the client and UI utilities, with corresponding UI controls in the edit page
  • Data Source Filtering: Implemented a segmented control filter on the data sources list page with four filter options:
    • Active (non-archived)
    • Unpublished (non-archived, not published)
    • Published (non-archived, published)
    • Archived
  • Status Badge Component: Created new DataSourceStatusBadge component to display the current status (Archived, Published, or Unpublished) with tooltips showing when and by whom the status was set
  • Archive Validation: Added checks to prevent syncing or publishing of archived data sources
  • UI Enhancements:
    • Added archive/restore icons and buttons to the edit data source page
    • Added status column to the data sources table
    • Added empty state message when no data sources match the selected filter
    • Integrated permission checks for archive operations (requires publish permissions)

Implementation Details

  • Archive/unarchive operations use Firestore server timestamps and track the user email of who performed the action
  • Filtering uses useMemo to efficiently compute filtered results based on archivedAt and publishedAt timestamps
  • Archive operations require the same permissions as publish operations (testCanPublish)
  • Archived data sources are excluded from sync and publish operations with appropriate error messages

https://claude.ai/code/session_016agqc7JYmfsw2as5dPMdwm

@stevenle stevenle requested a review from jeremydw April 15, 2026 00:56
@stevenle stevenle changed the title Add data source archiving and filtering functionality feat: add ability to archive data sources Apr 15, 2026
Copy link
Copy Markdown
Member

@jeremydw jeremydw left a comment

Choose a reason for hiding this comment

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

changes LGTM, wondering if we should have any sort of affordance or changed behavior when accessing a data source that's archived (log message?)

@stevenle
Copy link
Copy Markdown
Member Author

we should have a new mandate called "all your comments need to be in the form of a prompt"

let me ask claude to log a warning when accessing an archived data source.

claude and others added 4 commits April 15, 2026 08:42
Data sources can now be archived when no longer needed, mirroring the
existing release archive pattern. Archived data sources are hidden from
the default active view, and sync/publish operations are blocked for
archived sources (both client-side and server-side).

- Add archivedAt/archivedBy fields to DataSource interface (core + ui)
- Add archive/unarchive utility functions and RootCMSClient methods
- Block sync/publish on archived data sources
- Add archive/unarchive toggle button to EditDataSourcePage
- Add status filter (active/unpublished/published/archived) and status
  badge column to DataPage
- Disable sync/publish buttons for archived sources in the UI
RootCMSClient.getDataSource() and getFromDataSource() now emit a
console.warn when the requested data source is archived, so callers
have visibility that they may be reading stale or deprecated data
without breaking existing read flows.
@stevenle stevenle force-pushed the claude/add-data-source-archiving-2gxUj branch from f0ee843 to 03a32da Compare April 15, 2026 15:52
@stevenle stevenle merged commit 257bea1 into main Apr 15, 2026
1 check passed
@stevenle stevenle deleted the claude/add-data-source-archiving-2gxUj branch April 15, 2026 15:52
@github-actions github-actions Bot mentioned this pull request Apr 15, 2026
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.

3 participants