Frontend rewrite: Tailwind, polished home + endpoint, copy/highlight/send-test, JS extracted#30
Merged
Merged
Conversation
CSS / styling - Drop simple.css (jsDelivr) and the hand-rolled utility set in public/index.css (deleted). Switch to Tailwind v4 via Play CDN. - Light-only theme; modern slate/indigo/emerald/rose palette for HTTP method badges replaces the old CSS named colors. JavaScript - Move all inline <script> blocks out of endpoint.html into static files: public/index.js (helpers), public/endpoint.js (Alpine store + WebSocket + favicon/title indicator + send-custom-request), public/home.js (recent endpoints panel). - Drop the WS/Alpine race-handling workaround by registering Alpine.data and Alpine.store inside an alpine:init listener. App scripts load before Alpine so listeners attach before Alpine fires its first event. - Replace setInterval loading-dots with a CSS keyframe animation injected by index.js. UX/UI - Mobile fix: drop hidden sm:flex on the URL row and curl example. Layout uses Tailwind responsive utilities so everything stays visible on small screens. - Copy-to-clipboard buttons on the endpoint URL, request body, and request headers JSON. The URL button flashes "Copied!" via a reactive label. - Tab title and favicon dot indicator: while the tab is hidden, each new WS-delivered request increments an unread counter shown in the title and marks the favicon. visibilitychange resets both. - Endpoint history in localStorage (key httphq:recent-endpoints, capped at 5). Home page shows a "Recently created" panel that links back. - Send-test-request panel inside a <details>: pick method, write headers (Key: Value lines), write body, submit. Replaces the canned curl link. - Method-based filter dropdown above the search input. Combined with the existing server-side LIKE search. - Syntax highlighting for JSON and XML bodies via highlight.js (browser bundle, CDN-pinned with SRI). JSON bodies are also pretty-printed. - Remove the Google-search-WHOIS link on captured IPs and the google-search-by-name link on header keys. Render plain text instead. Server - Update CSP to drop script-src 'unsafe-inline' (no inline scripts left), allow unpkg + cdn.jsdelivr.net for the new CDN-served scripts/styles. Keep 'unsafe-eval' for Alpine and Tailwind Play CDN. Tests - Expand Playwright suite from 20 to 28 specs covering: copy buttons (URL, body, headers) writing the right data to the clipboard; method filter; send-test-request panel; syntax highlighting (JSON + XML token presence); recent-endpoints panel; tab-title indicator under simulated visibility change. Grant clipboard permissions in playwright.config.
Home page
- Tighter hero: shorter headline ('Inspect HTTP requests in real time'),
one-line subtitle, larger CTA with arrow icon
- Add Common use cases section with six cards (test webhooks, inspect form
payloads, debug API integrations, mobile/IoT, verify cron jobs, share
captures). Icons unified in indigo (brand color)
- Remove the recently-created localStorage panel (deleted public/home.js,
recentEndpoints helper, related script tag, and tests)
- Replace em-dashes with regular punctuation throughout
Endpoint page
- Stack Method dropdown above Headers textarea in send-test panel (was
side-by-side at sm+)
- Align Details and Headers value columns: both use grid-cols-[10rem_1fr]
so values line up vertically across the two sections
Polish across pages
- Buttons, summaries and role=button get cursor:pointer (Tailwind v4
doesn't set it by default)
- Native selects use a custom SVG chevron via the .app-select class so the
caret sits next to the value rather than at the field's right edge
- Disclosure chevron in 'Send a test request' moved next to the title
- Focus rings dialed back from ring-2 to ring-1 with ring-indigo-400
- Contact page wrapped in a card with placeholders, autocomplete hints,
and a footer row with helper text + submit button
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
Rewrites the frontend for clarity and adds a focused UX-improvement set, while keeping the backend untouched.
Styling
simple.cssand the hand-rolled utility CSS inpublic/index.css(deleted). Switch to Tailwind v4 via Play CDN, light theme only.ring-2toring-1 ring-indigo-400everywhere; native<select>arrows replaced with a custom SVG chevron anchored next to the value (.app-selectclass); buttons and<summary>getcursor: pointerglobally (Tailwind v4 doesn't set it by default).JavaScript
<script>blocks lifted out ofendpoint.htmlinto static files:public/index.js— shared helpers (formatTimeAgo,renderBody,copyToClipboard,parseHeaderLines, loading-dots + cursor + select-chevron CSS injection).public/endpoint.js— Alpine store, WebSocket subscriber, custom request submit, favicon/title indicator. Registers viaAlpine.data/Alpine.storeinside analpine:initlistener; app scripts load before Alpine so listeners attach before Alpine's first dispatch.setIntervalloading-dots replaced with a CSS keyframe.Home page
Endpoint page
hidden sm:flexfrom the URL row and send-test panel; everything stays visible at small widths.visibilitychange.<details>): pick method, write headers (Key: Valuelines), write body, submit. Method and Headers stack vertically.grid-cols-[10rem_1fr]so values line up vertically across the card.Contact page
autocompletehints, and a divider row of helper text + submit button.Server
script-src 'unsafe-inline'(no inline scripts left), addedhttps://cdn.jsdelivr.netfor the CDN-pinned Tailwind + highlight.js.'unsafe-eval'still required by Alpine and the Tailwind Play CDN.Tests
visibilitychange, common use cases section. Clipboard permissions granted inplaywright.config.ts.Test plan
testworkflow green (go test, Playwright)releaseworkflow republishesghcr.io/formspark/httphq:<tag>after mergeNote on Tailwind Play CDN
The Play CDN is dev-grade (compiles utilities at runtime, prints a console warning). Fine for shipping; for a production-hardening pass we'd swap to the standalone Tailwind CLI in the Dockerfile builder stage and ship a precompiled CSS file. Out of scope here.