Skip to content

Added Succesful Report Toast#567

Merged
mrjvs merged 6 commits into
PretendoNetwork:devfrom
DevDrew64:dev
Jul 10, 2026
Merged

Added Succesful Report Toast#567
mrjvs merged 6 commits into
PretendoNetwork:devfrom
DevDrew64:dev

Conversation

@DevDrew64

@DevDrew64 DevDrew64 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Resolves #454

Changes:

Summary: Adds a toast notifcation confirming successful post reports, replacing the full-page redirect on report submission.

Problem: Previously, submitting a report via the report modal triggered a native HTML form POST which caused the entire page to reload, giving no feedback to the user that their report was successful.

Modifcations:

  1. New file: apps/juxtaposition-ui/webfiles/web/js/toast.ts
    Extracted the Toast, initToast, and startHideToast functions out of web.js into their own module so they can be imported and reused by other client-side modules (previously they were bare, non-exported function declarations only usable within web.js itself).

  2. Modified web.js to remove the local Toast and initToast function declarations as I moved them to toast.ts.

  3. Modified reports.js to invlude the moved toast logic and trigger it when a report is made.

  4. Modified apps/juxtaposition-ui/src/services/juxt-web/routes/console/posts.tsx to handle reports without triggering a refresh of the page.

Created a dedicated typescript for toasts, added a toast that appears following a successful report that negates the need for a client redirect.
@CLAassistant

CLAassistant commented Jul 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Added NewLine at EOF in toast.js and reports.js, removed redundant function declaration in web.js

@mrjvs mrjvs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Found a couple bugs in testing, but nothing that’s hard to fix :D

Comment thread apps/juxtaposition-ui/webfiles/web/js/reports.js
Comment thread apps/juxtaposition-ui/src/services/juxt-web/routes/console/posts.tsx Outdated
Comment thread apps/juxtaposition-ui/webfiles/web/js/toast.ts
mrjvs and others added 3 commits July 7, 2026 21:00
As suggested, used API=true in the url to indicate usage of the webui rather than console version triggering the toast logic rather than a redirect, whilst still alowing redirects to be used for the console versions.

Also removed redundant toast logic from login.js as suggested.

@mrjvs mrjvs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just linting left 👍

(tip: You can run auto-fix linting by running npm run lint:fix in the project folder)

Used autolint (thanks for the tip!)
@mrjvs
mrjvs merged commit 20c0812 into PretendoNetwork:dev Jul 10, 2026
7 checks passed
@mrjvs

mrjvs commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! We're doing a release tomorrow, so your changes are gonna be in prod nice and quick.

@mrjvs mrjvs mentioned this pull request Jul 11, 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

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Add "Report Sent" pop-up

3 participants