Skip to content

Improve dev controls and player detail loading - #315

Closed
TheBlackWraiths wants to merge 3 commits into
Samuels-Development:mainfrom
TheBlackWraiths:main
Closed

TheBlackWraiths wants to merge 3 commits into
Samuels-Development:mainfrom
TheBlackWraiths:main

Conversation

@TheBlackWraiths

Copy link
Copy Markdown

Group development controls in the app, including boot replay and admin access. Normalize missing player overview lists so characters without phone profiles load safely.

Summary

  • The dev-only buttons (Show Setup, Replay boot, Ryde data, Payphone, 24h) were scattered at fixed positions and overlapped each other. Payphone and 24h shared top-[84px], and Replay boot covered Show Setup. They now sit in one wrapping toolbar at the top-left, still dev builds only.
  • Added an Admin button to that toolbar. It posts sd-phone:admin:open, so the admin panel can be opened from the dev preview.
  • BootReplayButton now renders an inline button instead of a fixed-position portal, and the toolbar places it.
  • The admin player detail page crashed with Cannot read properties of undefined (reading 'length') for characters whose overview was missing lists, such as characters with no phone profile. accounts, birdy, mutes, downloadable and sim.sims now default to empty arrays when the overview loads.

Type of Change

  • Bug Fix
  • New Feature
  • Improvement / Refactor
  • Performance
  • Documentation
  • Compatibility
  • Other

Related Issues

Related to the admin player details fix in 66614ff (characters with no phone profile).

Testing

  • Tested locally
  • Tested with latest sd-phone
  • Tested with latest ox_lib
  • Tested with latest ox_inventory
  • Multiplayer tested

To check:

  • Run the web dev server. The toolbar buttons should no longer overlap, and Admin should open the panel.
  • In-game, open the player details for a character with no phone profile. The page should load instead of crashing.
  • The web bundle needs a rebuild (bun run build in web/) for the crash fix to take effect in-game.

Breaking Changes

The toolbar is dev-only, and the overview change only adds defaults for missing lists.

TypeError: Cannot read properties of undefined (reading 'length') (@sd-phone/web/build/assets/index-CeOLfeB6.js:9)
[sd-phone] interface crashed: TypeError: Cannot read properties of undefined (reading 'length') 
    at Ji (https://cfx-nui-sd-phone/web/build/assets/AdminPanel-CSILaXJk.js:1:129321)
    at div (<anonymous>)
    at Ki (https://cfx-nui-sd-phone/web/build/assets/AdminPanel-CSILaXJk.js:1:123903)
    at div (<anonymous>)
    at div (<anonymous>)
    at div (<anonymous>)
    at div (<anonymous>)
    at div (<anonymous>)
    at ca (https://cfx-nui-sd-phone/web/build/assets/AdminPanel-CSILaXJk.js:1:153676)
    at Suspense (<anonymous>)
    at C_ (https://cfx-nui-sd-phone/web/build/assets/index-CeOLfeB6.js:35:26516)
    at B_ (https://cfx-nui-sd-phone/web/build/assets/index-CeOLfeB6.js:35:42649)
    at os (https://cfx-nui-sd-phone/web/build/assets/themeStore-D5ZQ4p_K.js:1:66496)
    at wF (<anonymous>)
    at DF (https://cfx-nui-sd-phone/web/build/assets/index-CeOLfeB6.js:35:526085) (@sd-phone/web/build/assets/index-CeOLfeB6.js:35)

Checklist

  • My code follows the existing style of the project.
  • I have tested my changes.
  • I have updated any necessary documentation. (None needed.)
  • I have removed any debug code.
  • This PR does not include unrelated changes.
  • I have verified this works on the latest version of sd-phone.

Group development controls in the app, including boot replay and admin access. Normalize missing player overview lists so characters without phone profiles load safely.
@Github-Samuel

Copy link
Copy Markdown
Member

Thanks for this! Your dev toolbar and live map changes landed on main in 112c917 (#316). The player detail crash was already fixed in 66614ff, so that part wasn't needed, and the badge tooltip and version bump were left out.

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.

2 participants