Skip to content

Consolidate case-workspace navigation and fix duplicate migration collisions - #104

Merged
mycomind4-arch merged 1 commit into
mainfrom
fix/nav-consolidation-and-migration-dupes
Sep 11, 2026
Merged

mycomind4-arch merged 1 commit into
mainfrom
fix/nav-consolidation-and-migration-dupes

Conversation

@mycomind4-arch

Copy link
Copy Markdown
Owner

Navigation/panel cleanup

  • Removed the dead /investigation/[id] duplicate page — nothing in the app linked to it, and its graph view was already superseded by CaseGraphPanel. It now redirects to /project/[id]?section=graph (new ?section= deep-link support added to the project page) so old bookmarks keep working.
  • Fixed double-mounted content: DefenseBuilderPanel/BriefGeneratorPanel were each reachable through two different nav paths showing identical content. Removed the LegalAnalysisPanel middleman that caused it; moved Legal Library into Defense & Response where it's actually used.
  • AuthorityEnforcementPanel: CodeEnforcementPanel was mounted at two different sub-tabs with identical content — collapsed to one.
  • Removed the redundant direct nav entries for "Records Request" and "Respond to Notice" — both already live as cards in the Workflows catalog, which is the intended guided entry point.
  • Deleted TimelineList.tsx, orphaned by the investigation-page redirect.

Migration fix

Migrations 016/020 both CREATE TABLE IF NOT EXISTS case_communications, and 017/021 both do the same for mailmypdf_webhook_events. Since the earlier-numbered file always applies first, the later file's intended schema silently never took effect — in particular, 021 meant to relax mailmypdf_webhook_events.communication_id to nullable/no-FK, but 017's stricter NOT NULL REFERENCES version is what's actually live.

Added 029_reconcile_duplicate_migrations.sql (new forward migration, existing files left untouched since they may already be applied to production D1):

  • Rebuilds mailmypdf_webhook_events with the intended relaxed schema, preserving existing rows.
  • Collapses case_communications' inconsistent duplicate indexes to one canonical set.

Verified directly against a real SQLite instance seeded to match the deployed schema (016 → 017 → seed rows → 029): data survives the rebuild, the relaxed constraint actually takes effect, and the migration is safely re-runnable.

🤖 Generated with Claude Code

…lisions

Navigation/panel cleanup:
- Kill the dead-page duplicate: /investigation/[id] now redirects to
  /project/[id]?section=graph (nothing linked to it anymore; its graph view
  was already superseded by CaseGraphPanel). Added ?section= deep-link
  support to the project page for this.
- Fix double-mounted content: DefenseBuilderPanel and BriefGeneratorPanel
  were each reachable via two different nav paths showing identical
  content (Defense & Response, and hidden sub-tabs inside
  LegalAnalysisPanel reached through Analysis > Findings). Removed the
  LegalAnalysisPanel middleman; moved Legal Library to Defense & Response
  where it's actually used.
- AuthorityEnforcementPanel: CodeEnforcementPanel was mounted at two
  different sub-tabs with identical content; collapsed to one.
- Removed the redundant direct nav entries for "Records Request" and
  "Respond to Notice" — both already live as cards in the Workflows
  catalog, which is the intended guided entry point for named workflows.
- Deleted TimelineList.tsx, orphaned by the investigation-page redirect.

Migration fix:
- 016/020 both create `case_communications` and 017/021 both create
  `mailmypdf_webhook_events` via CREATE TABLE IF NOT EXISTS. Since the
  earlier-numbered file always applies first, the later file's intended
  schema silently never took effect on any database where the earlier one
  already ran — in particular, 021 meant to relax
  mailmypdf_webhook_events.communication_id to nullable/no-FK, but 017's
  stricter version was what was actually live.
- Added 029_reconcile_duplicate_migrations.sql: rebuilds
  mailmypdf_webhook_events with the intended relaxed schema (data
  preserved), and collapses case_communications' inconsistent duplicate
  indexes to one canonical set. Verified against a real SQLite instance
  seeded to match the deployed schema: data survives the rebuild, the
  relaxed constraint actually takes effect, and the migration is safely
  re-runnable.
- Left 016/017/020/021 untouched — those may already be applied against
  production D1, and D1 tracks applied migrations by filename, so fixing
  forward with a new migration is the safe path rather than editing
  migration history in place.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mycomind4-arch
mycomind4-arch merged commit 5841f93 into main Sep 11, 2026
1 of 2 checks passed
@mycomind4-arch
mycomind4-arch deleted the fix/nav-consolidation-and-migration-dupes branch September 11, 2026 21:49
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.

2 participants