For the complete documentation index, see llms.txt. This page is also available as Markdown.

Phase 7: Cleanup

← Back to Index

Effort: 1-2 hours Risk: Low Priority: Required (after toggle has been defaulted to ON) Previous: Phase 6: Duplicate Index Calls

Goal

Clean up feature flag infrastructure after successful adoption. Remove legacy code, rename refactored files, and finalize the implementation.

When to Do This

Only after:

  • Toggle defaulted to ON for 1+ week and PM approved

  • No issues reported

  • All metrics stable

  • Team confidence is high

Steps

5.1 Remove Feature Flag

File: toggles/webapp/app/toggles.ts

// DELETE:
iiifViewerRefactored: {
  id: 'iiifViewerRefactored',
  title: 'IIIF Viewer - Refactored Context',
  defaultValue: false,
  description: 'Use refactored ItemViewerContext with centralised derived values',
},

5.2 Delete Legacy Files

Also remove types that are not in use anymore.

5.3 Rename Refactored Files to Standard Names

5.4 Delete Wrapper Component

5.5 Rename Context

5.6 Update All Imports

Replace all occurrences of ItemViewerContextV2 with ItemViewerContext:

5.7 Remove Unused Props

Identify components that can drop props now that context provides the data:

5.8 Update Tests

Rename test files and update imports:

5.9 Type Cleanup

Ensure all TypeScript types reflect the final context shape. Remove any temporary types used during migration.

5.10 Documentation

Success Criteria

Time: 1-2 hours


The IIIF Viewer context refactoring is complete!

See also:

Last updated