Repository navigation
refactor: reduce complexity in the top fallow refactoring targets - #556
Merged
Merged
Conversation
|
Deployment failed for project frontend-templates with the following error: Learn More: https://vercel.com/placeos?upgradeToPro=build-rate-limit |
Split large services and utility files along cohesive seams, extract complex functions into named helpers, and remove duplicated logic. Public library APIs do not change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
MrYuion
force-pushed
the
t3/refactor-top-fallow-targets
branch
from
October 8, 2026 05:02
bcc15f2 to
399b811
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fallow health --targetslists ten files as the top refactoring targets. Most are large services or utility files with many dependents. The others have one very complex function. Changes to these files are slow to review and easy to break.Changes
Each file is split where its concerns separate, or its complex function is broken into named helpers. Duplicated logic is removed where it was found. Public library APIs do not change, and the specs did not need behaviour changes.
bookings/booking-form.service.tspostForminto steps (cognitive 63 → 27).events/event-form.service.tsevent-save.fn.tsandevent-form-changes.ts(1618 → 1350 LOC).postForm)catering/catering-order-tools.tscatering-order-details.ts.bookings/booking.utilities.tsbooking-form.model.ts(596 → 251 LOC).explore/explore-parking.service.tsbook_fninto methods. Share one booking rules loader with the desk and space services.concierge/desks-state.service.tseditDeskinto helpers (cognitive 34 → 12).bookings/booking-card.component.tscommon/types/booking.class.tsconcierge/room-management.service.tsevents/utilities.tsevent-form.ts(435 → 159 LOC).Some of the remaining complexity is long lists of field defaults (
x || ''), for example in theBookingconstructor andbookingFormValue. These were not split, because a split would change the score and not make the code simpler.Review notes
editDesknow has anas unknown as PlaceZonecast. The old code already passed aBuildingLevelthere, and the untyped modal value hid this.Verification
bookings,events,catering,explore,common,conciergeandworkplace.stagehandfails its 1.40 MB initial bundle budget by about 1 kB.developfails the same way without this change.Bookingconstructor refactor was compared against the old constructor with 4000 generated inputs. All field values and key order matched.develop, including fix(bookings): store the flow type on a quick-book booking #546 (booking type fix) and fix(bookings): leave approval to the backend for users who cannot approve #548 (currentUserCanApprovecheck). These changes now live in the moved code. Both approval checks are kept inbooking-form.service.ts, and the new specs for both PRs pass.localproject passes 13/13 against the isolated stack (e2e/stack/up.sh). All mock suites were run with the proxy set to a closed local port. Workplace, caterer-ui, outlook-addin, survey, map-kiosk, assistant-panel, enrolment, timetable and redirect pass. Booking-panel, visitor-kiosk, control, stagehand, signage and signage-manager fail the same tests ondevelopwithout this change. Concierge's Firefox project could not start the browser on this machine, anddevelopgives the same result. Its Chromium and WebKit tests pass.Changes made by Claude Opus 5.5 (1M context) in Claude Code, running in T3 Code.
🤖 Generated with Claude Code