Repository navigation
Add "Copy as Markdown" button to support ticket message - #462
Merged
Merged
Conversation
Adds a hint action beside the Message label on the admin ticket view that copies the initial message to the clipboard as Markdown, converting any ASCII tables (native:doctor environment dumps) into Markdown tables so they render when pasted into GitHub issues or an LLM. The ASCII table walker is generalised so the HTML and Markdown renderers share one parser; HTML output is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
simonhamp
marked this pull request as ready for review
August 5, 2026 08:49
SimonTingle
pushed a commit
to SimonTingle/nativephp.com
that referenced
this pull request
Sep 19, 2026
Adds a hint action beside the Message label on the admin ticket view that copies the initial message to the clipboard as Markdown, converting any ASCII tables (native:doctor environment dumps) into Markdown tables so they render when pasted into GitHub issues or an LLM. The ASCII table walker is generalised so the HTML and Markdown renderers share one parser; HTML output is unchanged. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
What
Adds a Copy as Markdown button beside the Message label on the admin support ticket view (
SupportTicketResource→ Context section).Clicking it copies the ticket's initial message to the clipboard as Markdown, converting any ASCII tables it contains into real Markdown tables.
Why
Support tickets submitted for Mobile/Desktop are auto-composed as Markdown, and the
Environment:section usually contains an ASCII table pasted fromnative:doctor:Copying that straight out of the admin panel gives you either rendered HTML or an ASCII blob. This gives one click to get something that renders properly when pasted into a GitHub issue or handed to an LLM.
How
SupportTicketResource::ticketMessageAsMarkdown()does the conversion. The rest of the message passes through untouched, since it's already Markdown.convertAsciiTables($message, $renderTable), with row parsing extracted toparseAsciiTable(), so the HTML and Markdown renderers share one parser. HTML output is byte-identical — the existing rendering tests pass unchanged.+---+separator after row 1 keep that row as the Markdown header. Key/value tables without one get an empty header row, since Markdown requires a delimiter row to be a table at all. Ragged rows are padded to the widest row.hintActionusingactionJs(), so the copy is entirely client-side — no round-trip. Confirms with a$tooltip('Copied as Markdown'), mirroring Filament's own copy behaviour. Hidden when the message is empty.Security
The message is embedded in the click handler via
Js::from()— the same mechanism Filament's built-incopyable()uses. It hex-escapes quotes, angle brackets and ampersands, so user-submitted content can't break out of the attribute.Notes
navigator.clipboardrequires a secure context (HTTPS).Tests
7 new tests in
tests/Feature/SupportTicketTest.php:+lines left alonephp artisan test tests/Feature/SupportTicketTest.php→ 95 passed (302 assertions). Pint clean.🤖 Generated with Claude Code