Skip to content

feat(ui): seven quick actions on the homepage — operations visible before upload - #145

Merged
MrChengLen merged 1 commit into
mainfrom
pr-homepage-quick-actions
Sep 25, 2026
Merged

MrChengLen merged 1 commit into
mainfrom
pr-homepage-quick-actions

Conversation

@MrChengLen

Copy link
Copy Markdown
Owner

What

Step 2 of making operations visible: the homepage now shows seven quick actions before any file is chosen.

  • The chips: under the drop zone, an "Or choose directly" label with seven chip links, followed by an "All tools →" link:

    • Compress PDF
    • JPG to PDF
    • Word to PDF
    • Split PDF
    • Extract PDF pages
    • HEIC to JPG
    • Compress image (KB/MB)

    Every chip goes to a page that already exists.

  • Homepage only: /compress and the 12 /convert/<pair> pages render the same partial, so a show_quick_actions flag keeps the chips off those pages.

  • No inline JS:

    • The links are in the initial HTML.
    • app.js hides the chip row while files are selected and shows it again when the selection is cleared.
  • Removed: the "More tools" box. Its links now live in the chips.

  • Subline: now includes "PDF".

  • Redact: no longer teased on the homepage. The footer and /tools still link it when it is enabled.

  • Catalogs: scripts/i18n.py update now passes --ignore-obsolete, so removed strings no longer pile up in them.

Why

Before a file was chosen, the homepage showed no concrete operation, only the toggle and an empty dropdown. The PDF tools were small text links below the fold.

Deliberately not in this PR

  • Category links (PDF · Images · …): they need matching sections on /tools, which come in the next step.
  • Toggle, dropdown, Convert button: the later Smart-Drop step replaces them.

Verification

  • Checks:
    • Full suite: 1230 passed, 63 skipped.
    • ruff, format, template-class gate and i18n drift are clean, with 0 fuzzy and 0 obsolete entries.
    • The Tailwind bundle tailwind.86732528.css rebuilds to identical output.
  • Browser, at 1280 px and 375 px:
    • Two chip rows on desktop, 44 px chips on mobile, no horizontal scroll.
    • Chips are absent on /compress and on a pair page.
    • After selecting a PDF, the chips hide and the Convert button moves up about 345 px; they come back after clearing.
  • Reviews:
    • security-auditor: pass.
    • code-reviewer: its nits are applied — hide on file selection, CHANGELOG wording, exact link test, outline tests moved to their own file, obsolete catalog entries dropped, focus ring on "All tools".
  • Rebase: rebased onto fix: FAQ, llms.txt, JSON-LD and README list every format — pinned to registry #143. The catalogs were regenerated and every other file matches the reviewed version byte for byte.

🤖 Generated with Claude Code

…fore upload

Before a file was chosen, the homepage's tool card offered no concrete
operation — just the Convert/Compress toggle and an empty target-format
dropdown — and the PDF tools sat as small text links in a "More tools" box
below the fold. First visible step of surfacing operations earlier:

- The tool card now shows, under the drop zone, an "Or choose directly" label
  with seven chip links — Compress PDF, JPG to PDF, Word to PDF, Split PDF,
  Extract PDF pages, HEIC to JPG, Compress image (KB/MB) — and "All tools →".
  Every chip targets a page that already exists; "(KB/MB)" says file size,
  since pixel resizing isn't built.
- Homepage-only: partials/convert_tool.html also renders /compress and the 12
  /convert/<pair> pages, so a show_quick_actions flag set only by index()
  keeps self-links and a diluted row off them.
- Server-rendered <nav> + list of <a>, no inline JS (CSP), links always in
  the initial HTML (IA invariant G6). The chips are an idle-state shortcut:
  app.js setQuickActionsVisible() hides them once files are chosen and shows
  them again when the selection is cleared — otherwise they pushed the
  Convert button ~345 px down on a phone (found in review).
- Secondary chip styling so Convert stays the card's only brand-filled
  control; 44 px touch targets; label text-gray-400 (6.9:1) and
  brand-light link (5.9:1) for AA contrast; focus ring on every link.
- The "More tools" box is removed (its links live in the chips); the subline
  gains "PDF". Redact is no longer teased on the homepage — footer and /tools
  still link it when enabled, and it never belongs among idle chips (free
  path before paid).
- scripts/i18n.py update passes --ignore-obsolete, so removed msgids are
  dropped instead of piling up as "#~" blocks (none since c8fc734).

Deferred on purpose: category links (PDF · Images · …) until /tools has
matching sections; the toggle, dropdown and Convert button until the
Smart-Drop step replaces them.

Tests: test_homepage_quick_actions.py replaces test_homepage_more_tools.py —
exact link list on /en and /de, localized labels without leakage, absent on
/compress and a pair page, every target answers 200, <main> never links
/redact, app.js hides/shows the row; the heading-outline guards moved to
test_homepage_outline.py (h2 pins 4/5/4). Rebased onto #143 (catalogs
regenerated, 0 fuzzy, 0 obsolete). Browser-checked at 1280 px and 375 px,
including the file-selected state.

Full suite 1230 green (63 skipped); ruff + format + template-class gate +
i18n-drift clean; Tailwind bundle tailwind.86732528.css reproducible.
Reviewed by security-auditor (pass) and code-reviewer (nits applied).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MrChengLen
MrChengLen merged commit 4dcd69d into main Sep 25, 2026
5 checks passed
@MrChengLen
MrChengLen deleted the pr-homepage-quick-actions branch September 25, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant