Commit Graph

291 Commits

Author SHA1 Message Date
simoleo89 25d51aff3f Enable <StrictMode> + make App.tsx renderer init idempotent
App.tsx's prepare() useEffect ran four .init() calls
(SessionDataManager, RoomSessionManager, RoomEngine, Communication)
without any guard, plus an immediate heartbeat ping and a legacy
authentication track. Under StrictMode dev double-invoke, those
fire twice — risking duplicate session/communication state.

- Gate the four .init() chain behind gameInitPromiseRef: both the
  first and the simulated second invocation await the same promise.
- Gate the legacy track + immediate heartbeat behind bootstrapDoneRef.
- Heartbeat and remember-rotate intervals were already idempotent
  (clearInterval before setInterval); ticker registration was already
  guarded by tickersStartedRef; renderer/warmup were already gated by
  rendererPromiseRef/warmupPromiseRef. No change needed there.

Wrap <App /> in <StrictMode> in src/index.tsx now that the renderer
init path is double-invoke safe.

https://claude.ai/code/session_01GrR87LAqnAEyKG2ZbmQt5Q
2026-05-11 16:31:50 +00:00
simoleo89 535fa71020 ESLint --fix: auto-fix brace-style, indent, semi, no-trailing-spaces
Run eslint --fix across src/ to clear ~1900 mechanical lint errors
surfaced by the @typescript-eslint v8 + react-hooks v7 + react-compiler
upgrade in the React 19 modernization PR.

Issues fixed automatically:
- brace-style (Allman): try/catch one-liners reformatted to multi-line
- indent: tab-vs-space and depth corrections
- semi: missing trailing semicolons
- no-trailing-spaces

No semantic changes. Remaining 701 errors are real-code issues
(set-state-in-effect, rules-of-hooks, no-unsafe-* type checks) that
need manual per-file review.

https://claude.ai/code/session_01GrR87LAqnAEyKG2ZbmQt5Q
2026-05-11 16:31:50 +00:00
simoleo89 1b1e0c18bf React 19 Phase 3: login/forgot/register forms → useActionState + useFormStatus
Migrate all three inline forms in LoginView.tsx to React 19 Actions:

- Login form: handleLoginSubmit → loginAction(prevState, FormData) wrapped in
  useActionState. Submit button extracted as <LoginSubmitButton/> reading
  pending via useFormStatus, dropping the local `submitting` flag for the
  login flow. Reads username/password/remember from FormData; rememberMe
  checkbox now carries name="remember".
- Forgot form (inline): forgotAction wrapped in useActionState; awaits
  parent's onSubmit so pending stays true through the parent fetch.
  ForgotSubmitButton uses useFormStatus.
- Register credentials step: credentialsAction with useActionState; the
  step transition (setStep('avatar')) happens inside the action after
  pingServer + onCheckEmail.
- Register avatar step: avatarAction validates username, pings server,
  checks availability, then awaits onSubmit. The button label uses
  isAvatarPending to show "Creating…" without prop drilling submitting.
- DialogSharedProps onSubmit signatures updated to return Promise<void>
  so dialog actions can await the parent's fetch.
