diff --git a/backend/app/main.py b/backend/app/main.py
index 3f34fc8..036bef3 100644
--- a/backend/app/main.py
+++ b/backend/app/main.py
@@ -75,6 +75,8 @@ async def upload(
)
object_name = _resolve_object_name(file.filename or "", content_type)
+ await file.seek(0)
+
try:
url = await upload_file(
file_obj=file.file,
diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx
index 8a65ac4..2095753 100644
--- a/frontend/src/app/page.tsx
+++ b/frontend/src/app/page.tsx
@@ -63,7 +63,10 @@ export default function Home() {
xhr.upload.onprogress = (e) => {
if (e.lengthComputable) {
- setProgress(Math.round((e.loaded / e.total) * 100));
+ // Cap at 99 — the final 100 is set only once the server responds,
+ // because the file is still being streamed to R2 after the browser
+ // finishes sending bytes.
+ setProgress(Math.min(99, Math.round((e.loaded / e.total) * 100)));
}
};
@@ -150,7 +153,21 @@ export default function Home() {
const isAuthenticated = status === "authenticated";
const isUploading = status === "uploading";
const isInteractable = status !== "uploading";
- const limitLabel = isAuthenticated ? "250 MB" : "50 MB";
+
+ // Show the auth badge when authenticated, or when uploading/done from an
+ // authenticated session (preUploadStatus tells us what we came from).
+ const showAuthBadge =
+ status === "authenticated" ||
+ ((status === "uploading" || status === "done") &&
+ preUploadStatus.current === "authenticated");
+
+ // Show the auth row at all when there is something to render inside it.
+ const showAuthRow = status === "idle" || showAuthBadge;
+
+ const limitLabel =
+ isAuthenticated || preUploadStatus.current === "authenticated"
+ ? "250 MB"
+ : "50 MB";
// ── Render ────────────────────────────────────────────────────────────────
@@ -198,84 +215,90 @@ export default function Home() {
style={{ background: "#32302f", border: "1px solid #504945" }}
>
{/* Auth row */}
-
- {isAuthenticated ? (
-
-
-
- Authenticated · 250 MB limit
-
-
- ) : (
-
-
+ ) : (
+ /* status === "idle" — show the optional unlock form */
+
+
+
{
+ setPassword(e.target.value);
+ setPasswordError(false);
+ }}
+ onKeyDown={(e) => e.key === "Enter" && handleUnlock()}
+ placeholder="Enter password"
+ className={[
+ "w-full h-11 px-3.5 rounded-xl text-[15px] outline-none",
+ "border transition-all duration-150",
+ passwordError ? "ring-2" : "",
+ ].join(" ")}
+ style={{
+ background: "#1d2021",
+ color: "#ebdbb2",
+ caretColor: "#d79921",
+ borderColor: passwordError ? "#fb4934" : "#504945",
+ boxShadow: passwordError
+ ? "0 0 0 2px rgba(251,73,52,0.2)"
+ : undefined,
+ }}
+ onFocus={(e) => {
+ if (!passwordError)
+ (e.target as HTMLInputElement).style.borderColor =
+ "#d79921";
+ }}
+ onBlur={(e) => {
+ if (!passwordError)
+ (e.target as HTMLInputElement).style.borderColor =
+ "#504945";
+ }}
+ />
+ {passwordError && (
+
+ Incorrect password.
+
+ )}
+
+
+ )}
+
+ )}
{/* Upload / progress / result */}