Dashboard: centralized 401 sign-out, 429 retry handling, JSDoc types, and CSS tokens - #836
Open
LoneWolfxm wants to merge 4 commits into
Open
LoneWolfxm wants to merge 4 commits into
LoneWolfxm wants to merge 4 commits into
Conversation
|
@LoneWolfxm 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dashboard: centralized 401 sign-out, 429 retry handling, JSDoc types, and CSS tokens
What was solved
#682 — Dashboard: sign out automatically on 401 responses
Add centralized 401 handling to the dashboard API layer so that any request returning 401 clears the stored API key and returns the user to the sign-in gate with a clear message. This is a focused frontend change in the dashboard's api.js (and its session/state helpers if needed), keeping the key out of URLs, logs, and console output.
Addressed:
#683 — Dashboard: handle 429 rate-limit responses using
Retry-AfterUpdate the dashboard frontend to detect HTTP 429 rate-limit responses, parse the
Retry-Afterheader, surface a clear retry message to the user, and disable the refresh button until the retry window elapses. This is a client-side change in the static dashboard assets, keeping the existing error-handling flow and not touching API key handling.Addressed:
Retry-Afterheader from 429 responses (support both delta-seconds and HTTP-date forms as appropriate).#684 — Dashboard: add JSDoc types and
// @ts-checkAdd JSDoc
@typedefdeclarations for Payment and WebhookDelivery matching openapi.yaml, and enable// @ts-checkacross the dashboard's static JS modules so editors type-check without a build step. This is a type-annotation-only change to the static dashboard JavaScript files; no runtime behavior changes.Addressed:
@typedeffor Payment matching the Payment schema in openapi.yaml@typedeffor WebhookDelivery matching the WebhookDelivery schema in openapi.yaml// @ts-checkto each dashboard static JS module#685 — Dashboard: move colours and spacing into CSS custom properties
Refactor static/dashboard.css to introduce CSS custom properties (design tokens) on :root for colours and spacing, then replace hard-coded literal colour and spacing values throughout the stylesheet with var(...) references. This is a pure CSS tokenization change scoped to the dashboard stylesheet, supporting future dark-mode theming without altering markup or JS behaviour.
Addressed:
Changes
static/dashboard.html(modify)static/state.js(modify)static/session.js(modify)static/dashboard-theme.js(modify)Approach
Retry-After#683 — Dashboard: handle 429 rate-limit responses usingRetry-After(Changed: static/dashboard.html)// @ts-check#684 — Dashboard: add JSDoc types and// @ts-check(Changed: static/state.js)Issues
Closes #682
Closes #683
Closes #684
Closes #685