Commit Graph

634 Commits

Author SHA1 Message Date
simoleo89 361ab27853 feat(messenger): incoming typing state + outgoing typing action 2026-06-02 21:11:03 +02:00
simoleo89 7a2dac8759 docs(messenger): Phase 4 implementation plan — typing indicator
Two ephemeral packets: ConsoleTyping (client->server, 4087) relayed by
the emulator to the peer as FriendTyping (server->client, 4088). Client
sends typing-start once per burst + stop on idle/send/empty; shows
"X is typing..." with a 6s auto-expire. 1:1 only, no DB.
2026-06-02 20:52:37 +02:00
simoleo89 8ae48005f3 fix(messenger): reliably send mark-read on thread focus via latest-value ref 2026-06-02 20:37:20 +02:00
simoleo89 775e8b27af feat(messenger): render sent/read checkmarks on own messages 2026-06-02 20:25:03 +02:00
simoleo89 ef60aa8ebd feat(messenger): send mark-read on focus, mark own messages read on receipt 2026-06-02 20:19:38 +02:00
simoleo89 f5e179f6c9 feat(messenger): SENT/READ status on thread chats + mark-read helper 2026-06-02 20:16:08 +02:00
simoleo89 f9c65000bd docs(messenger): Phase 3 implementation plan — read receipts
2-state read receipts (sent / read) via two custom packets:
MarkConsoleRead (client->server, header 4085) sent on thread focus,
relayed by the emulator to the peer as ConsoleReadReceipt (server->
client, header 4086). Client marks own messages READ and renders
checkmarks. Live-relay only (no DB table / login batch) since the
client doesn't persist message history across sessions.
2026-06-02 19:57:51 +02:00
simoleo89 db050b99e7 feat(messenger): show 'sent while offline' marker in thread 2026-06-02 19:11:05 +02:00
simoleo89 83140de98b feat(messenger): offlineDelivered flag on thread chat 2026-06-02 19:07:56 +02:00
simoleo89 030015afca docs(messenger): Phase 2 implementation plan — offline messages
Store messages to offline friends in messenger_offline (capped inbox),
replay on login via the existing FriendChatMessageComposer with an
"offline" extraData marker, and render a "sent while offline" tag in
the client thread. No new packets; emulator + small client touch.
2026-06-02 18:52:17 +02:00
simoleo89 9441847818 style(friends): group chips, category manager, assign-group dropdown 2026-06-02 18:32:01 +02:00
simoleo89 1af038806b feat(chat): improve command autocomplete and command alerts 2026-06-02 18:31:49 +02:00
simoleo89 2291d3cfa8 feat(friends): per-friend assign-to-group control 2026-06-02 18:26:44 +02:00
simoleo89 860ec07dfd feat(friends): group chip-filter row over online/offline list + manager wiring 2026-06-02 18:20:31 +02:00
simoleo89 7913952f71 fix(friends): reset stale edit state on category refresh + localize manager labels where keys exist 2026-06-02 18:12:53 +02:00
simoleo89 39bcfdb0cd feat(friends): category manager modal (create/rename/delete groups) 2026-06-02 18:07:40 +02:00
simoleo89 5be38e7df3 feat(friends): category CRUD + assign actions in friends store 2026-06-02 17:59:13 +02:00
simoleo89 f9320b4582 feat(friends): pure category filter + count helpers 2026-06-02 17:54:30 +02:00
simoleo89 76b7e21494 docs(messenger): Phase 1 implementation plan — friend groups
Bite-sized TDD plan across all three codebases for the friend-groups
feature: 4 client->server category packets (renderer composers +
Arcturus handlers), DB persistence (reusing existing
messenger_categories + messenger_friendships.category), server-
authoritative re-push via existing MessengerInit/UpdateFriend
composers, and client store actions + chip-filter UI + manager modal +
per-friend assign control + pure filter helper with tests.
2026-06-02 17:17:29 +02:00
simoleo89 98d75a5c96 docs(messenger): design spec for groups, offline messages, read receipts, typing
Brainstormed design for extending the existing React friends/messenger:
- full custom friend groups (CRUD + assign) with Online/Offline primary view + group chip filter
- offline messages stored in messenger_offline, replayed on login (no new packets)
- 2-state read receipts (sent/read) via per-conversation last-read timestamp
- typing indicator (ephemeral packets)

