Repository navigation
feat(ui): render message action buttons (client::action, #494) - #1088
Conversation
82bf124 to
b8e5d8a
Compare
b8e5d8a to
741ea98
Compare
|
I've made some changes and:
Could you have a look at it? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1088 +/- ##
=======================================
Coverage 81.82% 81.82%
=======================================
Files 69 69
Lines 3290 3290
=======================================
Hits 2692 2692
Misses 598 598 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Matches the changes in gotify/server#1088.
|
Thanks a lot, your changes look good to me. Types, lint, unit and e2e tests pass locally. I added two commits on top:
I've updated the docs in gotify/website#108 to match ( |
|
The extra validation is okay, but please remove the open URL thingy. This should be already covered by a normal markdown link, therefore I don't want to include this right now. |
The open url buttons were dropped from gotify/server#1088, a markdown link covers that use case. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TfcCbQtufdKZ9AtMjeVvch
|
Removed the open URL buttons in 3d2cd75 and updated the docs in gotify/website#108. Ready to merge from my side. |
3d2cd75 to
c076aa5
Compare
Render the HTTP action buttons defined in extras["client::action"].buttons as proposed in gotify#494. Clicking a button sends the configured request via fetch (method, url, headers, body). Only http(s) URLs are accepted, invalid buttons are skipped and reported in a warning. Cookies are not sent (credentials: omit) and the result is reported via a snackbar.
c076aa5 to
624d040
Compare
Implements the web UI part of #494 using the format from #494 (comment).
Behavior
METHOD host.fetch(method, url, headers). The button is disabled while the request runs, and the result is reported in a snackbar (success, HTTP error status, or network/CORS error).methodis case-insensitive and defaults toPOST. Allowed methods areGET,POST,PUT,PATCHandDELETE.Safety
http:/https:URLs are accepted, sojavascript:,data:and similar URLs are dropped.credentials: "omit"andreferrerPolicy: "no-referrer"are set, so no cookies or Gotify URL leak to the target.Access-Control-Allow-OriginandAccess-Control-Allow-Headersfor custom headers). I'll document this in a docs PR for gotify/website, so other clients (Android, iGotify) can follow the same format.Tests
src/message/extras.test.ts: unit tests for parsing and validation.src/tests/message-actions.test.ts: e2e test with a local HTTP target. It checks that the buttons render, that a click sends the right method, path and header, and that the success and failure snackbars appear.CI=true yarn test) passes locally, along withtsc,lintandtestformat.I haven't touched the Android client.