Skip to content

fix: UI improvements, tool buttons, update notification, QR deeplink (#13)#14

Merged
lshw54 merged 22 commits intomainfrom
fix/window-border-and-qr-enlarge
Apr 21, 2026
Merged

fix: UI improvements, tool buttons, update notification, QR deeplink (#13)#14
lshw54 merged 22 commits intomainfrom
fix/window-border-and-qr-enlarge

Conversation

@lshw54
Copy link
Copy Markdown
Owner

@lshw54 lshw54 commented Apr 21, 2026

Problem

Multiple UI issues reported in #13 and from user feedback:

  • Right-click context menu clipped at window edges when accounts are near the bottom/right
  • Tool buttons (report hack, royal patrol, starforce calc, core calc) did nothing
  • Customer service opened in system browser instead of internal WebView
  • Beans exchange did nothing for TW region
  • No way to copy QR deeplink for mobile scanning
  • Update dialog appeared twice on startup, and dismissing it gave no further indication
  • TOTP required manual button click after entering all 6 digits
  • OTP retrieval failure showed no error when session was expired
  • Startup black screen caused by update check racing with frontend

Changes

Window & Layout

  • Remove CSS body border, apply DWM DWMWA_BORDER_COLOR = DWMWCP_NONE on focus to suppress Win11 accent border
  • QR enlarged: 540×780, all controls visible (header, status, back button)
  • Login window: 350×580 → 350×620 to fit update banner + deeplink button

Update Notification

  • Dismiss dialog → persistent banner on all pages (🔔 vX.X.X 可用 — 點擊更新), dismissible with ×
  • Banner auto-adjusts window height
  • Fix duplicate update dialog on startup (remove frontend redundant check, keep backend event + 3s fallback)
  • Backend update check delayed 2s to avoid race with frontend listener registration
  • AboutTab shows cached update info immediately, clickable to open dialog

Tools (#13)

  • Report hack: internal popup window (was disabled)
  • Royal patrol: URL updated to beanfun-event.beanfun.com/EventAD_Mobile/EventAD?eventAdId=3453
  • Starforce calc: brendonmay.github.io/starforceCalculator
  • Core calc: phantasmicsky.github.io/NodestoneBuilder

Accounts (#13)

  • Context menu boundary clamping with rAF measurement + 300px fallback
  • Customer service → internal WebView popup
  • Beans exchange → auth popup with cookie seeding (covers m.beanfun.com, login.beanfun.com)
  • Card/list view toggle, auto-list when >4 accounts, persisted in localStorage
  • Copy button on account cards (hover, top-right)

QR Page

  • Deeplink copy button with separate copied state
  • Buttons row flex-wrap for narrow windows
  • Deeplink field extracted from InitLogin API response

OTP & Login

  • OTP failure → error toast; session expired → auto-logout + redirect to login
  • TOTP auto-submit checkbox (default on): auto-verify on 6-digit completion

Docs

  • README code standards updated to match CI workflow

lshw54 added 14 commits April 21, 2026 23:20
- Remove CSS body border (was 1px solid var(--border))
- Add Win32_Graphics_Dwm feature to windows-sys
- Apply DWMWA_BORDER_COLOR = DWMWCP_NONE on every window focus
  event to suppress the Windows 11 accent border
- Fix clippy unnecessary_cast for HWND pointer
- Increase login-enlarged window size to 540x780
- Always show header (app icon + title) when enlarged
- Always show status text, refresh button, and back button
- Back button auto-resizes window to login size before navigating
- Cache available update info in update store (survives dialog dismiss)
- Show update banner on all pages after dismissing update dialog
- Banner auto-resizes window height with 50ms delay for smooth layout
- Banner is dismissible with × button
- Click banner text to re-open update dialog
- AboutTab reads cached update info — no manual re-check needed
- 'Update available' text in AboutTab is now clickable
- Added app.update_banner i18n key (EN/繁中/简中)
- Add 'auto-verify when complete' checkbox (default: on)
- When enabled, automatically submits after typing or pasting
  all 6 digits — no need to click Verify button
- On error, resets digits and refocuses first input
- Added login.totp.auto_submit i18n key (EN/繁中/简中)
Context menu now measures its own size after render and clamps
the position so it never overflows the window edge. Adds 8px
padding from all edges. Fixes the issue where right-clicking
accounts near the bottom-right corner caused menu items to be
cut off or rendered outside the visible area.
Use requestAnimationFrame instead of useLayoutEffect to ensure
the menu is fully painted before measuring its dimensions.
Adds 300px fallback height estimate for edge cases.
)

- open_customer_service now uses open_web_popup (internal WebView)
  instead of open::that (system browser)
- TW beans exchange no longer silently returns — opens
  m.beanfun.com/Deposite in internal WebView (same as old client)
All 4 tools now open in internal WebView popup:
- Report hack: event.beanfun.com/.../PlayerReport.aspx
- Royal patrol: event.beanfun.com/.../EventAD.aspx?EventADID=3453
- Starforce calc: brendonmay.github.io/starforceCalculator/
- Core calc: brendonmay.github.io/hexaCalculator/

Previously all 4 were disabled with no onClick handler.
Adds a toggle button next to 'Accounts' header to switch between
card view (2-column grid, current default) and list view (compact
single-column rows). Auto-defaults to list view when >4 accounts.

List view shows avatar initial, display name, and SN in a compact
row with copy button on hover. Both views support right-click
context menu and copy functionality.
- Add open_auth_popup command — authenticated WebView popup with
  native COM cookie seeding (reuses member popup pattern)
- Report hack now uses open_auth_popup so user doesn't need to
  re-login in the popup
- Royal patrol URL updated to beanfun-event.beanfun.com/EventAD_Mobile
- Core calculator URL updated to phantasmicsky.github.io/NodestoneBuilder
Frontend was calling commands.checkUpdate() in addition to
listening for the backend 'update-available' event, causing
the update dialog to appear twice. Now only listens for the
backend event.
Card/list toggle now saves to localStorage and restores on
next visit. Still auto-defaults to list when >4 accounts
if no saved preference exists.
Cookie seeding alone wasn't enough — the report page requires
beanfun auth. Now builds an auth.aspx URL with web_token
(same pattern as member/gash popups) so the user is
automatically authenticated in the popup.
Added cargo test, prettier --check, tsc -b, and corrected
clippy flags (--all-targets) to match ci.yml exactly.
@lshw54 lshw54 mentioned this pull request Apr 21, 2026
lshw54 added 8 commits April 22, 2026 01:01
listen() is async so the backend 'update-available' event can
fire before the listener is registered. Added a 3-second delayed
fallback that calls checkUpdate() if no event was received.
- Login window 350x580 -> 350x620 to fit QR page with banner
  and deeplink button without clipping status bar
- login-enlarged stays at 540x780
- open_auth_popup now seeds cookies for m.beanfun.com and
  login.beanfun.com in addition to existing hosts
- Add deeplink field to QrCodeData (Rust + TypeScript)
- Extract DeepLink/strUrl from InitLogin API response
- Add 'Copy Link' button next to Copy QR and Enlarge
- Buttons row uses flex-wrap for narrow windows
- Added login.qr.copy_deeplink i18n key (EN/繁中/简中)
Changed from shell open (system browser) to openWebPopup
(internal WebView popup window) for the report hack tool.
Changed from system browser to openAuthPopup so the deposit
page receives beanfun session cookies and doesn't require
the user to re-login.
Copy QR and Copy Deeplink were sharing the same 'copied' state,
so clicking Copy Deeplink showed 'Copied' on the QR button.
Now uses separate linkCopied state with green highlight on the
correct button.
Add 2-second delay before backend update check so the frontend
event listener is registered before the event fires. This also
prevents the black screen on startup caused by the proxy probe
running before the window is fully rendered.
@lshw54 lshw54 changed the title fix: window border, QR enlarge, update banner, TOTP auto-submit fix: UI improvements, tool buttons, update notification, QR deeplink (#13) Apr 21, 2026
@lshw54 lshw54 merged commit f313d9c into main Apr 21, 2026
3 checks passed
@lshw54 lshw54 deleted the fix/window-border-and-qr-enlarge branch April 21, 2026 17:18
@lshw54 lshw54 linked an issue Apr 22, 2026 that may be closed by this pull request
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.

bug 回報

1 participant