Cross-component: Nitro-V3 client + Nitro_Render_V3 renderer + Arcturus emulator.
Reuse official Habbo header IDs for category packets; custom IDs for receipts/typing.
2026-06-02 17:03:01 +02:00
duckietm d5d5ca59a8 🆙 Small fix Floorplanner 2026-05-26 17:16:14 +02:00
duckietm bf0a73eaf8 🆕 Brand new Floorplan 2026-05-26 16:38:01 +02:00
DuckieTM 4f0a8be2b0 Merge pull request #158 from simoleo89/pr/floor-editor-modernization
feat(floorplan-editor): React rewrite + live in-room preview + UX polish
2026-05-26 13:21:29 +02:00
duckietm 11702fa5e0 🆙 Small updates for the HK 2026-05-26 12:51:33 +02:00
DuckieTM b9bcf44192 Merge pull request #157 from simoleo89/feat/housekeeping-panel
feat(housekeeping): in-client admin panel
2026-05-26 10:51:09 +02:00
duckietm c61bc3726f 🆙 Update gifts 2026-05-26 10:01:07 +02:00
DuckieTM f4b84b69d1 Merge pull request #159 from Lorenzune/merge-duckie-main-2026-05-06
Add emulator stats dashboard and refresh classic UI views
2026-05-25 18:52:02 +02:00
DuckieTM cef27d5646 Merge branch 'Dev' into merge-duckie-main-2026-05-06 2026-05-25 18:51:48 +02:00
Lorenzune b038ca4542 Add emulator stats dashboard and refresh classic UI views 2026-05-25 10:10:40 +02:00
simoleo89 4378d34e22 fix(floorplan-editor): hand tool sits AFTER the 'Modalita disegno' label
Earlier rev had the hand first, before the label. Feedback: the
label belongs at the very start of the strip; the hand reads
better as the first of the tool buttons it groups with. Same
gesture and exclusive-group behaviour, just visually:

  Modalita disegno  [hand]  [SET][UNSET][UP][DOWN][DOOR] ...
2026-05-24 22:06:03 +02:00
simoleo89 e60d6e2df8 feat(floorplan-editor): hand tool joins the exclusive tool group, sits first in toolbar
Two related changes from the latest feedback:

1) Hand is now the FIRST button in the toolbar (left of the
   'Modalita disegno' label), matching where users typically
   look for a pan affordance in painting / mapping editors.

2) The hand and the brush buttons form one exclusive tool
   group: picking any brush (SET / UNSET / UP / DOWN / DOOR)
   - or select-all / square-select - clears pan mode. No more
   'I clicked SET but the canvas keeps panning'. Same goes
   the other way: clicking the hand stays sticky, and while
   it's active the brush highlights are visually de-selected
   even though state.brush.action still holds the last brush
   (so the user gets it back the moment they pick a brush
   again).

Implementation: replaced the toolbar's onTogglePanMode prop
with an imperative setPanMode(next: boolean) =>. Every other
tool's onClick calls exitPan() first; the hand calls
setPanMode(!panMode) directly. data-active and the border
highlight on the brush + square-select buttons now require
!panMode so the visual state mirrors the gesture state.

No reducer changes - panMode stays a canvas-level UI flag.
2026-05-24 22:04:58 +02:00
simoleo89 3aa06d4dc4 feat(floorplan-editor): height slider thumb adopts the colour of the band under it
Feedback was the amber thumb looked generic / off-the-shelf
and didnt visually tie to the gradient. The thumb now picks
its fill from tileFill of the selected height, so picking 0
shows a blue bead, picking 12 a green one, picking 26 a
purple one, and so on across the full HEIGHT_SCHEME palette.

