Commit Graph

69 Commits

Author SHA1 Message Date
david_bai dceaae8efa fix(ssr): guard DOM/window access and client-only listeners
- Prevent server-side exceptions (Application error) on mobile after redirects
  - useOneShotSlowHint: guard document; use global setTimeout; conditionally attach visibilitychange
  - useConnectionFeedback: guard document.visibilityState; register/remove listeners only on client
  - usePageSetup: guard window before tracking referrer and parsing roomId
  - tracking: early return when window is undefined
  - docs(flows): add “SSR & DOM access guard (must-read)” checklist; renumber next section
2025-12-06 12:00:03 +08:00
david_bai a0befd06f4 fix(webrtc): avoid false "Join room timeout" with 15s timeout + early success
- Increase joinRoom timeout to 15s for slow networks/polling.
  - Early-resolve join on handshake signals:
      - Initiator: ready / recipient-ready
      - Recipient: offer
  - Single-settle guard; cleanup listeners/timer to prevent leaks.

  File: frontend/lib/webrtc_base.ts
2025-11-25 23:31:06 +08:00
david_bai 27375c1a4d refactor(theme): use design tokens and fix dark mode visuals
- Replace hardcoded Tailwind colors (bg-white, bg-gray-50/100, text-gray-, border-gray-, divide-gray-*, text-blue-600/800, bg-blue-50) with design tokens (bg-card, bg-muted, text-foreground, text-muted-foreground, border-
    border, text-primary, hover:bg-accent, bg-primary/10).
  - ClipboardApp: update RichTextEditor toolbar/editor, FileUploadHandler, ShareCard, FileListDisplay, SendTabPanel, RetrieveTabPanel, FileTransferButton.
  - Blog UI: unify styles in list page, tag page, post page, ArticleListItem, and TableOfContents.
  - MDX/prose: normalize pre/code/table/blockquote/lists and figure captions; switch rehype table divider to theme token.
  - Misc: adjust HomeClient and HowItWorks copy colors to tokens.
  - No functional changes; light mode parity; improved contrast and consistency in dark mode.
2025-11-25 21:52:45 +08:00
david_bai 89a38936b6 feat(blog-i18n): localize blog UI & SEO; add tag pages to sitemap
- Add Messages.meta.blog and text.blog (BlogTexts) to types/messages
  - Update all locales with blog UI strings and meta.blog
  - Localize blog list, tag pages, and article detail (titles, labels, dates)
  - Pass messages to ArticleListItem; TableOfContents supports localized title
  - Use dictionary-based metadata; alternates cover all supported locales
  - Sitemap: include /[lang]/blog/tag/{tag} and set blog list lastModified to newest post
  - JSON-LD: hardcode site URL in getSiteUrl() for consistency
2025-11-22 10:37:29 +08:00
david_bai 18f6703c6b fix(reconnect): auto rejoin on socket connect and widen reconnection triggers for mobile foreground resume
- Attempt reconnection on 'disconnected' | 'failed' | 'closed' states (BaseWebRTC)
  - Relax gating: rejoin when roomId exists and any of isPeerDisconnected, isSocketDisconnected, or socketId changed
  - Auto re-join room on socket 'connect' if lastJoinedSocketId differs or not in room; send initiator-online for initiators
  - Track lastJoinedSocketId after successful join and reset isInRoom when socketId changes to bypass early-return
  - Update flows to document mobile background/foreground reconnection and socketId-based rejoin
2025-11-21 20:23:47 +08:00
david_bai 415adfe638 chore(doc):Translate an existing blog into multiple languages 2025-11-12 00:01:32 +08:00
david_bai 2840da2f34 feat(blog): restructure blog files into language-specific directories
- Move from flat file structure (privydrop-open-source-en.mdx) to nested structure (privydrop-open-source/en.mdx)
  - Update blog.ts to handle new directory-based file organization
2025-11-11 23:22:30 +08:00
david_bai 2f5ed92188 feat(frontend): send initiator-online after sender rejoins with cached/long room ID
- Add forceInitiatorOnline flag to webrtcService.joinRoom
  - Trigger initiator-online for sender when joining with >=8-char IDs
2025-10-31 12:47:46 +08:00
david_bai 5ca89d71ad chore(code):Add cache room ID feature, no need to manually input room ID 2025-10-23 20:47:49 +08:00
david_bai 0621fb27db SEO: add JSON-LD structured data
- Add generic JSON-LD injector component and builders
  - components/seo/JsonLd.tsx
  - lib/seo/jsonld.ts
- Inject Organization and WebSite JSON-LD globally in [lang]/layout
- Inject WebApplication JSON-LD on the localized home page
  - Localize description/url/inLanguage and set alternateName ["PrivyDrop", "PrivyDrop APP"]
- Inject FAQPage JSON-LD only on /[lang]/faq (not on home)
  - Build Q&A from messages.text.faqs
- Inject BlogPosting + BreadcrumbList on blog post pages
  - Use frontmatter.cover as image, localized breadcrumbs

