Skip to content

worker: sticky top bar with an always-visible Download button#12

Merged
Aswinmcw merged 3 commits into
mainfrom
topbar-download
Jul 14, 2026
Merged

worker: sticky top bar with an always-visible Download button#12
Aswinmcw merged 3 commits into
mainfrom
topbar-download

Conversation

@Aswinmcw

Copy link
Copy Markdown
Member

Why

The download button existed but was position:fixed; bottom:16px — on the tall A4 page it floated at the bottom-right, below the fold or blending into the grey margin, so it was easy to miss (which is exactly what happened).

What

Replaces the floating button with a sticky navy top bar: "Aswin · Software Engineer" on the left, gold ↓ Download PDF on the right — always visible above the resume sheet. On phones the bar collapses to name + button.

Verified (screenshots)

  • Desktop: full-width bar above the centered A4 sheet, button top-right.
  • Mobile: bar collapses cleanly; button prominent.
  • Screen-only styling → PDF render path untouched (still 1 A4 page).
  • tsc --noEmit clean; wrangler deploy --dry-run binds BROWSER + PDF_CACHE.

This PR will also get a live preview URL now that per-PR previews work — check the bar/button on it before merging.

The download button was position:fixed bottom-right, so on the tall A4 page it
sat below the fold / blended into the margin and was easy to miss. Replace it
with a sticky navy top bar (name + role left, gold Download PDF button right)
that's always visible above the resume sheet. On phones the bar collapses to
name + button. Screen-only (@media screen); PDF render path untouched (still
1 page). tsc clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Aswinmcw
Aswinmcw requested review from a team and Aswin-coder as code owners July 14, 2026 04:04
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
resume a697e88 Commit Preview URL

Branch Preview URL
Jul 14 2026, 04:26 AM

@Aswincloud-Bot Aswincloud-Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: @Aswinmcw is a member of @Aswincloud/admins.

Aswin-coder and others added 2 commits July 14, 2026 04:15
The sticky top bar rendered behind the resume's <body> split-gradient and the
.page grid (both start at y=0), so it was invisible. Switch to position:fixed
with its own solid navy background over the gradient, higher z-index, and
html{padding-top:52px} to reserve space so the sheet sits below the bar.
Verified rendered: bar visible at top, no overlap. PDF still 1 page.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…S comment)

webPage() injected the head first, then did resumeHtml.replace(/<body>/i, ...)
to drop the top bar after the body tag. But the injected head's CSS carried a
comment mentioning "<body>" ("...linear-gradient painted on <body>..."), and
that literal string sits earlier in the document than the real <body> tag — so
the replace hit the comment instead. The bar was spliced into the middle of a
CSS comment, so #topbar never entered the DOM and never showed.

Fix: inject the bar into the RAW resume (whose only "<body>" is the real tag)
BEFORE adding the head, and reword the comment to say "the page background"
instead of "<body>" so no head prose can ever collide with the regex again.

Verified locally via `wrangler dev`: exactly one <body>, #topbar present as a
real fixed element (position:fixed, top:0, height:52). PDF route is unaffected
(it renders RESUME_HTML directly, not webPage()).
@Aswinmcw
Aswinmcw merged commit 3cf0ff0 into main Jul 14, 2026
2 checks passed
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.

3 participants