- Fill: radial gradient on the band colour with a soft white
  highlight at top-left and a darker rim at the bottom-right
  for a beaded look. The highlight intensity adapts to the
  base colour (stronger on dark hues, dimmer on light) so
  it never washes out.
- Text contrast: a perceptual-luma heuristic (Rec.601, plain
  arithmetic, no colour lib) flips between text-zinc-900 and
  text-white at the right threshold so the height number
  stays legible on every colour the picker can land on. A
  matching textShadow seals the deal on the borderline hues.
- Ring on drag is now zinc-900 + scale-110 (clear gesture
  feedback even when the underlying colour is similar to
  white).
- Test added: thumb fill at h=0 must differ from h=13, so any
  future regression that pins the thumb to a single colour
  fails the suite.
2026-05-24 21:47:49 +02:00
simoleo89 12d24719cf feat(floorplan-editor): polish height slider + add hand tool for canvas pan
Two related polish improvements after the swatch-column → vertical-
slider swap.

Slider
- Wider track (18 px, was 14 px) for a more comfortable click area
  with the same on-screen footprint.
- Min / max chips above and below the rail (HEIGHT_BRUSH_MIN /
  _MAX) so users know which end is high and which is low without
  hovering to discover.
- Thumb now uses a warm amber radial gradient (#fff7c4 → #facc15
  → #ca8a04) on a dark brown border with a soft drop shadow + inset
  highlight, instead of the flat yellow disc. Hover adds a white
  ring; drag swaps it for a darker ring — clear gesture feedback.
- Track gains a hover/drag glow (inset white seam + amber outline
  via boxShadow) so you can tell the slider has focus before you
  even click.

Hand tool (canvas pan)
- New FloorplanToolbar button (FaHandPaper, sticky toggle, emerald
  fill when active) ties to a new  state lifted into
  FloorplanEditorView. When the hand is active, plain left-click
  + drag pans the canvas instead of brushing tiles. Cursor flips
  to grab / grabbing accordingly.
- FloorplanCanvasSVG's isPanGesture predicate becomes:
  middle-mouse  OR  Shift+left-click  OR  (panMode && left-click).
  Shift / middle still work whether or not the hand is on so power
  users keep their muscle memory.
- No change to the reducer (panMode is a canvas-level UI flag, not
  a brush action — keeps state/types tight).
2026-05-24 21:33:12 +02:00
simoleo89 abf43d86c3 feat(floorplan-editor): swap the height swatch column for a vertical slider
Replaces the SVG column of 27 colour swatches with a vertical
slider that fills the same role (pick a brush height 0-26) but
much faster to scrub:

- Track is a discrete-step linear gradient built from the real
  tile-fill colours, top = HEIGHT_BRUSH_MAX, bottom =
  HEIGHT_BRUSH_MIN. Each height occupies a clear band so the
  user still reads colour-to-height at a glance.
- Yellow circular thumb shows the current value as a number,
  centred at the picked height's band, with a darker border
  while dragging so the drag affordance is obvious.
- Click anywhere on the track to jump; the same gesture starts
  a drag (pointermove on window) so users can scrub up/down
  without releasing. Pointer-cancel + button-other-than-0 are
  handled.
- ARIA: slider role + valuemin / valuemax / valuenow, plus a
  touch-none style so mobile scrolling doesn't fight the drag.

Tests rewritten around the new contract (5 cases):
- thumb renders with the current value;
- click at top -> picks 26;
- click at bottom -> picks 0;
- click at middle -> picks 13;
- click at the band that's already selected -> no onSelect
  call (idempotent).
Track geometry is stubbed via getBoundingClientRect so the
pointer math is reproducible under jsdom. afterEach(cleanup)
keeps multiple renders from colliding on the data-testid lookup.
2026-05-24 21:27:22 +02:00
simoleo89 b540b163c6 feat(floorplan-editor): React rewrite + live in-room preview + UX polish
Complete modernization of the floor-plan editor. Three layered
changes shipped together since they share state shapes and the
test infrastructure stubs.

1) React rewrite (state + hooks + views + tests)

   Drops the FloorplanEditorContext singleton + legacy view
   components and replaces them with a pure-React reducer
   architecture:

   - state/ — typed FloorplanState + FloorplanAction union,
     pure reducer covering PAINT_TILE / ERASE_TILE /
     ADJUST_HEIGHT / SET_DOOR / SET_DOOR_DIR / SET_THICKNESS /
     SET_WALL_HEIGHT / BRUSH_SET / SELECT_RECT / SELECT_ALL /
     CLEAR_SELECTION / SQUARE_SELECT_TOGGLE / IMPORT_STRING /
     APPLY_REMOTE_DIFF / APPLY_REMOTE_SNAPSHOT. Source-tagged
     ('local' | 'remote') so the editor can distinguish user
     edits from server pushes. Co-located encoding helpers
     (parseTilemap / serializeTilemap) and area-counter
     selectors.
   - hooks/ — useFloorplanReducer (wraps useReducer with a
     history stack + loadFromServer + undo/redo), useTool
     (pointer events -> dispatch), usePointerToTile (screen
     -> tile projection that respects the viewBox origin so
     pan/zoom stays accurate).
   - views/ — FloorplanCanvasSVG, FloorplanHeightPicker,
     FloorplanToolbar, FloorplanOptionsPanel,
     FloorplanImportExport, FloorplanTile,
     FloorplanPreviewSVG (alternative iso preview kept as a
     fallback view, not wired into the main layout).
   - Co-located Vitest suites for every module above (encoding,
     reducer, selectors, hooks, views, integration). 100+ new
     test cases.

