Skip to content

Commit df3ed53

Browse files
fix: consolidated site UX & content fixes (#202)
* fix: opt RSS link out of client-side navigation Closes #183 The blog RSS button used a SvelteKit anchor with no reload hint. The (marketing) layout sets trailingSlash: 'always', which causes the client router to redirect /blog/rss.xml to /blog/rss.xml/ on client-side navigation. The +server.js endpoint is prerendered to a file at /blog/rss.xml, so the trailing-slash form falls through to the SPA shell (or errors), and visitors saw a 500. Adding data-sveltekit-reload makes the browser perform a full navigation, bypassing the client router so the static file is served directly. Direct URLs already worked because they are not subject to the router's trailing-slash rewrite. * fix: extend cryptify retry budget to cover restart window The default pg-js retry policy (5 attempts, 500ms initial delay, multiplier 2) exhausts in ~7.5s of total wait time. That's shorter than a typical cryptify service restart, so users see a hard failure during what should be a recoverable outage. Bump maxAttempts to 8 and initialDelayMs to 1000ms so the retry budget covers ~90s of total wait — long enough to ride out a restart while still failing fast for genuinely down backends. Closes #181 * fix: prevent light-mode flash on initial page load Add a synchronous inline script in app.html that reads the user's theme preference (localStorage 'preferredtheme', falling back to prefers-color-scheme) and applies the .dark class to <html> before the browser paints. Previously the class was only set during Svelte hydration, causing a brief light-mode flash on every refresh in dark mode. Closes #180 * fix: add cancel button during file upload (#182) Closes #182. The encryption/upload progress UI rendered by SendButton exposed only a spinner and progress bar; users had no in-app way to abort a long upload. Adds a Cancel button to the upload-info-box that calls AbortController.abort() on the existing encryption/upload signal, flips selfAborted so the catch path resets to FileSelection, and provisions a fresh AbortController for the next attempt. * fix(blog): tone down exclamation marks in May update post Closes #184 --------- Co-authored-by: dobby-yivi-agent[bot] <275734547+dobby-yivi-agent[bot]@users.noreply.github.com>
1 parent 358d000 commit df3ed53

5 files changed

Lines changed: 48 additions & 3 deletions

File tree

src/app.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<script src="%sveltekit.assets%/config.js"></script>
8+
<script>
9+
;(function () {
10+
try {
11+
var stored = localStorage.getItem('preferredtheme')
12+
var isDark =
13+
stored === 'dark' ||
14+
(stored !== 'light' &&
15+
window.matchMedia('(prefers-color-scheme: dark)')
16+
.matches)
17+
if (isDark) document.documentElement.classList.add('dark')
18+
} catch (e) {}
19+
})()
20+
</script>
821
%sveltekit.head%
922
</head>
1023
<body>

src/content/blog/postguard-may-update.svx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ image: "/blog/may_update.png"
1111
We've been hard at work turning PostGuard from a research project into a usable service for everyone. Let me walk you through all the exciting changes from the past few months.
1212

1313
## Infrastructure Move
14-
We used to be hosted at the Radboud University and at Procolix. We have modernized everything into containers and moved to the Yivi Kubernetes cluster on Scaleway. We also renewed our deal with Procolix, who generously provides us with the fileshare server. We are very grateful for that! We've also finished moving all the domains and the email server.
14+
We used to be hosted at the Radboud University and at Procolix. We have modernized everything into containers and moved to the Yivi Kubernetes cluster on Scaleway. We also renewed our deal with Procolix, who generously provides us with the fileshare server. We are very grateful for that. We've also finished moving all the domains and the email server.
1515

1616
## Soft launch of PostGuard for Business
17-
We officially launched PostGuard for Business! We currently have two proof-of-concept partners with the Dutch government to programmatically send encrypted emails to citizens.
17+
We officially launched PostGuard for Business. We currently have two proof-of-concept partners with the Dutch government to programmatically send encrypted emails to citizens.
1818

1919
To support these partners, we’ve made the Business portal fully bilingual (Dutch and English) and ensured it hits WCAG 2.2 AA accessibility standards. Whether you're using a screen reader or just prefer a specific language, PostGuard for Business is ready for you. If you want to try it out, just head on over to https://business.postguard.eu/ and press register.
2020

@@ -49,7 +49,7 @@ var sealed = pg.Encrypt(new EncryptInput
4949
```
5050

5151
## Brand new add-ins for Thunderbird and Outlook
52-
We released the alpha version of our Thunderbird and Outlook add-ins. There is still some work to do, but sending email through Thunderbird or Outlook for Mac, Windows, or online is now possible. Our goal is to make it the smoothest way to send encrypted email. Check it out at https://postguard.eu/addons!
52+
We released the alpha version of our Thunderbird and Outlook add-ins. There is still some work to do, but sending email through Thunderbird or Outlook for Mac, Windows, or online is now possible. Our goal is to make it the smoothest way to send encrypted email. Check it out at https://postguard.eu/addons.
5353

5454
![PostGuard cover](/blog/outlook_plugin_may.png)
5555

src/lib/components/filesharing/SendButton.svelte

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,18 @@
266266
}
267267
}
268268
269+
function onCancelUpload(): void {
270+
if (!browser) return
271+
// Mark before aborting so the catch in startEncryption() takes the
272+
// self-aborted path and resets to FileSelection rather than showing
273+
// the generic Error panel.
274+
encryptState.selfAborted = true
275+
encryptState.abort.abort()
276+
// AbortController is single-use — provide a fresh one so a subsequent
277+
// send attempt can be cancelled too.
278+
encryptState.abort = new AbortController()
279+
}
280+
269281
function updateProgress(pct: number) {
270282
const totalSize = encryptState.files.reduce((a, f) => a + f.size, 0)
271283
if (totalSize === 0) return
@@ -365,6 +377,14 @@
365377
</p>
366378
{/if}
367379
</div>
380+
<button
381+
type="button"
382+
class="crypt-btn crypt-btn-secondary cancel-upload-btn"
383+
onclick={onCancelUpload}
384+
disabled={encryptState.selfAborted}
385+
>
386+
{$_('filesharing.cancel')}
387+
</button>
368388
{:else}
369389
<!-- Normal button -->
370390
<button
@@ -651,6 +671,11 @@
651671
stroke: var(--pg-text);
652672
}
653673
674+
.cancel-upload-btn {
675+
align-self: flex-start;
676+
margin-top: 0.25rem;
677+
}
678+
654679
.retry-status {
655680
margin: 0;
656681
padding: 0 1rem 0.75rem 1rem;

src/lib/postguard.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ export const pg = new PostGuard({
1919
cryptifyUrl: FILEHOST_URL,
2020
...(CHUNK_SIZE !== undefined && { uploadChunkSize: CHUNK_SIZE }),
2121
retry: {
22+
// Defaults (5 attempts, 500ms initial) exhaust the retry budget in
23+
// ~7.5s — shorter than a typical cryptify restart, so a brief outage
24+
// surfaces as a hard failure to the user. Stretch the budget so the
25+
// total wait covers a realistic restart window (~90s).
26+
maxAttempts: 8,
27+
initialDelayMs: 1000,
2228
onRetry: (event) => retryStatus.set(event),
2329
},
2430
})

src/routes/(marketing)/blog/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
class="rss-link"
7171
href={resolve('/(marketing)/blog/rss.xml')}
7272
aria-label="RSS feed"
73+
data-sveltekit-reload
7374
>
7475
<svg
7576
xmlns="http://www.w3.org/2000/svg"

0 commit comments

Comments
 (0)