Notes
- Use stable @id anchors (/#organization, /#website, /[lang]#app, /[lang]/blog/[slug]#post)
- Respect multi-language setup across en/zh/ja/es/de/fr/ko
- SameAs limited to GitHub and X as provided
- Site URL resolved via NEXT_PUBLIC_SITE_URL or defaults to https://www.privydrop.app
2025-10-13 21:19:07 +08:00
david_bai ffa9f84c4a fix(sendString):Avoid using the file fragmentation parameter to prevent transmission failure 2025-10-11 10:59:42 +08:00
david_bai 8ef43029d5 fix(deploy+docker+frontend): enforce same-origin via Nginx, disable Next Image optimization in Docker, allow Socket.IO polling fallback, and improve health checks and access info
- generate-config.sh: add --with-nginx flag handling; when enabled, set NEXT_PUBLIC_API_URL empty to use same-origin /api and /socket.io; add BACKEND_INTERNAL_URL for SSR/internal fetch; adjust lan-tls HTTPS (8443) and TLS generation policy
- deploy.sh: show only valid access URLs when Nginx is enabled (gateway URLs), avoid misleading :3002/:3001 entries
- frontend (env/webrtc): return mutable transports [websocket,polling]; use empty signaling server for same-origin; comments in English
- frontend (next.config): support NEXT_IMAGE_UNOPTIMIZED to turn off image optimization in Docker
- frontend (health): prefer BACKEND_INTERNAL_URL for internal health checks, fallback to public URL/localhost
- docker-compose + Dockerfile(frontend): pass NEXT_IMAGE_UNOPTIMIZED and BACKEND_INTERNAL_URL envs
2025-10-10 20:49:17 +08:00
david_bai cfcd60145a build: refresh docker deployment workflow 2025-09-26 14:02:55 +08:00
david_bai 3f075c4a97 fix:Fix a Type error 2025-09-14 23:47:42 +08:00
david_bai 55f118be9a chore:Temporarily comment out some debug logs 2025-09-14 23:30:47 +08:00
david_bai 95331cb8e6 chore:Remove the redundant safety save button; Use English comments 2025-09-14 23:25:16 +08:00
david_bai d0ba2eb9c4 chore:Folder resuming transfer is normal 2025-09-14 19:44:11 +08:00
david_bai 79089bed7e chore:Saving folders to disk now works correctly 2025-09-14 16:49:06 +08:00
david_bai 4dcdf0c3a0 chore:The breakpoint resuming file is saved normally 2025-09-14 11:44:35 +08:00
david_bai 327de90f52 chore:Fix the issue where the breakpoint resume receiver is missing one chunk of data 2025-09-14 11:29:51 +08:00
david_bai b5404cea72 chore:Split the fileReceiver.ts 2025-09-14 08:36:20 +08:00
david_bai 33f2f041ac fix:Try to fix the problem of incomplete file size in resumable download 2025-09-14 07:35:34 +08:00
david_bai 8627544946 chore:Exit the room even if it is in transit 2025-09-13 20:01:02 +08:00
david_bai 526e1b49c1 fix:Fix the issue of downloads failing in certain browsers 2025-09-08 23:59:29 +08:00
david_bai 0747898f3c chore:Use English notes 2025-09-08 00:38:59 +08:00
david_bai 8ff2302c14 code clear up 2025-09-08 00:12:02 +08:00
david_bai 5ca911d1e1 Using a simple backpressure mechanism 2025-09-07 23:38:15 +08:00
david_bai 230a06b3fb fileSender code splitting 2025-09-07 22:52:59 +08:00
david_bai 99c927f5c7 clear up code 2025-09-07 21:21:43 +08:00
david_bai 3f18002cf0 Directly writing to disk was also tested and passed 2025-09-06 23:49:10 +08:00
david_bai e385389e1d Fix the out-of-order file transfer issue for files saved in memory 2025-09-06 22:53:54 +08:00
david_bai 81c2b204f3 It is found that the order of data packets received by Firefox is disordered 2025-09-05 22:58:56 +08:00
david_bai ec6a18dfc0 fix:Adapting to Firefox browser, not yet completed 2025-09-05 00:19:33 +08:00
david_bai 5af2e8db37 chore:Use English comments instead of Chinese 2025-08-31 23:34:52 +08:00
david_bai 1aa738425f chore:remove debug code 2025-08-31 22:22:00 +08:00
david_bai 0562e8a3a8 chore(code):Use the speedCalculator to estimate network quality 2025-08-31 22:09:23 +08:00
david_bai c0317211e7 chore(code):add optimized code, need further debugging 2025-08-31 20:10:31 +08:00
david_bai 7f33064109 chore(code):retryDataSend Add return value,fileSender Remove unnecessary variables. 2025-08-30 23:49:09 +08:00
david_bai ad4a951525 chore:remove debug code 2025-08-30 00:37:32 +08:00
david_bai 4437c70257 fix:Temporarily optimized the speed issue on the mobile 2025-08-30 00:06:59 +08:00
david_bai b38ef84bca chore:fileSender code has been simplified and adjusted 2025-08-29 23:39:35 +08:00
david_bai 9b6e6559fe fix:Temporarily optimized the speed issue on the mobile 2025-08-29 22:51:10 +08:00
david_bai a1a70bbff5 fix:Fix the bug in server-side rendering where navigator is not available 2025-08-24 08:15:01 +08:00
david_bai a0554fb185 fix:Fix the download status synchronization issue.
Fix the issue where download cannot find file (status synchronization problem).
Change postLogInDebug to postLogToBackend for better understanding.
2025-08-18 23:26:56 +08:00
david_bai bb21c90a4e fix:Fix the incomplete cleanup issue when the receiver exits the room 2025-08-17 23:56:09 +08:00
david_bai caa861f1bb refactor:Optimize chaotic state management 2025-08-17 15:44:59 +08:00
david_bai 307232bd15 fix:Attempt to fix the issue of asynchronous exit room status in the receiver 2025-08-14 23:02:33 +08:00
david_bai 7038e79726 fix:Change the behavior of reloading the webpage when the receiver exits the room to a more elegant approach 2025-08-13 22:53:49 +08:00
david_bai 12cda8c030 fea:Add an elegant exit room feature for the recipient 2025-08-10 23:16:59 +08:00
david_bai 245c4efcd0 fix(blog url bug): fix blog url bug
Fixed the bug of redundant language suffix in blog URLs, added lang to the blog homepage link to prevent language switching issues.
2025-08-02 23:27:02 +08:00