2) Live in-room preview (NEW capability)

   useFloorplanLiveSync drives client-side preview of the edit
   directly into the active room — every tile / door / wall
   height / thickness change is applied through
   GetRoomMessageHandler().applyFloorModelLocally (new public
   method on the renderer, see paired renderer PR) with
   zero server traffic during editing. The wire
   UpdateFloorPropertiesMessageComposer is only sent when the
   user explicitly clicks Save. Thickness slider additionally
   calls RoomEngine.updateRoomInstancePlaneThickness for
   zero-latency wall/floor-depth feedback while dragging.

   Toggle 'Live preview ON / OFF' in the bottom strip (default
   ON) lets the user opt out if they want to keep changes
   contained to the editor's own preview until Save.
   Revert button re-applies the original snapshot locally so
   the room snaps back to where it was when the editor opened.

3) UX polish

   - Undo / Redo (Ctrl+Z, Ctrl+Shift+Z / Ctrl+Y) backed by a
     100-step history stack inside useFloorplanReducer. Local
     mutating actions push history; brush/selection UI bumps
     and remote dispatches bypass it; loadFromServer wipes the
     stack.
   - Zoom 40-600 % with Ctrl+wheel, +/- buttons, % label.
     Shift+drag or middle-mouse drag pans the canvas.
   - Auto-fit on first paint: computes the screen-space
     bounding box of the painted (non-blocked) tiles, picks the
     zoom that just contains them with a 5 % margin, pans so
     the room sits in the viewport centre. Default view is now
     'room fills the canvas' instead of 'room is a dot at the
     top-centre of a huge empty canvas'. Clicking the % label
     re-runs the fit; crosshair button keeps zoom and recentres
     the pan only.
   - Door direction control: arrows + door icon triplet
     (8-way rotate by single click on prev/next, full cycle
     forward on the icon itself). Wall and floor thickness
     collapse from two 4-button rows into two compact
     segmented selectors (active state in emerald). Saves
     significant horizontal space.
   - Habbo floor pattern tile (~186 B PNG, vendored from
     habbofurni.com/images/furni_floor.png) tiled as the
     canvas background with image-rendering: pixelated so the
     texture stays crisp at every zoom level. Replaces the
     solid black background.

