Feedback button

A Feedback button on every page lets signed-in people send a message, a voice note, or both, with a screenshot of what they see. Admins read everything in one inbox.

What it is

The button sits in the bottom right corner. Pressing it opens a panel and takes a screenshot behind it (the panel is not in the picture). The person types what happened or records a voice note, can remove the screenshot, and presses Send.

Sent with it, without asking: the page path (not the full address, which can carry codes) and title, the browser and system, screen and window size, whether the app is installed, and the language. The sender's name, email and phone are added on the server from their record.

The button shows only to signed-in people with an Arc CMS record, and never on admin pages.

Turn it on or off

The feedback button is core and belongs to no switchable feature. It has its own switch: Admin, Feedback, the switch at the top. It is off by default. A change takes effect on each person's next page load, with no deploy.

When it is off, the button is hidden and the security rules refuse new feedback too, so a script cannot keep sending it. The inbox and what was already sent stay.

Set it up

  1. Deploy the functions, Firestore rules, Storage rules and indexes (see Deploy).

  2. Open Admin, Feedback and turn the switch on.

  3. Sign in as a normal user, send a test, and check that it appears in the inbox and rings the admin bell.

Voice notes need https (or localhost). On a plain http address the record button is not shown and people can only type.

Use it

Voice notes

A voice note can be up to 2 minutes; recording stops by itself. The browser asks for the microphone the first time. Where the microphone is blocked, the panel says how to allow it, or to type instead. Where a browser cannot record at all, there is no record button.

BrowserRecords as
Safari (Mac, iPhone, iPad), recent Chrome and EdgeMP4, which plays everywhere
Firefox, older ChromeWebM or Ogg

The screenshot

It is drawn from the page itself, since a browser cannot capture the real screen without asking each time. It shows the visible part of the page, taken a moment after the tap, as a JPEG. Images still loading are left out, and so is any image or font that takes more than 2 seconds. If it cannot be made, the feedback is sent without it.

A game canvas (Phaser, WebGL) comes out blank unless the game keeps its drawing: set preserveDrawingBuffer: true in the renderer settings (in Phaser, render: { preserveDrawingBuffer: true }).

The inbox

Admin, Feedback (/admin/feedback) lists feedback newest first, filtered New, Done or All. Each item shows who sent it and when, the message, the voice note, the screenshot (open it full size), the page and the device. Mark done moves it out of New, Mark as new moves it back, and Delete removes it with its files.

Each new item rings the admin bell (notification type admin_new_feedback), for up to 10 items an hour from one person. Past that the feedback is still saved, without a notification. See Notifications.

Extend it

What it stores

WhereWhat
Feedback/{id}uid, userDocId, message (up to 5,000 characters), screenshotPath, voicePath, voiceSeconds, page, device, status (new or done), createdAt, and sender (name, email, phone), which only the server adds.
Storage users/{userDocId}/feedback/{id}/screenshot.jpg (JPEG, under 5 MB) and voice.mp4, voice.webm or voice.ogg (audio, under 10 MB), in the sender's own folder, under the install's upload folder if it has one.
Settings/feedback{ enabled }: the switch.

Cloud Function: onFeedbackCreated runs on each new Feedback document. It adds sender from the sender's record and notifies the admins. See Cloud Functions.

Deleting an account deletes the person's feedback and its files (see Users and roles).

Who can do what

ActionWho
Send feedbackA signed-in person with an Arc CMS record, while the switch is on. The rules check that it is theirs, new, points only at those two files in their own folder, and describes the page and device with the known fields only.
Upload the screenshot and voice noteThe sender, into their own folder, as new files only (never over an existing file).
Read, mark done, delete feedbackAdmins
Read the filesThe sender and admins
Turn the button on or offAdmins. Anyone can read Settings/feedback.

The inbox links only to pages on this site, and opens or deletes only the item's own files, whatever the stored paths say.

Troubleshooting

SymptomCause and fix
No button anywhereThe switch is off, the person is not signed in, or it is an admin page. After turning it on, reload the page.
No button for one signed-in personTheir token has no arccms_uid claim, such as another app's user with no Arc CMS record. Signing out and in again refreshes the claim for a person who has a record.
No record buttonThe page is not on https, or the browser cannot record.
"Could not send."The connection dropped, or the switch was turned off after the page loaded.
The inbox shows no sender nameIt shows "Someone": the onFeedbackCreated function is not deployed, or the sender's record has no name, email or phone.