Skip to content

Comments

feat(web): seed demo data#1466

Merged
tyler-dane merged 10 commits intomainfrom
feat/1444-seed-data
Feb 20, 2026
Merged

feat(web): seed demo data#1466
tyler-dane merged 10 commits intomainfrom
feat/1444-seed-data

Conversation

@tyler-dane
Copy link
Contributor

@tyler-dane tyler-dane commented Feb 20, 2026

closes #1444 and #1128

  • Added a new utility function, prepareEmptyStorageForTests, to streamline the test setup process by clearing localStorage and IndexedDB, and setting a migration flag to prevent demo data seeding.
  • Updated multiple test files to utilize this new utility, enhancing consistency and reducing redundancy in test initialization.
  • Refactored existing tests to ensure they correctly prepare the storage state before each test, improving reliability and maintainability.

- Introduced a new migration for seeding demo data for first-time users, including events and tasks with sensible defaults.
- Updated storage migration tests to accommodate new localStorage keys and ensure proper handling of migration flags.
- Added comprehensive tests for the demo data seed migration to verify correct data population and behavior under various conditions.
- Refactored existing migration tests to improve clarity and maintainability.
- Eliminated the createDefaultSomedays method from EventService to streamline event management.
- Updated UserService to remove calls to createDefaultSomedays during user initialization, focusing on priority creation instead.
- Adjusted related tests to reflect the removal of default someday events, ensuring consistency in user data setup.
…etup

- Added a new utility function, prepareEmptyStorageForTests, to streamline the test setup process by clearing localStorage and IndexedDB, and setting a migration flag to prevent demo data seeding.
- Updated multiple test files to utilize this new utility, enhancing consistency and reducing redundancy in test initialization.
- Refactored existing tests to ensure they correctly prepare the storage state before each test, improving reliability and maintainability.
Copilot AI review requested due to automatic review settings February 20, 2026 00:02
@tyler-dane tyler-dane changed the title feat(web): seed data feat(web): seed demo data Feb 20, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements demo data seeding for first-time users to improve onboarding, addressing issue #1444. Instead of showing an empty interface, new users now see pre-populated tasks and events with helpful instructions on using the app.

Changes:

  • Added a migration-based demo data seeding system that populates sample events and tasks for first-time users
  • Moved default someday event creation from backend to frontend (web package)
  • Created a test utility (prepareEmptyStorageForTests) to prevent demo data seeding during tests

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/web/src/common/storage/migrations/external/demo-data-seed.ts New migration that seeds demo data (events and tasks) for first-time users with relative dates
packages/web/src/common/storage/migrations/external/demo-data-seed.test.ts Comprehensive tests for demo data seeding migration
packages/web/src/common/storage/migrations/migrations.ts Registers the new demo data seed migration
packages/web/src/common/storage/migrations/migrations.test.ts Updates migration tests to handle the new demo data seed flag
packages/web/src/tests/utils/storage/indexeddb.test.util.ts Adds prepareEmptyStorageForTests utility to clear storage and prevent demo seeding in tests
packages/web/src/views/Day/view/DayViewContent.test.tsx Updates to use new test utility and refactors task addition helper
packages/web/src/views/Day/context/tests/TaskContext.test.tsx Updates to use new test utility
packages/web/src/views/Day/components/Tasks/Tasks.test.tsx Updates to use new test utility
packages/web/src/views/Day/components/ContextMenu/TaskContextMenu.test.tsx Updates to use new test utility and adds test timeout
packages/web/src/common/utils/shortcut/shortcut.util.tsx Adds getModifierKeyLabel function for user-friendly modifier key display
packages/web/src/index.tsx Adds console.debug statement (appears unrelated to PR purpose)
packages/backend/src/user/services/user.service.ts Removes backend default someday events creation
packages/backend/src/user/services/user.service.test.ts Updates tests to reflect removed backend someday events
packages/backend/src/event/services/event.service.ts Removes createDefaultSomedays method

…djust event counts

- Added an all-day event titled "Deep work day" to the demo data seed, enhancing the variety of events generated for testing.
- Updated the expected event count in tests to reflect the addition of the new all-day event, ensuring accurate verification of event creation.
- Adjusted documentation to clarify the changes in the demo data structure, including the new all-day event and updated counts for today’s events.
- Removed detailed descriptions of demo data contents from the migration documentation to streamline the information presented.
- Updated the demo data seed migration to maintain clarity while focusing on essential details for first-time users.
Copilot AI review requested due to automatic review settings February 20, 2026 00:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

…ag updates

- Introduced a new utility function, createMockStorageAdapter, to streamline the creation of mock storage adapters for testing.
- Updated existing tests to utilize the new mock adapter, improving consistency and reducing redundancy in test setup.
- Refactored migration tests to replace hardcoded migration flag keys with the new DEMO_DATA_SEED_FLAG_KEY, ensuring clarity and maintainability.
- Enhanced the demo data seed migration to utilize the updated flag key, aligning with recent changes in the storage architecture.
…data seed

- Introduced a new test case to verify the creation of timed events with 15-minute-aligned times in RFC3339 offset format, ensuring no seconds or milliseconds are included.
- Updated the demo data generation logic to align with the new event format, enhancing the consistency and accuracy of the demo data for testing purposes.
- Adjusted existing event creation functions to ensure proper handling of time formatting, improving overall data integrity.
- Added `isAllDay` and `isSomeday` properties to multiple events in the demo data seed, ensuring more accurate representation of event types.
- Renamed an event from "Catch up with a friend" to "Call a friend" and added a description for clarity.
- Updated the demo data generation logic to improve the variety and detail of events for testing purposes.
…imed events

- Added a new test case to verify that default grid position data is correctly added to seeded timed events, ensuring proper layout handling.
- Updated the demo data generation logic to include grid event assembly for timed events, improving the accuracy of event positioning in the demo data.
- Enhanced existing event descriptions to provide more context for testing scenarios.
- Added a new test case to ensure seeded events conform to their respective schemas, validating both grid and core event structures.
- Updated the demo data generation logic to include position data for timed events, improving layout accuracy in the demo data.
- Enhanced event descriptions for clarity in testing scenarios, ensuring better context for validation checks.
Copilot AI review requested due to automatic review settings February 20, 2026 01:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

@tyler-dane tyler-dane merged commit b992652 into main Feb 20, 2026
9 checks passed
@tyler-dane tyler-dane deleted the feat/1444-seed-data branch February 20, 2026 01:58
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.

Initialize tasks/events/someday events that explain the onboarding

1 participant