paste-bin/ui/index.html
Jarian 985e070757 port: FastAPI rewrite built by the arch-llm spec pipeline
Spec-first port of the Flask app (still on main):
- schema.arch: signed arch-llm spec (single source of truth)
- paste_bin/: generated FastAPI backend, verified 51/51 frozen owner
  tests, 92.5% coverage (build r3, 2026-11-18)
- ui/: SPA + emitted OpenAPI contract (openapi.json + generated
  client.js); the app calls only window.PasteBinAPI
- 7 old bugs fixed (file raw 500, silent expiry, AVI-as-webp,
  stripped content, limiter leak, trusted mimetype, stale tmp)
- 62/62 live probe green; /health + JSON index added; JSON API

Full report on the wiki: 'FastAPI port (arch-llm pipeline)'.
2026-11-18 23:00:23 +00:00

139 lines
5.6 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>paste-bin</title>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='.9em' font-size='90'%3E📋%3C/text%3E%3C/svg%3E">
<link rel="stylesheet" href="/styles.css">
</head>
<body>
<header class="topbar">
<div class="topbar-inner">
<div class="brand">
<span class="brand-mark" aria-hidden="true">📋</span>
<span class="brand-name">paste<span class="accent">-bin</span></span>
<span class="brand-tag" id="brandTag">spec → openapi → client → ui</span>
</div>
<div class="topbar-status">
<span id="healthPill" class="pill pill-pending" title="GET /health"><span class="dot"></span>api…</span>
<a id="contractBadge" class="pill pill-badge" href="/openapi.json" target="_blank" rel="noopener" title="OpenAPI contract">v—</a>
</div>
</div>
</header>
<main class="shell">
<!-- ============ create ============ -->
<section class="card" aria-labelledby="createTitle">
<div class="card-head">
<h2 id="createTitle"><span class="dot"></span>New paste</h2>
</div>
<div class="seg" id="typeSeg" role="tablist" aria-label="paste type">
<button class="seg-btn on" data-t="text" role="tab" aria-selected="true">Text</button>
<button class="seg-btn" data-t="image" role="tab" aria-selected="false">Image</button>
<button class="seg-btn" data-t="file" role="tab" aria-selected="false">File</button>
</div>
<div class="field-row">
<div class="field">
<label for="title">Title <span class="opt">optional</span></label>
<input type="text" id="title" placeholder="unnamed paste" maxlength="200" autocomplete="off">
</div>
<div class="field field-narrow">
<label for="expiry">Expiry</label>
<select id="expiry">
<option value="1h">1 hour</option>
<option value="1d" selected>1 day</option>
<option value="1w">1 week</option>
<option value="1m">1 month</option>
<option value="forever">Never</option>
</select>
</div>
</div>
<div id="paneText">
<label for="content">Content</label>
<textarea id="content" spellcheck="false" placeholder="Paste your text here…"></textarea>
<div class="charcount"><span id="charCount">0</span> chars</div>
</div>
<div id="paneFile" hidden>
<div id="dropzone" tabindex="0" role="button" aria-label="choose a file">
<div class="dz-idle" id="dzIdle">
<div class="dz-icon" aria-hidden="true">⬆</div>
<div class="dz-text">Drop a file here, or <span class="accent">browse</span></div>
<div class="dz-sub" id="dzSub">png · jpeg · gif · bmp · webp · svg · tiff — max 20 MB</div>
</div>
<div class="dz-preview" id="dzPreview" hidden>
<img id="dzThumb" alt="" hidden>
<div class="dz-file-ico" id="dzFileIco" hidden aria-hidden="true">📄</div>
<div style="min-width:0">
<div class="dz-name" id="dzName"></div>
<div class="dz-sub" id="dzMeta"></div>
</div>
<button class="dz-remove" id="dzRemove" title="Remove file" aria-label="Remove file">×</button>
</div>
</div>
<!-- visible to the a11y tree (Chromium renders file inputs as buttons);
the dropzone is the styled affordance, this drives the picker -->
<input type="file" id="fileInput" style="position:absolute;width:1px;height:1px;opacity:0;pointer-events:none"
aria-label="file upload input">
</div>
<div class="card-actions">
<button class="btn btn-primary" id="createBtn">Create paste</button>
<span class="hint" id="createHint"></span>
</div>
</section>
<!-- ============ view ============ -->
<section class="card" aria-labelledby="viewTitle">
<div class="card-head">
<h2 id="viewTitle"><span class="dot"></span>View a paste</h2>
</div>
<div class="open-row">
<input type="text" id="openId" class="mono" placeholder="16-hex id — e.g. 21804754ee2c4e6e" spellcheck="false" autocomplete="off" aria-label="paste id">
<button class="btn btn-ghost" id="openBtn">Open</button>
</div>
<div class="field-err" id="openErr" hidden></div>
<div class="stage" id="stage" aria-live="polite">
<div class="stage-empty">
<div class="stage-empty-ico" aria-hidden="true">📋</div>
<div>Open a paste to see it here.</div>
<div class="stage-empty-sub">text · image · file — with raw &amp; download links</div>
</div>
</div>
<div class="view-meta" id="viewMeta" hidden></div>
<div class="view-actions" id="viewActions" hidden>
<a class="btn btn-ghost btn-sm" id="actRaw" target="_blank" rel="noopener">Raw</a>
<a class="btn btn-ghost btn-sm" id="actDownload">Download</a>
<button class="btn btn-ghost btn-sm" id="actCopyJson">Copy JSON</button>
<button class="btn btn-ghost btn-sm" id="actCopyId">Copy ID</button>
</div>
<div class="recent">
<div class="recent-head">
<span>Recent — this browser</span>
<button class="linklike" id="recentClear" hidden>clear all</button>
</div>
<div class="chips" id="chips">
<span class="chips-empty" id="chipsEmpty">nothing yet — pastes you create land here</span>
</div>
</div>
</section>
</main>
<div class="toasts" id="toasts" aria-live="polite"></div>
<script src="/client.js"></script>
<script src="/app.js"></script>
</body>
</html>