Skip to content

fix(github): unify Work Item issue discussions - #744

Open
Harry19081 wants to merge 1 commit into
developfrom
dev/github-work-item-discussions
Open

fix(github): unify Work Item issue discussions#744
Harry19081 wants to merge 1 commit into
developfrom
dev/github-work-item-discussions

Conversation

@Harry19081

Copy link
Copy Markdown
Member

Problem

GitHub-synced Work Items used a separate local Discussion drill-in while regular GitHub Issue detail surfaces used the floating GitHub comment and status composer. Team Inbox, Work Management, Work Item tabs, chat panels, and Source Control also resolved overlapping issue, timeline, viewer, permission, and repository data independently. Project data-change events could invalidate unrelated reads, reload every project with every label/member set, or scan full Work Item collections for one open detail. Multiple mounted presentations could also run the same automatic orchestrator side effects.

Solution

Route every GitHub Issue detail host through one bounded per-Jotai-store coordinator keyed by non-secret auth identity, repository, and issue. GitHub-synced Work Item thread surfaces now omit local Discussion navigation and render the canonical floating GitHub composer; unresolved remotes do not expose a disabled dead composer.

Project data-change events now carry project and Work Item scope, cache invalidation fences only the affected scope, item events no longer fan out through the global project collection, and open Work Item details use one enriched-item Tauri read. Viewer lookup runs alongside repository discovery. Automatic review, stale-session checks, terminal lock release, and collaboration-org resolution are consolidated through single-owner or multicast lifecycle registries that release their entries after final unmount.

The resulting invariant is that one logical GitHub issue or Work Item has one shared read/coalescing identity and one owner for automatic side effects, regardless of how many presentation surfaces are mounted.

Potential risks

  • The new GitHub detail caches retain bounded warm data for short TTLs. Mutation paths explicitly invalidate or prime affected entries, and auth identity is re-resolved without retaining tokens.
  • Scoped project events depend on project slug and Work Item ID when available. Legacy, repository-only, and PM watermark events deliberately fall back to full invalidation for compatibility.
  • Automatic orchestrator effects now hand ownership between mounted surfaces. The handoff, action-claim, multicast cleanup, and final-entry removal paths have regression coverage.
  • A new read-only Tauri command is registered for one enriched Work Item. It reuses the existing scoped SQLite read and does not alter persistence or wire formats.
  • Visual desktop validation and screenshots were not produced because local desktop control was not authorized. The UI behavior is covered by component and integration tests.
  • Rollback is a normal revert of commit e604931; there are no migrations or destructive data changes.

Verification

  • pnpm exec vitest run across 20 focused UI, cache, GitHub detail, project event, and lifecycle files: 90 passed.
  • Additional GitHubIssuePanelView and AssignedWorkItemDetail integration run: 12 passed.
  • pnpm exec tsc --noEmit --pretty false: passed.
  • ESLint over every changed TypeScript and TSX file: passed.
  • cargo test --manifest-path src-tauri/Cargo.toml -p project_management --lib projects::io::work_items::: 101 passed.
  • cargo clippy --manifest-path src-tauri/Cargo.toml -p project_management --all-targets -- -D warnings: passed.
  • cargo check --manifest-path src-tauri/Cargo.toml -p project_management: passed.
  • cargo check --manifest-path src-tauri/Cargo.toml -p org2: passed.
  • rustfmt --edition 2021 --check on both changed Rust source files: passed.
  • git diff --check: passed.
  • Repository-wide cargo fmt --all --check remains red on unrelated pre-existing formatting outside this diff.

Audit

Performance verdict: pass by source and lifecycle tests. Issue-detail pages contain no repeating interval poller; the remaining stale-session grace timer is bounded and single-owner. Caches are entry-count and byte bounded, atom-family detail state is evicted after final release, project invalidation is scoped, and independent reads run in parallel. The existing two-second PM SQLite watermark remains unchanged as a cross-process CLI correctness safeguard.

Pre-commit hook ran. Total eslint: 2, total circular: 0
@Harry19081

Copy link
Copy Markdown
Member Author

@NeonForge could you please review this PR, especially the shared GitHub issue-detail ownership, scoped invalidation, cache lifecycle, and Work Item floating-comment behavior?

@sudomaggie
sudomaggie requested a review from Neonforge98 August 7, 2026 17:27
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