- lockState memo replaced with a direct readLock() call in render: the
  previous useMemo depended on `submitting` to refresh after a failed
  attempt; now any re-render (triggered by the action's pending toggle)
  recomputes it.
- Remove unused FormEvent import; remove unused checking state in
  RegisterDialog (replaced by isCredentialsPending / isAvatarPending).

https://claude.ai/code/session_01GrR87LAqnAEyKG2ZbmQt5Q
2026-05-11 16:31:50 +00:00
simoleo89 a1bee1d825 React 19 modernization: forwardRef removal, Compiler, ErrorBoundary, Suspense, native <script>
Adopt React 19 idioms across the codebase. The runtime was already on
react@19.2.5 but no React 19 APIs were in use.

- forwardRef -> ref-as-prop in 7 layout/component files
  (NitroInput/Button/ItemCountBadge/Card×5/InfiniteGridItem,
  ToolbarItemView, AvatarEditorIcon)
- <Ctx.Provider> -> <Ctx> in 6 contexts (CatalogAdmin, FloorplanEditor,
  UiSettings, GridContext, NitroCardContext, NitroCardAccordionContext)
- Native <script> hoisting for Turnstile, ExternalPluginLoader, GoogleAdsView
  (React 19 dedupes by src; removes manual document.head.appendChild +
  module-level promise caches)
- React Compiler enabled at build time via babel-plugin-react-compiler
  in vite.config.mjs (target: '19'), plus eslint-plugin-react-compiler
  in lint mode
- Global <ErrorBoundary> + <Suspense> in src/index.tsx using
  react-error-boundary, with LoadingView as fallback
- BackgroundsView migrated to use(promise) as a demonstrator pattern
  for Suspense-driven config loading
- ESLint react setting bumped 18.3.1 -> 19.2; legacy
  @typescript-eslint/ban-types replaced with no-restricted-types
  (the old rule was removed in @typescript-eslint v8)
- Refresh public/configuration/{asset-loader,bootstrap}.js to match
  current write-asset-loader.mjs output

Phase 3 (login forms -> useActionState/useFormStatus) deferred:
LoginView is 1623 lines with lockout + Turnstile + heartbeat
interleaving; safer as its own PR.

https://claude.ai/code/session_01GrR87LAqnAEyKG2ZbmQt5Q
2026-05-11 16:31:50 +00:00
duckietm d88defb4a5 🆙 Fixed the commands 2026-05-08 16:44:45 +02:00
duckietm 6124610736 🆙 Small fix Avatar loading & moved news to path wich you can enter
The example data has been provided in /Content-Gamedata so you could place it in /gamadata or anything you like.
Do not forget the render-config.json to update :

"login.health.method": "GET",
"login.news.url": "${asset.url}/news/news.json",
2026-05-08 11:58:32 +02:00
DuckieTM 71725b7f67 Merge branch 'Dev' into merge-duckie-main-2026-05-06 2026-05-08 07:45:17 +02:00
Lorenzune 57b83c1097 Refine mobile avatar widgets and login flow 2026-05-07 21:19:15 +02:00
DuckieTM 83ee05957d 🆙 Fix font colors in chat 2026-05-07 20:49:50 +02:00
duckietm 3d88ec8cfc 🆙 Fix when using : --base=/client/ in package.json 2026-05-07 15:16:54 +02:00
duckietm 7396413f11 🆙 Fixed Multiple SCSS-isms ended up inside plain .css 2026-05-06 10:48:09 +02:00
duckietm aa20b0acbe 🆙 Small fix Background to load from json 2026-05-06 08:57:44 +02:00
duckietm a243640741 🆙 News windows in UI login update 2026-05-06 08:48:17 +02:00
duckietm 793c260fc5 🆙 Small update to the login texts 2026-05-06 08:32:36 +02:00
duckietm 606afa7792 🆙 Small fix login page 2026-05-06 08:21:08 +02:00
Lorenzune 851d82f93f Document secure runtime configuration 2026-05-06 06:27:40 +02:00
Lorenzune 71171dc205 Merge remote-tracking branch 'duckie/main' into merge-duckie-main-2026-05-06
# Conflicts:
#	index.html
#	public/UITexts.example
#	public/renderer-config.example
#	src/App.tsx
#	src/components/login/LoginView.tsx
#	src/components/room/widgets/avatar-info/infostand/InfoStandWidgetUserView.tsx
#	src/components/toolbar/ToolbarView.tsx
#	src/components/user-profile/UserContainerView.tsx
2026-05-06 04:23:15 +02:00
duckietm 5857362d61 🆙 Small fix for the badge selector in the infostand view 2026-05-04 15:59:08 +02:00
duckietm 6fce62fb47 🆙 Updated Background profiles
Please make sure you change your UI-Config !!!
2026-05-04 15:26:29 +02:00
duckietm da9e394901 🆙 Small fix Badge tooltip view 2026-05-04 10:24:02 +02:00
DuckieTM 182654f308 Merge pull request #113 from simoleo89/feat/full-box-background
Feat/full box background
2026-05-04 08:03:25 +02:00
DuckieTM 00bcfd7173 Merge pull request #112 from simoleo89/fix/toolbar-face-vertical-align
fix(toolbar): align face button with other toolbar icons
2026-05-04 08:03:13 +02:00
DuckieTM 6e50cb180c Merge pull request #111 from simoleo89/fix/me-menu-popup-position
fix(toolbar): anchor Me menu popup to face button instead of fixed of…
2026-05-04 08:02:53 +02:00
simoleo89 72bc4da3c0 feat(profile): add full-box card background tab and rendering
Adds a "Cards" tab to the Profile Background picker (BackgroundsView)
that selects a pattern applied to the entire user info card and the
extended profile container, in addition to the existing avatar-pad
background/stand/overlay layers.

- AvatarInfoUser/Utilities: propagate cardBackgroundId from RoomUserData.
- InfoStandWidgetUserView: stateful cardBackgroundId, applied as
  .profile-card-background.card-background-{id} on the outer Column
  with bg-color suppressed when active.
- UserContainerView: same class on the wrapper of the extended profile.
- BackgroundsView: 4th tab "cards" backed by cards.data config
  (falls back to backgrounds.data); sends 4-id message via the
  extended sendBackgroundMessage signature.
- ui-config.example: cards.data dataset (15 entries).
- BackgroundsView.css: 188 .card-background-{N} rules cloned from
  background-{N} (repeat-tiled) plus 15 CSS-pattern overrides for the
  provisional dataset (gradients, stripes, dots, grid, checker).
2026-05-03 22:09:12 +02:00
simoleo89 017e780e74 fix(toolbar): align face button with other toolbar icons
The face avatar (headOnly LayoutAvatarImageView) sits in a 63px-tall
box (44px on mobile) while sibling toolbar icons are smaller, so its
head sprite rendered visually higher than the other icons. Bumped
marginTop from 2px → 12px (desktop) and 4px → 9px (mobile) so the
head sits on the same horizontal axis as the rest of the toolbar.
2026-05-03 20:49:15 +02:00
simoleo89 0f6bf7e9eb fix(toolbar): anchor Me menu popup to face button instead of fixed offset
Removed `absolute bottom-[60px] left-[33px]` from the inner Flex of
ToolbarMeView. The outer wrapper in ToolbarView already anchors the
popup above the face button (bottom-[calc(100%+8px)] left-1/2 -translate-x-1/2),
so the inner pixel-perfect override was detaching it and making it float
mid-screen.
2026-05-03 20:40:30 +02:00
simoleo89 d9b6a3eb0c feat(infostand): gate Edit Furni button behind moderator permission
Mirrors the isModerator check already used by the toolbar furni-editor
icon, so users without the moderator rank no longer see the button.
2026-05-03 20:08:20 +02:00
DuckieTM 92e9bb19cd 🆙 Updates thanks to Life
react-slider → @radix-ui/react-slider
react-tiny-popover → @radix-ui/react-popover
react-youtube → react-player (more formats, better maintained)
2026-05-03 17:54:10 +02:00
DuckieTM 99aceefb9e 🆙 Updates thanks to Life
react-bootstrap → migrate to shadcn/ui + Tailwind (or HeroUI)
Legacy, ~250KB bundle, dated API, inconsistent with CMS stack

react-transition-group → use framer-motion (already installed!)
De-facto deprecated, duplicate animation lib
2026-05-03 16:05:23 +02:00
duckietm 506a29c9a0 🆕 Create Custom Bage & Security update 2026-05-01 16:02:56 +02:00
duckietm a0a4848ecb 🆙 Small update news images 2026-05-01 08:24:16 +02:00
duckietm 46eb7b45fc 🆙 Code cleanup News UI Login 2026-05-01 07:47:12 +02:00
duckietm d1f696e519 🆕 News in the UI Client login 2026-04-30 17:25:04 +02:00
duckietm 38470d6bec 🆙 Change Font to old school in login screen 2026-04-30 10:12:16 +02:00
duckietm b722903834 🆙 Small update to the Effect editor 2026-04-29 17:08:12 +02:00
duckietm eb0bf80dfa 🆙 Fix the avatar-editor faces 2026-04-29 15:44:17 +02:00
duckietm 78aedc4faa 🆕 Effect selection in user dropdown 2026-04-29 13:20:13 +02:00
duckietm a266696eb6 🆙 Added BuildHeight to NitroV3 2026-04-28 13:47:39 +02:00
duckietm 0bf861ef3c 🆙 Added ban to the login UI 2026-04-28 11:33:29 +02:00
Lorenzune b4fab3f6b9 Merge duckie main into live merge branch 2026-04-25 13:52:11 +02:00
Lorenzune 3c9a599505 Add secure configuration bootstrap flow 2026-04-25 13:29:48 +02:00
Lorenzune 6c7d78c156 Move runtime URLs to config examples 2026-04-24 16:12:04 +02:00
Lorenzune 21dd357397 Replace production domain references with examples 2026-04-24 15:59:55 +02:00
Lorenzune 42731218f8 Add runtime toggle docs and secure mode switches 2026-04-24 15:53:17 +02:00
duckietm f26a92844f 🆙 Fix background clipping 2026-04-24 13:53:21 +02:00
duckietm bf99f97122 🆙 Updated Tokens to use JWT rotational tokens 2026-04-24 11:16:15 +02:00
Lorenzune 541d3045f1 Update secure login flow and login view 2026-04-23 16:26:32 +02:00
duckietm ca09952851 🆙 Fixed text beeing white in some containers for expl. Room-ads 2026-04-23 10:55:05 +02:00
duckietm 969f4a07d2 🆕 Token login added
Backend (AuthHttpHandler):
- New users_remember_tokens table stores sha256 hex of the raw token
  so the DB never holds a usable credential. Seed file adds the table
  and a login.remember.duration.days setting (default 30).
- /api/auth/login accepts "remember": true. On success, issues a fresh
  32-byte base64url token, stores the hash, returns the raw token.
- New POST /api/auth/remember: accepts the raw token, looks up by hash,
  on a valid hit mints a fresh SSO ticket, rotates the token (deletes
  the consumed one and issues a new one), returns both to the client.
  No Turnstile - it's an automated trusted-device flow.
- /api/auth/logout also accepts rememberToken and deletes that single
  row so other devices keep their tokens.

Frontend:
- LoginView: "Remember me" checkbox (key login.remember_me already in
  ExternalTexts). Enabling it persists the returned rememberToken in
  localStorage.nitro.remember.token.
- App.tsx: before deciding to show the login screen, try a silent POST
  to /api/auth/remember with the stored token. On 200, inject the
  returned ssoTicket into window.NitroConfig and proceed to the
  authenticated flow; on 401, forget the token and show login.
- PurseView logout: sends the stored rememberToken in the body so the
  server can delete it, and clears localStorage before reload.
2026-04-23 10:16:32 +02:00
duckietm 2ff37c22d2 🆙 Added the use of ExternalTexts / UITexts 2026-04-23 08:33:04 +02:00