Skip to content

Refactor dashboard client: session helpers, shared state, and async/await - #837

Merged
graceuvala-collab merged 4 commits into
StellarGateLabs:mainfrom
Gadflyxx:drips/678-679-680
Oct 2, 2026
Merged

graceuvala-collab merged 4 commits into
StellarGateLabs:mainfrom
Gadflyxx:drips/678-679-680

Conversation

@Gadflyxx

Copy link
Copy Markdown
Contributor

Summary

Refactor dashboard client: session helpers, shared state, and async/await

What was solved

#678 — Dashboard: extract API key storage into session.js

Extract the API key storage/expiry helpers (storedKey, storeKey, forgetKey) from the dashboard code into a new static/session.js module, preserving the #252 expiry behaviour exactly, and wire it up so the dashboard continues to work without leaking the key.

Addressed:

#679 — Dashboard: add a single state object for filter, cursor and selection

Introduce a single shared state object for the dashboard that holds active filters, pagination cursor, loaded rows, and the selected payment, exposing a small get/set/subscribe API in static/state.js, and refactor static/dashboard.js to render from that state instead of ad-hoc DOM reads.

Addressed:

  • Changed: static/state.js
  • Create static/state.js with a small get/set/subscribe API for dashboard state
  • State must hold active filters, pagination cursor, loaded rows, and selected payment in one place
  • Refactor static/dashboard.js to render from state instead of ad-hoc DOM reads

#680 — Dashboard: convert promise chains to async/await

Convert the five promise-chain functions in the dashboard client (loadPayments, openDetail, loadDeliveries, loadVersion, pollHealth) to async/await with try/catch, preserving existing behavior, error handling, and the no-API-key-in-URL/log guarantee.

Addressed:

  • Changed: README.md
  • Rewrite loadPayments, openDetail, loadDeliveries, loadVersion and pollHealth from .then() chains to async/await with try/catch
  • Preserve existing behavior, return values, and error handling semantics of each function
  • Do not introduce API keys into URLs, log lines, or console output

Changes

  • static/session.js (modify)
  • static/state.js (modify)
  • README.md (modify)

Approach

  1. Dashboard: extract API key storage into session.js #678 — Dashboard: extract API key storage into session.js (Changed: static/session.js, static/session.js, static/session.js)
  2. Dashboard: add a single state object for filter, cursor and selection #679 — Dashboard: add a single state object for filter, cursor and selection (Changed: static/state.js)
  3. Dashboard: convert promise chains to async/await #680 — Dashboard: convert promise chains to async/await (Changed: README.md)

Issues

Closes #678
Closes #679
Closes #680

@drips-wave

drips-wave Bot commented Sep 29, 2026

Copy link
Copy Markdown

@Gadflyxx Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@graceuvala-collab
graceuvala-collab merged commit f27c04d into StellarGateLabs:main Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants