Skip to content

refactor: move collection reactions into store integration#556

Merged
hhhjin merged 1 commit into
mainfrom
codex/store-collection-integration
Apr 7, 2026
Merged

refactor: move collection reactions into store integration#556
hhhjin merged 1 commit into
mainfrom
codex/store-collection-integration

Conversation

@hhhjin
Copy link
Copy Markdown
Member

@hhhjin hhhjin commented Apr 7, 2026

Summary

  • move workspace-to-collection coupling behind typed store events and a dedicated collection integration
  • emit narrow workspace tree events for entry replacement, create, delete, rename, and move operations
  • update store tests to assert event emission and integration behavior instead of direct collection port calls

Review

  • review gate found no actionable issues in the published scope

Testing

  • pnpm lint:fix
  • pnpm --filter @mdit/store test
  • pnpm --filter @mdit/store ts:check

Notes

  • excluded local untracked notes under todos/ from this PR scope

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the collection management logic to use an event-driven architecture, replacing direct port calls with workspace event emissions. It introduces a new integration to handle events such as entry creation, deletion, renaming, and moving, while updating the collection slice to correctly process file-level changes. Feedback highlights a potential race condition due to unawaited event emissions in the tree actions and suggests aligning the onEntryCreated method signature with other event handlers for consistency.

Comment thread packages/store/src/workspace/tree/actions.ts
Comment thread packages/store/src/collection/collection-slice.ts
@hhhjin hhhjin merged commit 71153bd into main Apr 7, 2026
3 checks passed
@hhhjin hhhjin deleted the codex/store-collection-integration branch April 7, 2026 13:07
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