Skip to content

refactor: remove about 4,700 lines of dead and duplicated code - #334

Merged
MrYuion merged 9 commits into
developfrom
refactor/simplify-and-dedupe
Nov 1, 2026
Merged

MrYuion merged 9 commits into
developfrom
refactor/simplify-and-dedupe

Conversation

@MrYuion

@MrYuion MrYuion commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

The app had a lot of dead code and logic copied between pages: nine copies of the feature page layout, four copies of group membership handling, eleven copies of the form submit flow, and repeated admin confirm and domain picker code. This PR removes or shares it. App code drops by about 4,700 lines.

Each commit is one block and builds and passes unit tests on its own:

  1. Remove unused files and dependencies: the 1,259-line timezone table is now Intl.supportedValuesOf, plus 10 unused packages. js-yaml is now declared with types.
  2. Remove dead members, unused pipes and unused simple-table options.
  3. Behaviour change: re-enable Create new from and Duplicate in the item menu. Both were disabled since 2022. Triggers cannot be copied, and Duplicate is hidden for users, domains and repositories, because their unique fields need an edit. This commit also fixes the mobile list "load more" check, a double trigger reload, and a confirm dialog that never settled on cancel.
  4. One item-shell for the nine feature pages.
  5. One groupMembership() helper and tab for group users, group zones, user groups and zone groups.
  6. submitFormDialog, mergeFormItem and onSaveHotkey for the eleven item forms.
  7. Admin: confirmAndRun, a shared domain picker, and the upload library on simple-table. Its sort and search persist across navigation, and the first click now sorts ascending like every other table.
  8. One route guard factory, waitForDialog, shared timestamp rows and metadata tab.

Not done on purpose: removing AsyncHandler (its named timers cancel earlier ones, and many calls rely on that), and merging the mock data and mock handlers (their shapes differ and e2e seeds them directly).

Checks: lint, 991 unit tests and the production build pass. Chromium and mobile Chrome e2e (161 tests) pass. Firefox could not launch on the local machine, on develop too.

Reviewed with sol-loop: 11 rounds with gpt-6.1-sol on xhigh. Sol verdict: approved.

Created with Claude Opus 5.5 in Claude Code, with review by GPT-6.1 Sol in Codex.

🤖 Generated with Claude Code

MrYuion and others added 8 commits October 30, 2026 20:19
Replace the 1,259-line timezone table with Intl.supportedValuesOf. Delete
the unused rich text input, the IE check and its page, and 10 unused
packages. Declare js-yaml with types; this dropped two strict options
that js-yaml 4 never supported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove inputs, outputs, getters and signals that nothing reads, the
sanitize and formatList pipes, unused simple-table selection, filter and
paging, the custom toSignal, and AsyncHandler from classes that never
used it. Delete the date field timezone code and its helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Create new from item and Duplicate item were disabled since 2022. Show
them with create permission. Triggers cannot be copied (their actions
and conditions do not survive a copy), and Duplicate is hidden for
users, domains and repositories (their unique fields need an edit).
Duplicate now opens the first copy. Restyle the duplicate modal with
Tailwind (its SCSS-style CSS did not apply).

Also fix the inverted load more check in the mobile item list, a double
trigger list reload after adding a trigger, and a remove extension
confirmation that never settled on cancel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The nine feature pages repeated the same layout: main menu, item list,
details header, tabs, add and bulk buttons and debug console. Move it
into ItemShellComponent; each feature keeps its tab list and options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Group users, group zones, user groups and zone groups each had their own
add, bulk add, remove and permission methods and a near-identical tab.
groupMembership() now builds the actions from one options object, and
GroupMembershipComponent renders the tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Eleven item forms repeated the same submit flow and hotkey setup. Add
submitFormDialog, mergeFormItem and onSaveHotkey to common/forms; each
form keeps its own payload rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add confirmAndRun for the confirm, run and notify flow copied across
admin pages, and AdminDomainSelectComponent for the six domain pickers.
Move the upload library to simple-table; its sort and search persist
across navigation. Merge the broker new and edit methods and reuse
mapLimit, getInvalidSignalFields and the chip helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the two route guard classes with one guard factory, add
waitForDialog for the repeated dialog race, and share the created and
updated rows and the metadata tab between item pages. Delete the old
composer system mockup that nothing reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 30, 2026

Copy link
Copy Markdown

Deployment failed for project backoffice with the following error:

Resource is limited - try again in 1 day (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/placeos?upgradeToPro=build-rate-limit

@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
backoffice Ready Ready Preview Nov 1, 2026 2:48am UTC

@MrYuion
MrYuion merged commit 33605a2 into develop Nov 1, 2026
4 of 6 checks passed
@MrYuion
MrYuion deleted the refactor/simplify-and-dedupe branch November 1, 2026 02:47

This branch was successfully deployed

1 active deployment
Preview — 3e61cc03 Deployed Nov 1, 2026 by vercel[bot]
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