Skip to content

Remove large code duplication offenders - #751

Closed
gtryus wants to merge 1 commit into
developfrom
code-duplication-1
Closed

gtryus wants to merge 1 commit into
developfrom
code-duplication-1

Conversation

@gtryus

@gtryus gtryus commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

The desktop and mobile passage-resource lists each had about 1,500 lines of near-duplicate state, handlers and dialogs. Those now live in one hook and one dialogs component. Each view keeps only its own list layout and its text-resource viewer.

 Internalization/
-├── PassageDetailArtifacts.tsx          # 1571 lines: state + handlers + list + dialogs
-├── PassageDetailsArtifactsMobile.tsx   # ~1600 lines: same, mobile layout
+├── usePassageDetailArtifacts.ts        # 1295: Orbit data, state, handlers (shared)
+├── PassageDetailArtifactsDialogs.tsx   #  432: Uploader + every dialog (shared)
+├── PassageDetailArtifacts.tsx          #  183: desktop list
+└── PassageDetailsArtifactsMobile.tsx   #  183: mobile list

## Summary

The desktop and mobile passage-resource lists each had about 1,500 lines of near-duplicate state, handlers and dialogs. Those now live in one hook and one dialogs component. Each view keeps only its own list layout and its text-resource viewer.

```diff
 Internalization/
-├── PassageDetailArtifacts.tsx          # 1571 lines: state + handlers + list + dialogs
-├── PassageDetailsArtifactsMobile.tsx   # ~1600 lines: same, mobile layout
+├── usePassageDetailArtifacts.ts        # 1295: Orbit data, state, handlers (shared)
+├── PassageDetailArtifactsDialogs.tsx   #  432: Uploader + every dialog (shared)
+├── PassageDetailArtifacts.tsx          #  183: desktop list
+└── PassageDetailsArtifactsMobile.tsx   #  183: mobile list
@nabalone

nabalone commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

We still need to fully merge the two using the new design. https://jira.sil.org/browse/TT-7723. This refactor will no longer be necessary after that.

@nabalone nabalone closed this Oct 9, 2026
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