Test infrastructure

   nitro-renderer.mock grows constructors / proxies / functions
   for everything the new floor-editor tests transitively
   import (floor composers + events, RoomEngineEvent,
   ILinkEventTracker, convertNumbersForSaving /
   convertSettingToNumber, GetRoomMessageHandler,
   GetTicker, GetRenderer, NitroTicker, RoomPreviewer with a
   sufficiently real .updatePreviewModel / dispose surface,
   and a TextureUtils.createRenderTexture that returns an
   object with a no-op .destroy). test-setup adds a no-op
   ResizeObserver polyfill (jsdom doesn't ship one and the
   optional FloorplanRoomPreview observes its container) and
   a draggable-windows-container portal root for tests that
   mount NitroCardView.

Files: 44 changed (mostly new). yarn typecheck 0 errors,
yarn test 341/341 green.
2026-05-24 21:19:10 +02:00
simoleo89 0ee53c24e3 ci: pair this PR head with the fork's renderer PR branch
CI on PR #157 was failing every typecheck with 35 TS2305 errors of the
form 'Module @nitrots/nitro-renderer has no exported member
Housekeeping*' because the workflow's PR fallback mapped to
duckietm/Nitro_Render_V3 @ Dev — and upstream Dev doesn't carry the HK
composers yet. They live on the fork's feat/housekeeping-packets
branch (renderer companion PR #77).

Detect the PR head ref and, when it's feat/housekeeping-panel,
override the default base-ref pairing and point at
simoleo89/Nitro_Render_V3 @ feat/housekeeping-packets so the typecheck
step can resolve the imports. Once the renderer PR lands on
duckietm:Dev this whole special-case block becomes dead code and can
be deleted.
2026-05-24 17:19:09 +02:00
simoleo89 b8675b9dc3 feat(hk): reveal-and-copy card for reset password (+ catalog cleanup)
Two things in one commit because they sit on top of each other:

1. **Reset password reveal card.** The emulator's
   `HousekeepingResetUserPasswordEvent` already returns the freshly
   generated 12-char plaintext in the action-result `message`, but
   the client was leaking it through the standard success-banner
   pipeline — auto-dismiss in 4s, truncated, no copy button. Operators
   were missing it.

   - New `<HousekeepingPasswordReveal />` card mounted in the panel
     header (between the status banner and tab content). Stays put
     until manually dismissed.
   - `useHousekeepingStore` gains a dedicated `passwordReveal` slot
     (`{ userId, username, password }`) plus `revealPassword()` /
     `clearPasswordReveal()` setters. Sensitive data, kept OUT of the
     generic banner / toast pipeline.
   - `useHousekeepingActions.resetUserPassword` no longer routes
     through `wrap()` — it intercepts the result, lifts the
     plaintext into the reveal slot, and uses a localizable success
     key (`housekeeping.action.reset_password.done`) for the banner so
     the password itself never lands there.
   - Copy button uses `navigator.clipboard.writeText` in secure
     contexts with a `document.execCommand('copy')` fallback for
     http:// deployments. Confirmation icon flips to a checkmark for
     ~1.6s on success. The input is `select-all` + auto-select on
     focus so Ctrl+C is also a manual fallback.
   - 8 new i18n keys (EN + IT, .example + runtime UITexts.json5 /
     UITexts.en.json5).

2. **Catalog admin cleanup ported from the PR branch.** The dev
   branch was still carrying the catalog admin code (handlers, hooks,
   store slots, i18n keys) even though the local renderer is on the
   catalog-stripped `feat/housekeeping-packets` branch — typecheck
   was breaking because the catalog composers no longer exist on the
   linked renderer. Stripped here to match: 4 catalog actions
   removed from `HousekeepingActionType`, `HousekeepingApi.ts`,
   `useHousekeepingActions`, `useHousekeepingStore`. The CATALOG tab
   id is gone from `HousekeepingTabId`. Catalog interfaces
   (`IHousekeepingCatalogPage` / `IHousekeepingCatalogOffer`) are
   dropped. 17 catalog i18n keys removed per locale. Two test files
   updated to match.
2026-05-24 16:56:39 +02:00
simoleo89 eeab548917 feat(housekeeping): in-client admin panel
Adds the Housekeeping in-client admin panel — a Modtools-adjacent
surface that runs entirely inside the React client, talking to the
emulator over the existing wire instead of a separate REST/CMS layer.

Surface:
- `src/components/housekeeping/` — panel shell + 5 tabs (Dashboard,
  Users, Rooms, Economy, Audit). Each tab drives one domain of the
  matching emulator handlers (find/sanction/admin/economy/catalog/
  hotel-wide).
- `src/api/housekeeping/` — composer/parser orchestration:
  `HousekeepingApi.ts` exposes 30+ typed actions, each one running
  through `runHkAction()` which awaits the shared
  `HousekeepingActionResultEvent` correlated by action key.
- `src/hooks/housekeeping/` — `useHousekeeping` (the public hook),
  `useHousekeepingStore` (useBetween singleton: shared selection +
  audit polling + sanction templates), `useHousekeepingActions`,
  `useHousekeepingConfirm`.
- `src/api/nitro/awaitMessageEvent.ts` — Promise adapter over
  `CommunicationManager.subscribeMessage` with a sync `select`
  callback that snapshots the parser INSIDE the subscribe handler
  before the renderer recycles the parser instance after the
  Promise resolves.
- `public/configuration/housekeeping-texts-{en,it}.example` —
  149 EN + 149 IT i18n keys under `housekeeping.*` for every panel
  string + every server-side error slug the emulator may emit.

Wiring (additive only):
- `src/components/MainView.tsx` — `<HousekeepingView />` mounted
  alongside `<ModToolsView />`.
- `src/api/index.ts`, `src/hooks/index.ts`, `src/api/nitro/index.ts`
  — added the `housekeeping` and `awaitMessageEvent` re-exports.

Wire contract: pairs against the Arcturus PR (#120 on
duckietm/Arcturus-Morningstar-Extended) and the renderer PR (#77 on
duckietm/Nitro_Render_V3). Incoming events 9100..9129, outgoing
composers 9200..9207. Permission gate `acc_housekeeping` enforced
server-side; the panel is hidden client-side via
`housekeeping.enabled` in the runtime ui-config.
2026-05-24 16:38:16 +02:00
DuckieTM 20ffd5cd7c Merge pull request #155 from simoleo89/patch-1
ci: dynamically resolve renderer pairing by client context
2026-05-24 10:45:02 +02:00
Life dc42cc4240 Enhance CI workflow with dynamic renderer inputs
Added workflow_dispatch inputs for renderer configuration and modified the renderer ref resolution logic.
2026-05-24 10:03:52 +02:00
duckietm 0996ed24d3 🆙 More toolbar update :) 2026-05-22 17:17:33 +02:00
duckietm b3ff46a771 🆙 Fix Toolbar & Pets layout 2026-05-22 16:00:59 +02:00
duckietm df4ec5201b 🆙 Fix text in the navigator 2026-05-22 15:25:05 +02:00
duckietm 20588533d3 🆙 Added translation to the Catalog Text 2026-05-22 11:47:26 +02:00
duckietm 5002b2fcdc 🆙 Fix Catalog Edit 2026-05-21 16:58:47 +02:00
duckietm 49917ed49b 🆕 Redesign of HC Club buy, now also give as gift 2026-05-21 14:00:03 +02:00
duckietm 690a196d42 🆙 Fix texts 2026-05-21 08:59:26 +02:00
DuckieTM e9591acc0e Merge pull request #146 from medievalshell/Dev
feat(loading): redesigned loader with progress bar, task labels, configurable assets + perf(build): granular code-split + preconnect hint for cold-load speed + docs: PERFORMANCE.md — client + server recipe for the 4s cold load
2026-05-21 07:39:32 +02:00
DuckieTM 1b2552dd11 Merge pull request #145 from simoleo89/feat/mod-tools-redesign
feat(mod-tools): complete redesign + i18n + correctness fixes
2026-05-21 07:39:10 +02:00
DuckieTM 6abc765680 Merge pull request #144 from simoleo89/fix/button-icon-alignment
fix(button): align icon + text via inline-flex, not inline-block
2026-05-21 07:38:55 +02:00