Skip to content

refactor(apps): remove ~8,300 lines from the remaining 13 apps and fix their bugs - #661

Merged
MrYuion merged 10 commits into
refactor/apps-cleanupfrom
refactor/remaining-apps-cleanup
Nov 2, 2026
Merged

MrYuion merged 10 commits into
refactor/apps-cleanupfrom
refactor/remaining-apps-cleanup

Conversation

@MrYuion

@MrYuion MrYuion commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

#660 cleaned six apps. The other 13 apps had the same kinds of problems: dead code (most of it the outlook add-in's legacy booking flow), signage player rules copied into the signage manager that had started to disagree, copied app setup and config, and a set of user-visible bugs.

Stacked on #660; review that first.

Solution

One commit per block, so each can be reviewed alone. The branch removes about 15,500 lines and adds about 7,200.

  • Bug fixes.
    • Signage: the animation time setting never reached the CSS transition.
    • Stagehand: a failed load could leave a progress bar running forever, or let an editor save over a different dashboard or alert. A redirect could fire after you had left the page.
    • Assistant panel: the chat ignored the system chosen at setup.
    • Chat: messages sent after the chat closed were lost, and the progress details never opened. A message that cannot be sent now shows an error and stays in the input.
    • Enrolment: a failed check-in kept "Checking you in..." on screen forever.
    • Caterer UI: the landing tile images were missing.
    • App loader: the app grid layout was lost in 29e8244.
    • Map Studio: rotating a rotated object made it jump. Floors traced from an image showed misplaced objects in the kiosk. Only the first 100 systems loaded.
    • Signage Manager: counts showed "1 items", and two pickers showed "empty" when their load failed.
  • Dead code.
    • Outlook add-in: the legacy booking flow. The manifest only opens #/calendar. Removing it also drops the add-in's imports of workplace source.
    • Stagehand: time conditions. The type select was always disabled, so users could never add one; saved time conditions are kept on save.
    • Unused components and members in stagehand, map-studio, signage-manager and the small apps.
  • Shared signage rules. The cron rules, schedule mask check, play-once parsing and template layout now live in libs/common/src/lib/signage/. The manager could call a schedule playable when the player would not play it; it now uses the player's rules.
  • Shared app setup.
    • Assistant panel uses the shared system setup screen.
    • 13 apps share one test setup.
    • 8 more apps use shared/ngsw-config.json, which adds the S3 image cache to enrolment, outlook add-in, survey and timetable.
    • 13 apps now reload on chunk load errors.
  • Lib helpers in place of app copies. themedLogo, withTimeout, errorMessage, mapWithLimit, parseJWT, firstTruthyValueFrom, and the catering dialogs, which move into CateringStateService.
  • Signage Manager.
    • One tab bar, section header, playlists panel, status badge, group members card and picker modal replace the copies.
    • Display and zone services share playlist assignment.
    • One translated schedule summary replaces the English-only copy.
    • One confirm helper handles the remove flows.
    • Change keys are counters now; two changes in the same millisecond were lost.
  • Stagehand, Map Studio, Public.
    • Stagehand: one page layout and one URL filter handler.
    • Map Studio: one bookable check, one bounds helper and one image loader. Validation runs on the objects in memory.
    • Public: shared query helpers; registration and save failures no longer leave unhandled rejections.

Behavior changes

  • Assistant panel.
    • It gains the MDM system override, and its search waits for the organisation to load.
    • Mock mode now works; before, it stopped on "Error loading organisation data".
  • Service worker caching. All apps on the shared config also cache jpeg, apng and avif images.
  • Signage Manager badges. They use one colour set. The playlist sidebar's "Approval required" badge goes from orange to grey, to match the main lists.
  • Signage Manager schedule summaries.
    • They are translated, and list times follow the 24-hour setting.
    • Intervals no longer include the play length, as the form's hourly summary already did.
  • Signage Manager confirms.
    • Removes now show progress and can't be dismissed mid-request.
    • Undoing playlist changes now asks for confirmation.
  • Stagehand.
    • On a cold start, an unknown ?region= id is now ignored.
    • A failed load shows an error notice.
  • Map Studio.
    • A failed level query no longer stops the other sync batches.
    • A circle with no radius uses 12 everywhere.

Not done

  • Not merged. The two pairs of signage-manager approval modals (different content types), and the map-studio colour tables that differ in every colour.
  • Follow-ups.
    • Map-studio group rotate still uses a fixed start angle.
    • TEMPLATE_REVERT_CONFIRM exists only in en-AU.
    • SCHEDULE_MASK_SUMMARY has no translations.
    • The libs/common/src/test-storage.ts setupFiles entry is redundant.

Verification

  • nx affected -t test,build passes for 30 projects. Later review fixes were re-checked with stagehand and signage-manager test and build runs.
  • oxlint and ESLint (templates) are clean. The e2e typecheck and tools/ngsw-config.test.js pass.
  • New focused specs for the bugs. Each fails without its fix.

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

Changes made by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, running in T3 Code. Claude subagents ran the audit and wrote most blocks. GPT-6.1 Sol (Codex) reviewed each block.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
frontend-templates Ignored Ignored Preview Nov 2, 2026 9:02pm UTC

@MrYuion MrYuion left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

🤖 Claude Opus 5.5 responding on behalf of Alex

The removals and bug fixes check out. I found one small issue, noted inline.

