Skip to content

fix(filesharing): inline cancel button, fit responsive QR to parent#222

Merged
rubenhensen merged 2 commits into
mainfrom
fix/inline-cancel-and-qr-overflow
May 16, 2026
Merged

fix(filesharing): inline cancel button, fit responsive QR to parent#222
rubenhensen merged 2 commits into
mainfrom
fix/inline-cancel-and-qr-overflow

Conversation

@rubenhensen
Copy link
Copy Markdown
Contributor

Summary

  • Inline the upload cancel control inside the progress box as a small red rectangular button, matching the PostGuard style instead of the previous mismatched gradient pill.
  • Make the responsive Yivi QR (YiviQRCode with responsive) scale to fit its parent (width: 100%; max-width: 330px; aspect-ratio: 1/1) so it no longer overflows the decrypt card on narrow layouts.

Test plan

  • Encrypt flow: while files are uploading, the cancel button sits inside the progress box on the right; clicking it aborts and returns to file selection.
  • Download page on a narrow viewport: the QR stays inside the "Decrypt with Yivi" card with no horizontal overflow.
  • Download page on a wide viewport: the QR remains capped at 330px and stays square.

@rubenhensen
Copy link
Copy Markdown
Contributor Author

/dobby review

Copy link
Copy Markdown
Contributor

@dobby-coder dobby-coder Bot left a comment

Choose a reason for hiding this comment

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

Reviewed the diff and the surrounding context.

SendButton.svelte — inline cancel button

  • Moving the cancel control into .upload-info-content reads naturally with .upload-info-label { flex: 1 } pushing it to the right.
  • Styling uses existing tokens (--pg-input-error, --pg-on-primary, --pg-font-weight-medium, --pg-border-radius-sm), so it stays consistent with PostGuard design language rather than introducing a one-off colour.
  • Good a11y bits: type="button", :focus-visible outline, :disabled styling honouring encryptState.selfAborted. Translation key filesharing.cancel reused.
  • all: unset is a sensible reset for a fully custom button; box-sizing: border-box is kept explicitly afterward, which is the right pattern.

YiviQRCode.svelte — responsive sizing

  • width: 100%; max-width: 330px; aspect-ratio: 1/1 matches the fixed 330×330 used in the non-responsive variant, so the upper bound is unchanged.
  • The existing :global(canvas), :global(svg) { width: 100% !important; height: auto !important } already handled inner sizing, so the container fix is the missing piece.

Minor (non-blocking): min-height: 200px combined with aspect-ratio: 1/1 will break the square ratio if the parent container is ever narrower than 200px (height would clamp at 200 while width drops below). The decrypt card layout in /download is unlikely to hit that on real devices, so this is just a note — no action needed.

Approving. Once arm64 build comes back green, this is good to merge.

@rubenhensen rubenhensen merged commit 92e61c5 into main May 16, 2026
7 checks passed
@rubenhensen rubenhensen deleted the fix/inline-cancel-and-qr-overflow branch May 16, 2026 13:48
@dobby-coder
Copy link
Copy Markdown
Contributor

dobby-coder Bot commented May 16, 2026

Dobby sees the review request, sir! Dobby will look at the cancel-button move and the responsive QR sizing and report back.

Copy link
Copy Markdown
Contributor

@dobby-coder dobby-coder Bot left a comment

Choose a reason for hiding this comment

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

Reviewed post-merge. Both changes look good:

  • SendButton cancel button: Move from the standalone gradient pill to an inline red button inside the progress box is a clean visual fix. Uses all: unset correctly with type="button", keeps :focus-visible, :hover, and :disabled states. color-mix for the hover tint is fine — supported across all targeted browsers per the existing usage in this repo.
  • YiviQRCode responsive: width: 100%; max-width: 330px; aspect-ratio: 1/1 is the right idiom for the responsive variant; preserves the 330px cap on wide layouts and stops overflow on narrow ones without needing JS sizing.

One small note (non-blocking, pure observation): --pg-input-error in dark mode is #de3030, which against white text at font-size-sm is around the 4.5:1 WCAG AA threshold for small text. Worth eyeballing in dark mode if anyone is nearby; not a regression from before, since the previous cancel button was also a colored pill.

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