What I checked:

  • Removed code: I looked for remaining imports, routes, lazy loadComponent paths, BOOKING_URLS and the removed locale keys (including COMMON. keys built at runtime). Nothing still points at removed code. The outlook add-in still redirects ** to calendar, and the assistant panel keeps its PLACEOS.ASSISTANT.system store key.
  • Bug fixes: the signage --transition-duration, map-studio rotate start angle, _requestAll paging, enrolment check-in errors, stagehand load guards and redirect, assistant panel setBinding, and the catering asset paths are all correct.
  • Shared signage rules: libs/common/src/lib/signage/cron.ts and playlist.ts match the old player logic. The player still throws on a cron that does not have five fields.
  • Builds: nx affected -t test,build passed for all 30 projects (base 130dd62ce2). oxlint and ESLint have 0 errors. e2e:typecheck and tools/ngsw-config.test.js pass.

const current = this._socket;
if (!current || current.readyState >= WebSocket.CLOSING) {
this._cleanup(current);
this.startChat();

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

🤖 Claude Opus 5.5 responding on behalf of Alex

If startChat() returns early, there is no socket. The message still shows as sent and the input clears, but nothing goes out. startChat() returns early when _chat_system() is '': a building with no chat_room binding and no setBinding, or an org that has not initialised. chat.enabled alone shows the chat in several apps, so the user can type into a chat that cannot connect.

Before this PR, the component retried every 100 ms forever. That was worse, but it kept the text in the input. Suggest you check this._socket after startChat(). If it is still unset, show an error and return false before the message is added, and let ChatComponent.sendMessage clear the input only on success.

A smaller case: the socket can error before open, for example on an auth failure. Then the once listener never fires, and the message is lost with no error.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

🤖 Claude Opus 5.5 responding on behalf of Alex Sorafumo

Fixed in 4b945ac. After startChat(), sendMessage checks the socket. If there is none, it shows an error, adds nothing to the chat and returns false. ChatComponent.sendMessage clears the input only when the send returns true.

For the smaller case: when the socket is still connecting, sendMessage also listens for close. A socket that fails before open always fires close, so the error shows. The open listener removes the close listener before it sends. The new error text is APP.WORKPLACE.CHAT_SEND_FAILED in all 11 locale files. Specs cover all three paths. The two failure specs fail without the fix.

@MrYuion
MrYuion force-pushed the refactor/apps-cleanup branch from 130dd62 to 7b19761 Compare November 2, 2026 21:01
…apps

- Signage: the animation time setting now reaches the CSS transition.
- Stagehand: failed loads clear the progress bar and show an error. The
  editors do not save over another dashboard or alert after a failed
  load, and leaving during a load does not redirect.
- Stagehand: missing translation keys and the post-save route are fixed.
- Assistant panel: the chat binds to the system chosen at setup.
- Chat: sending reopens a closed chat; the info toggle works.
- Enrolment: a failed check-in no longer leaves the spinner forever.
- Caterer UI: the landing tile images are in shared assets.
- App loader: the app grid layout is back.
- Redirect: the ellipsis animation is only on the redirect message.
…counts

- Map Studio: rotating a rotated object no longer jumps.
- Map Studio: floors traced from an image store the image size, so the
  kiosk places objects like the editor.
- Map Studio: systems load with paging, not only the first 100.
- Signage Manager: item counts use the plural form, and two picker
  modals show a load error with retry.
- Outlook add-in: remove the legacy booking flow. The manifest only
  opens the calendar pane. This also removes the imports of workplace
  source.
- Stagehand: remove time conditions (users could not add them), unused
  dashboard components and routes, and dead members.
- Map Studio: remove unused version history, CSV import/export, editor
  mode and other members.
- Signage Manager: remove unused translation keys and a dead fallback.
- Remove small dead members in signage, enrolment, survey, redirect,
  assistant panel and caterer UI.
The cron rules, schedule mask check, play-once parsing, media animation,
template layout and preview message names move to
libs/common/src/lib/signage. The signage manager now uses the player's
rules, so it no longer calls a schedule playable when the player will
not play it.
- Assistant panel uses the shared system setup screen. The shared screen
  waits for the organisation before it searches.
- 13 apps share one test setup.
- 8 more apps use shared/ngsw-config.json, which adds the S3 cache to
  enrolment, outlook add-in, survey and timetable.
- 13 apps reload on chunk load errors.
- Small config fixes in outlook add-in, survey, signage, caterer UI,
  app loader, enrolment and timetable.
Use themedLogo, withTimeout, errorMessage, mapWithLimit, parseJWT and
firstTruthyValueFrom from the libs. The catering availability and charge
code dialogs move to CateringStateService for caterer UI and concierge.
One tab bar with keyboard support, one section header, one assigned
playlists panel, one playlist status badge, one group members card and
one picker modal shell replace the copies. Status badges use one colour
set.
- Display and zone services share playlist assignment.
- Playlist undo has a confirm step, like template undo.
- One translated schedule summary replaces the English-only copy. Times
  follow the app's 24-hour setting.
- One confirm helper for removes shows progress and always closes.
- Change keys are counters, so two changes in one millisecond are not
  lost.
- Stagehand: one page layout, one URL filter handler, one nav list.
- Map Studio: one bookable check, bounds helper, image loader and
  validation on the objects in memory.
- Public: shared query helpers; registration and save failures no longer
  leave unhandled rejections.
If no chat system is set, the chat cannot connect. sendMessage now shows
an error and returns false, and the chat keeps the text in the input.
An error also shows if the connection closes before it opens.
@MrYuion
MrYuion force-pushed the refactor/remaining-apps-cleanup branch from c34f640 to 4b945ac Compare November 2, 2026 21:02
@MrYuion
MrYuion merged commit 1e60633 into refactor/apps-cleanup Nov 2, 2026
20 of 46 checks passed
@MrYuion
MrYuion deleted the refactor/remaining-apps-cleanup branch November 2, 2026 23:05
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