Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.
Rust downloadmanagerguihacktoberfesthomebrewlightweightlinuxlinux-distributionlocal-firstmacosmacos-packagemedia-toolboxopen-sourcerustsveltetauritrendingtrending-repositorieswindowswindows-desktopytdlp
chore: release version 1.0.0
IGECTd12f9a8c4e10
diff --git a/.github/SECURITY.md b/.github/SECURITY.mdindex 6fca14d1..109ca046 100644--- a/.github/SECURITY.md+++ b/.github/SECURITY.md@@ -6,8 +6,8 @@ Only the latest minor release receives active security updates and patches.| Version | Supported || ------- | --------- |-| 0.16.x | ✅ |-| < 0.16 | ❌ |+| 1.0.x | ✅ |+| < 1.0 | ❌ |## Reporting a Vulnerabilitydiff --git a/README.ja.md b/README.ja.mdindex 8c8794df..66b7f1cc 100644--- a/README.ja.md+++ b/README.ja.md@@ -196,12 +196,12 @@ LibreGet は、よく使われるプラットフォーム向けのネイティ| カテゴリ | サイトと形式 ||---|---|-| <img src="https://api.iconify.design/ph:graduation-cap.svg?color=%23F28500" width="18" height="18" align="center" alt="オンライン講座" /> オンライン講座 | 組み込みの Courses プラグインを通じて 38 のプラットフォーム(Hotmart、Udemy、Kiwify、Rocketseat、Coursera、Domestika、Skillshare など)に対応しています。すべてのレッスン、セクションの選択、添付ファイル、中断したところからの再開に対応しています。 |-| <img src="https://api.iconify.design/ph:film-slate.svg?color=%238E3FD8" width="18" height="18" align="center" alt="動画と音声" /> 動画と音声 | YouTube(動画、プレイリスト、チャンネル、ライブの最初から、チャプター、SponsorBlock)、Instagram、TikTok、X/Twitter、Reddit、Twitch(VOD、クリップ、ライブ)、Vimeo、Bluesky、Threads、Pinterest、Douyin |+| <img src="https://api.iconify.design/ph/graduation-cap.svg?color=%23F28500" width="18" height="18" align="center" alt="オンライン講座" /> オンライン講座 | 組み込みの Courses プラグインを通じて 38 のプラットフォーム(Hotmart、Udemy、Kiwify、Rocketseat、Coursera、Domestika、Skillshare など)に対応しています。すべてのレッスン、セクションの選択、添付ファイル、中断したところからの再開に対応しています。 |+| <img src="https://api.iconify.design/ph/film-slate.svg?color=%238E3FD8" width="18" height="18" align="center" alt="動画と音声" /> 動画と音声 | YouTube(動画、プレイリスト、チャンネル、ライブの最初から、チャプター、SponsorBlock)、Instagram、TikTok、X/Twitter、Reddit、Twitch(VOD、クリップ、ライブ)、Vimeo、Bluesky、Threads、Pinterest、Douyin || <img src="https://cdn.simpleicons.org/bilibili/00A1D6" width="18" height="18" align="center" alt="Bilibili" /> Bilibili(ログイン時) | ご利用のサブスクリプションに応じて 4K、HDR、Dolby Vision、Hi-Res ロスレス、Dolby Atmos に対応。弾幕コメントを XML、ASS、JSON で保存、Kodi や Jellyfin 向けの NFO ファイル、カスタムの命名テンプレート、番組、講座、お気に入り、後で見る、履歴を含む 11 種類の URL に対応 |-| <img src="https://api.iconify.design/ph:images.svg?color=%23E0A800" width="18" height="18" align="center" alt="画像ギャラリー" /> 画像ギャラリー | gallery-dl を通じて 250 以上のサイト(DeviantArt、Pixiv、ArtStation、Flickr、Tumblr、Imgur、Kemono など)からギャラリーやプロフィールを丸ごと取得 |-| <img src="https://api.iconify.design/ph:stack.svg?color=%23FFB340" width="18" height="18" align="center" alt="一括" /> 一括 | 多数のリンクを貼り付けるか `.txt` を読み込み、サブレディット全体、Reddit や X のプロフィール、Instagram や Pinterest のプロフィール、Facebook のアルバムをダウンロード |-| <img src="https://api.iconify.design/ph:folder-simple.svg?color=%23A66A24" width="18" height="18" align="center" alt="ファイルと転送" /> ファイルと転送 | 内蔵の BitTorrent クライアントによる `.torrent` ファイルとマグネットリンク、HTTP による直接のファイル、HLS と DASH のマニフェスト、短い単語コードを使った 2 つの LibreGet 間での個人間転送 |+| <img src="https://api.iconify.design/ph/images.svg?color=%23E0A800" width="18" height="18" align="center" alt="画像ギャラリー" /> 画像ギャラリー | gallery-dl を通じて 250 以上のサイト(DeviantArt、Pixiv、ArtStation、Flickr、Tumblr、Imgur、Kemono など)からギャラリーやプロフィールを丸ごと取得 |+| <img src="https://api.iconify.design/ph/stack.svg?color=%23FFB340" width="18" height="18" align="center" alt="一括" /> 一括 | 多数のリンクを貼り付けるか `.txt` を読み込み、サブレディット全体、Reddit や X のプロフィール、Instagram や Pinterest のプロフィール、Facebook のアルバムをダウンロード |+| <img src="https://api.iconify.design/ph/folder-simple.svg?color=%23A66A24" width="18" height="18" align="center" alt="ファイルと転送" /> ファイルと転送 | 内蔵の BitTorrent クライアントによる `.torrent` ファイルとマグネットリンク、HTTP による直接のファイル、HLS と DASH のマニフェスト、短い単語コードを使った 2 つの LibreGet 間での個人間転送 || <img src="https://cdn.simpleicons.org/telegram/2CA5E0" width="18" height="18" align="center" alt="Telegram" /> Telegram | 組み込みの Telegram プラグインを通じて、参加しているチャンネルやグループの写真、動画、ファイル、音声を、チャンネルごとに整理されたフォルダー(`LibreGram/<channel>/`)に保存 |一度設定すれば忘れてよいオプション:デフォルトの画質、音声のみの形式(MP3、M4A、Opus、FLAC、WAV)、字幕の言語と形式(SRT、VTT、ASS、埋め込みまたは別ファイル)、サムネイルとメタデータの埋め込み、ファイル名のテンプレート、プラットフォームごとの整理、既存ファイルのスキップ、チャプターごとの分割、速度制限、同時ダウンロード数、プロキシ。ルールを使えば、特定のチャンネルやホストを、毎回確認することなく、指定したフォルダーと画質に振り分けられます。フォロー中のチャンネルはバックグラウンドでチェックされ、新しいアップロードをトレイ通知付きで自動的にダウンロードすることもできます。@@ -293,7 +293,7 @@ Firefox:Firefox の横にある **Settings → Plugins → Browser extension- **本当のサムネイル。** 釣り目的のカバー画像ではなく、CDN がすでに持っている 25%、50%、75% 地点のフレームを表示します。- **Force H.264.** ブラウザ拡張機能のスイッチで、YouTube を VP9 や AV1 ではなく H.264 で再生させます。新しいコーデックでカクつくマシン向けです。-### <img src="https://api.iconify.design/ph:waveform.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="音声と字幕" /> 音声と字幕 (8)+### <img src="https://api.iconify.design/ph/waveform.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="音声と字幕" /> 音声と字幕 (8)- **文字起こし。** whisper.cpp を使って、音声や動画をオフラインで字幕にします。モデルは必要に応じてダウンロードされ、macOS では Metal によるアクセラレーションが使われます。- **テキスト読み上げ。** Microsoft Edge の自然な音声を無料で使い、同期した字幕ファイルも作成します。@@ -302,7 +302,7 @@ Firefox:Firefox の横にある **Settings → Plugins → Browser extension- マシン上で動作する VoiceStudio を通じて、**声のクローン**、**声のデザイン**、**ボーカルの分離** が行えます。*beta*- **音声入力。** グローバルショートカットを押して話すと、whisper がカーソルの位置にテキストを入力します。*beta*-### <img src="https://api.iconify.design/ph:film-slate.svg?color=%238E3FD8" width="20" height="20" align="center" alt="動画編集" /> 動画編集 (14)+### <img src="https://api.iconify.design/ph/film-slate.svg?color=%238E3FD8" width="20" height="20" align="center" alt="動画編集" /> 動画編集 (14)- **クリップの切り出し。** ディスク上の動画を選んで、一部分を切り出します。結果はダウンロードキューに追加されます。- **変換。** Convert プラグインを通じて、コンテナ、コーデック、解像度を変更したり、圧縮したりします。@@ -318,7 +318,7 @@ Firefox:Firefox の横にある **Settings → Plugins → Browser extension- **画面の録画。** FFmpeg を通じて画面とシステム音声を録画し、直前の出来事を保存できるリプレイバッファーも備えています。*beta*- **タイムラインエディター。** *planned*-### <img src="https://api.iconify.design/ph:speaker-high.svg?color=%23E0203F" width="20" height="20" align="center" alt="オーディオ" /> オーディオ (2)+### <img src="https://api.iconify.design/ph/speaker-high.svg?color=%23E0203F" width="20" height="20" align="center" alt="オーディオ" /> オーディオ (2)- **ラウドネスの正規化。** 2 パスの EBU R128 で、ストリーミング、ポッドキャスト、放送が求める音量に合わせます。- **ノイズ除去。** 録音からヒスノイズ、ファンの音、室内の雑音を取り除きます。追加のダウンロードは不要です。@@ -410,7 +410,7 @@ Bilibili の動画のダウンロードはホーム画面から行います。- **テーマとカラー。** Spicetify のテーマで Spotify クライアントをカスタマイズします。*beta*- **拡張機能。** Spicetify の Marketplace から拡張機能やカスタムアプリをインストールします。*beta*-### <img src="https://api.iconify.design/ph:music-notes.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="音楽" /> 音楽 (3)+### <img src="https://api.iconify.design/ph/music-notes.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="音楽" /> 音楽 (3)- **プレイリストから M3U へ。** エクスポートしたプレイリストを手持ちの音声ファイルと照合し、任意のローカルプレイヤー向けに `.m3u8` と `.pls` を書き出します。- **同期歌詞。** LRCLIB から歌詞を取得し、各トラックの隣に `.lrc` を保存します。@@ -425,13 +425,13 @@ Bilibili の動画のダウンロードはホーム画面から行います。- **メッセージ。** チャット履歴を閲覧し、ローカルのページとして保存します。- **プロフィールスコア。** オフラインでプロフィールの充実度をチェックし、足りないものを表示します。-### <img src="https://api.iconify.design/ph:game-controller.svg?color=%233D5BF0" width="20" height="20" align="center" alt="ゲーム" /> ゲーム (3)+### <img src="https://api.iconify.design/ph/game-controller.svg?color=%233D5BF0" width="20" height="20" align="center" alt="ゲーム" /> ゲーム (3)- **Switch のアルバム。** Switch の SD カードからスクリーンショットとクリップを取り込み、ゲーム名と日付で名前を付けます。- **クリップの整理。** Game Bar、ShadowPlay、OBS、Steam のキャプチャを、ゲームごとのフォルダーに振り分けます。- **Linux で動く?** 1 つのゲーム、または Steam ライブラリ全体の ProtonDB のティアを表示します。-### <img src="https://api.iconify.design/ph:file-pdf.svg?color=%23E0303A" width="20" height="20" align="center" alt="PDF" /> PDF (13)+### <img src="https://api.iconify.design/ph/file-pdf.svg?color=%23E0303A" width="20" height="20" align="center" alt="PDF" /> PDF (13)- **結合。** 複数の PDF を、選んだ順序で 1 つにまとめます。- **分割。** ページを抽出するか、PDF を複数に分割します。@@ -447,7 +447,7 @@ Bilibili の動画のダウンロードはホーム画面から行います。- **安全な PDF。** PDF をピクセルから再構築し、スクリプトやフォームを取り除きます。- **PDF から Markdown へ。** 見出し、リスト、表を含むきれいな Markdown にし、そのまま LLM に貼り付けられるようにします。-### <img src="https://api.iconify.design/ph:file-text.svg?color=%231E6FE8" width="20" height="20" align="center" alt="ドキュメント" /> ドキュメント (5)+### <img src="https://api.iconify.design/ph/file-text.svg?color=%231E6FE8" width="20" height="20" align="center" alt="ドキュメント" /> ドキュメント (5)- **SlideShare から PDF へ。** すべてのスライドを最大サイズで取得し、1 つの PDF にまとめます。- **Google ドキュメントのエクスポート。** 公開されている Docs、Slides、Sheets を PDF、DOCX、PPTX、XLSX で保存します。@@ -455,7 +455,7 @@ Bilibili の動画のダウンロードはホーム画面から行います。- **画像ギャラリー。** gallery-dl を使って、250 以上のサイトからギャラリーやプロフィールを丸ごと取得します。- **Scribd.** あなた自身のセッションを使って、閲覧可能な書籍を PDF で保存します。*planned*-### <img src="https://api.iconify.design/ph:images.svg?color=%23E0A800" width="20" height="20" align="center" alt="画像" /> 画像 (9)+### <img src="https://api.iconify.design/ph/images.svg?color=%23E0A800" width="20" height="20" align="center" alt="画像" /> 画像 (9)- **アップスケール。** 任意の Vulkan GPU 上の Real-ESRGAN で、2 倍、3 倍、4 倍に拡大します。*beta*- **画像のリサイズ。** 幅、高さ、フィット、パーセントで一括リサイズし、必要に応じて形式も変換します。@@ -467,7 +467,7 @@ Bilibili の動画のダウンロードはホーム画面から行います。- **スプライトシート。** シートをフレームに切り分ける、フレームをアトラス付きでシートにまとめ直す、フォルダー内の画像をルールに従ってリサイズする、のいずれかを行います。- **OCR.** 画像やスライドからテキストをコピーします。*beta*-### <img src="https://api.iconify.design/ph:broom.svg?color=%231A9EB5" width="20" height="20" align="center" alt="システム" /> システム (10、Windows 専用の項目は明記)+### <img src="https://api.iconify.design/ph/broom.svg?color=%231A9EB5" width="20" height="20" align="center" alt="システム" /> システム (10、Windows 専用の項目は明記)- **キャッシュのクリーンアップ。** OS ごとのルールで、一時ファイル、ログ、アプリのキャッシュを削除します。削除の前に一覧を確認できます。- **ディスクアナライザー。** 容量を占めているものをツリーマップと最大のファイルの一覧で表示し、ゴミ箱に送るボタンも備えています。@@ -480,7 +480,7 @@ Bilibili の動画のダウンロードはホーム画面から行います。- **レジストリクリーナー。** 孤立したエントリーを、削除前に `.reg` でバックアップしてから削除します。Windows。*beta*- **ソフトウェアアップデーター。** winget、Chocolatey、Scoop を通じて、プログラムを一括で更新します。Windows。*beta*-### <img src="https://api.iconify.design/ph:folder-simple.svg?color=%23A66A24" width="20" height="20" align="center" alt="ファイル" /> ファイル (5)+### <img src="https://api.iconify.design/ph/folder-simple.svg?color=%23A66A24" width="20" height="20" align="center" alt="ファイル" /> ファイル (5)- **重複。** ハッシュで同一のファイルを見つけ、安全に空き容量を確保します。- **一括リネーム。** 正規表現、連番、大文字・小文字の変換を、適用前のプレビュー付きで行います。@@ -488,20 +488,20 @@ Bilibili の動画のダウンロードはホーム画面から行います。- **ファイル検索。** Windows では Everything、macOS では Spotlight、Linux では fd を使って瞬時に検索します。- **スリープ防止。** 長い処理の間、コンピューターがスリープしないようにします。-### <img src="https://api.iconify.design/ph:cloud-arrow-down.svg?color=%231E6FE8" width="20" height="20" align="center" alt="ダウンロード" /> ダウンロード (2)+### <img src="https://api.iconify.design/ph/cloud-arrow-down.svg?color=%231E6FE8" width="20" height="20" align="center" alt="ダウンロード" /> ダウンロード (2)- **高速ダウンロード。** aria2 を使い、16 本の接続、再開、チェックサムで大きなファイルをダウンロードします。- **HLS / DASH マニフェスト。** Referer と Cookie を付けて `.m3u8` または `.mpd` を貼り付けると、FFmpeg が MP4 で保存します。-### <img src="https://api.iconify.design/ph:cursor-click.svg?color=%23F28500" width="20" height="20" align="center" alt="自動化" /> 自動化 (1)+### <img src="https://api.iconify.design/ph/cursor-click.svg?color=%23F28500" width="20" height="20" align="center" alt="自動化" /> 自動化 (1)- **オートクリッカー。** グローバルホットキー、上限、ランダムな範囲を設定して、指定したとおりの速度でクリックします。Windows、macOS、Linux。*beta*-### <img src="https://api.iconify.design/ph:device-mobile.svg?color=%232AA845" width="20" height="20" align="center" alt="スマートフォン" /> スマートフォン (1)+### <img src="https://api.iconify.design/ph/device-mobile.svg?color=%232AA845" width="20" height="20" align="center" alt="スマートフォン" /> スマートフォン (1)- **スマートフォンに送信。** ペアリングした KDE Connect デバイスに、ファイル、リンク、テキストを送ります。-### <img src="https://api.iconify.design/ph:sparkle.svg?color=%233D5BF0" width="20" height="20" align="center" alt="AI" /> AI (6)+### <img src="https://api.iconify.design/ph/sparkle.svg?color=%233D5BF0" width="20" height="20" align="center" alt="AI" /> AI (6)- **価格の比較。** LiteLLM と models.dev の価格をもとに、同じモデルのプロバイダーごとのコストを比較します。- **AI の支出。** LibreGet が AI に使った金額を、ローカルの台帳から日別、モデル別、タスク別に表示します。@@ -510,7 +510,7 @@ Bilibili の動画のダウンロードはホーム画面から行います。- **API キー。** キーとアカウントのためのローカルの保管庫です。接続テスト、OpenRouter、DeepSeek、SiliconFlow、New API の残高表示、Claude Code、Codex、Cherry Studio、opencode、`.env` ファイルへのエクスポートに対応しています。- **MCP サーバー。** LibreGet のツールをローカルブリッジ上の Model Context Protocol で公開します。拡張機能と同じトークンで保護された 37 のツールがあり、Claude Code、Claude Desktop、Cursor、VS Code、Goose、Codex 向けのすぐに使える設定スニペットも用意されています。[AI エージェント向けの LibreGet](#ai-エージェント向けの-libreget-mcp-サーバーと-claude-code-プラグイン) をご覧ください。*beta*-### <img src="https://api.iconify.design/ph:sword.svg?color=%236F6F75" width="20" height="20" align="center" alt="CTF と解析" /> CTF と解析 (6)+### <img src="https://api.iconify.design/ph/sword.svg?color=%236F6F75" width="20" height="20" align="center" alt="CTF と解析" /> CTF と解析 (6)CTF(capture-the-flag)の問題、フォレンジックの課題、「このファイルは何?」という場面のための、6 つの小さなオフラインユーティリティです。@@ -559,7 +559,7 @@ AI と通信するツールはすべて、**Settings → AI** で設定したプ<img src="assets/readme/marketplace.png" alt="Courses、Telegram、Convert の各プラグインを、バージョン、作者、権限、有効化スイッチとともに一覧表示している LibreGet の Marketplace" width="900" /></p>-### <img src="https://api.iconify.design/ph:graduation-cap.svg?color=%23F28500" width="20" height="20" align="center" alt="Courses" /> Courses+### <img src="https://api.iconify.design/ph/graduation-cap.svg?color=%23F28500" width="20" height="20" align="center" alt="Courses" /> Courses組み込みの Courses プラグインは、**Hotmart**、**Udemy**、**Kiwify**、**Rocketseat**、**Coursera**、**Domestika**、**Skillshare**、**Alura**、**Ebac** を含む 38 の学習プラットフォームに対応しています。アプリ内の Web ビューからログインするか、拡張機能で保存した Cookie を使うか、利用可能な場合はアカウントの認証情報でログインします。LibreGet は購入済みの講座を一覧表示し、講座のアウトラインを開いて必要なセクションを選べるようにし(DRM で保護された講義はスキップされ、報告されます)、レッスンと添付ファイルを、必要に応じて通し番号を付けてダウンロードします。@@ -567,7 +567,7 @@ AI と通信するツールはすべて、**Settings → AI** で設定したプQR コードまたは電話番号でログインします。参加しているすべてのチャンネルとグループを閲覧し、写真、動画、ドキュメント、音声で絞り込み、ファイルを検索し、個別のメディアやチャットのアーカイブ全体を、進捗リスト付きでダウンロードできます。メディアのダウンロードは、サニタイズされたフォルダー名で `{download_dir}/LibreGram/{channel_name}/` に整理されます。-### <img src="https://api.iconify.design/ph:arrows-clockwise.svg?color=%232AA845" width="20" height="20" align="center" alt="Convert" /> Convert+### <img src="https://api.iconify.design/ph/arrows-clockwise.svg?color=%232AA845" width="20" height="20" align="center" alt="Convert" /> Convertマシンが対応していれば GPU アクセラレーションを使って FFmpeg で変換します:動画と音声のコンテナ、コーデック、解像度、ビットレート、圧縮を変更でき、インターネット接続は不要です。diff --git a/README.md b/README.mdindex 25c77656..216d6f8d 100644--- a/README.md+++ b/README.md@@ -196,12 +196,12 @@ LibreGet has native extractors for the platforms people use most, and hands ever| Category | Sites and formats ||---|---|-| <img src="https://api.iconify.design/ph:graduation-cap.svg?color=%23F28500" width="18" height="18" align="center" alt="Online courses" /> Online courses | 38 supported platforms (Hotmart, Udemy, Kiwify, Rocketseat, Coursera, Domestika, Skillshare, and more) through the embedded Courses plugin. Every lesson, section selection, attachments, resume where you stopped. |-| <img src="https://api.iconify.design/ph:film-slate.svg?color=%238E3FD8" width="18" height="18" align="center" alt="Video and audio" /> Video and audio | YouTube (videos, playlists, channels, live from start, chapters, SponsorBlock), Instagram, TikTok, X/Twitter, Reddit, Twitch (VODs, clips, live), Vimeo, Bluesky, Threads, Pinterest, Douyin |+| <img src="https://api.iconify.design/ph/graduation-cap.svg?color=%23F28500" width="18" height="18" align="center" alt="Online courses" /> Online courses | 38 supported platforms (Hotmart, Udemy, Kiwify, Rocketseat, Coursera, Domestika, Skillshare, and more) through the embedded Courses plugin. Every lesson, section selection, attachments, resume where you stopped. |+| <img src="https://api.iconify.design/ph/film-slate.svg?color=%238E3FD8" width="18" height="18" align="center" alt="Video and audio" /> Video and audio | YouTube (videos, playlists, channels, live from start, chapters, SponsorBlock), Instagram, TikTok, X/Twitter, Reddit, Twitch (VODs, clips, live), Vimeo, Bluesky, Threads, Pinterest, Douyin || <img src="https://cdn.simpleicons.org/bilibili/00A1D6" width="18" height="18" align="center" alt="Bilibili" /> Bilibili, signed in | 4K, HDR, Dolby Vision, Hi-Res lossless and Dolby Atmos according to your subscription. Danmaku comments as XML, ASS or JSON, NFO files for Kodi and Jellyfin, custom naming templates, 11 URL types including bangumi, courses, favorites, watch later and history |-| <img src="https://api.iconify.design/ph:images.svg?color=%23E0A800" width="18" height="18" align="center" alt="Image galleries" /> Image galleries | Whole galleries and profiles from 250+ sites through gallery-dl (DeviantArt, Pixiv, ArtStation, Flickr, Tumblr, Imgur, Kemono and more) |-| <img src="https://api.iconify.design/ph:stack.svg?color=%23FFB340" width="18" height="18" align="center" alt="Bulk" /> Bulk | Paste many links or load a `.txt`, download whole subreddits, Reddit and X profiles, Instagram and Pinterest profiles, Facebook albums |-| <img src="https://api.iconify.design/ph:folder-simple.svg?color=%23A66A24" width="18" height="18" align="center" alt="Files and transfer" /> Files and transfer | `.torrent` files and magnet links with a built-in BitTorrent client, direct HTTP files, HLS and DASH manifests, and person-to-person transfer between two LibreGet installs with a short word code |+| <img src="https://api.iconify.design/ph/images.svg?color=%23E0A800" width="18" height="18" align="center" alt="Image galleries" /> Image galleries | Whole galleries and profiles from 250+ sites through gallery-dl (DeviantArt, Pixiv, ArtStation, Flickr, Tumblr, Imgur, Kemono and more) |+| <img src="https://api.iconify.design/ph/stack.svg?color=%23FFB340" width="18" height="18" align="center" alt="Bulk" /> Bulk | Paste many links or load a `.txt`, download whole subreddits, Reddit and X profiles, Instagram and Pinterest profiles, Facebook albums |+| <img src="https://api.iconify.design/ph/folder-simple.svg?color=%23A66A24" width="18" height="18" align="center" alt="Files and transfer" /> Files and transfer | `.torrent` files and magnet links with a built-in BitTorrent client, direct HTTP files, HLS and DASH manifests, and person-to-person transfer between two LibreGet installs with a short word code || <img src="https://cdn.simpleicons.org/telegram/2CA5E0" width="18" height="18" align="center" alt="Telegram" /> Telegram | Photos, videos, files and audio from any channel or group you belong to, saved into organized channel folders (`LibreGram/<channel>/`), through the embedded Telegram plugin |Options you set once and forget: default quality, audio-only format (MP3, M4A, Opus, FLAC or WAV), subtitle languages and format (SRT, VTT, ASS, embedded or sidecar), thumbnail and metadata embedding, filename template, organize by platform, skip existing files, split by chapters, speed limit, concurrent downloads, proxy. Rules send a given channel or host to a folder and quality of your choice without asking again. Followed channels are checked in the background and can download new uploads automatically with a tray notification.@@ -218,7 +218,7 @@ The extension does two jobs. On sites it recognizes (YouTube, Instagram, TikTok,For the sites the sniffer cannot see, there is **Deep search**, a switch in the popup that hooks the page's own video player and catches playlists that never show up as network requests. It asks for permission on all sites the first time and stays off until then. Around it, the sniffer estimates the size of an HLS stream before you download, pairs the separate video and audio tracks a site serves so you get one file, checks the first bytes of what it found so an HTML error page is never saved as a video, and lets you edit the capture rules in the options page. The same options page can back up the list of extensions you have installed, ahead of Chrome dropping Manifest V2 extensions; that needs the optional "management" permission and asks for it only when you use it.-Pick the level that matches how comfortable you are.+The companion browser extension source and standalone releases are maintained at [OpenSelena/libreget-extension](https://github.com/OpenSelena/libreget-extension). Pick the level that matches how comfortable you are.<p align="center"><img src="assets/readme/extension.png" alt="Penguin mascot plugging a cable from a browser window into the LibreGet app window, with cookies travelling along it and a padlock and a house above it: the pairing stays on your own machine." width="100%" />@@ -238,11 +238,11 @@ From now on, visit any supported page and click the icon. The page, its cookies### Level 2: from the release zip-Every release ships `libreget-chrome-extension-vX.Y.Z.zip`. Download it from the [latest release](https://github.com/OpenSelena/libreget/releases/latest), unzip it, then follow steps 3 to 7 above pointing **Load unpacked** at the unzipped folder. Use this if you keep the app on one machine and the browser on another, or if you are installing for someone else.+Every release ships pre-built extension archives. Download `libreget-chrome-extension.zip` or `libreget-firefox-extension.zip` from the official [OpenSelena/libreget-extension releases](https://github.com/OpenSelena/libreget-extension/releases/latest), unzip it, then follow steps 3 to 7 above pointing **Load unpacked** at the unzipped folder. Use this if you keep the app on one machine and the browser on another, or if you are installing for someone else.### Level 3: Firefox, other browsers and manual pairing-Firefox: **Settings → Plugins → Browser extension → Update / Install** next to Firefox, then open `about:debugging#/runtime/this-firefox`, click **Load Temporary Add-on** and pick `manifest.json` in the exported folder. Firefox drops temporary add-ons on restart, so repeat this until the extension is published on AMO. Safari is not supported yet because Safari extensions must ship through the App Store.+Firefox: install directly from Mozilla Add-ons (pending AMO approval) or download `libreget-firefox-extension.zip` from [libreget-extension releases](https://github.com/OpenSelena/libreget-extension/releases/latest). For temporary testing: **Settings → Plugins → Browser extension → Update / Install** next to Firefox, then open `about:debugging#/runtime/this-firefox`, click **Load Temporary Add-on** and pick `manifest.json` in the exported folder. Safari is not supported yet because Safari extensions must ship through the App Store.Manual pairing: if **Pair extension** times out, open the extension's options page (right-click the icon → Options), then in LibreGet reveal and copy the **Pairing token** and paste it into the options page. The endpoint URL is detected automatically. The app listens on `127.0.0.1` ports 47720 to 47729 and the token is generated per install, so nothing leaves your machine.@@ -293,7 +293,7 @@ Status legend: no mark means ready, **beta** means it works but has not been tes- **Real thumbnail.** The frames the CDN already has at 25, 50 and 75 percent, instead of the clickbait cover.- **Force H.264.** A switch in the browser extension that keeps YouTube on H.264 instead of VP9 and AV1, for machines that stutter on newer codecs.-### <img src="https://api.iconify.design/ph:waveform.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="Speech and subtitles" /> Speech and subtitles (8)+### <img src="https://api.iconify.design/ph/waveform.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="Speech and subtitles" /> Speech and subtitles (8)- **Transcribe.** Audio or video to subtitles with whisper.cpp, offline. Models download on demand, Metal acceleration on macOS.- **Text to speech.** Natural voices from Microsoft Edge, free, with a synced subtitle file.@@ -302,7 +302,7 @@ Status legend: no mark means ready, **beta** means it works but has not been tes- **Clone a voice**, **Design a voice** and **Isolate vocals** through a VoiceStudio install running on your machine. *beta*- **Dictation.** Press a global shortcut, speak, and whisper types the text where your cursor is. *beta*-### <img src="https://api.iconify.design/ph:film-slate.svg?color=%238E3FD8" width="20" height="20" align="center" alt="Video editing" /> Video editing (14)+### <img src="https://api.iconify.design/ph/film-slate.svg?color=%238E3FD8" width="20" height="20" align="center" alt="Video editing" /> Video editing (14)- **Cut a clip.** Pick a video on disk and cut out a section. The result lands in the downloads queue.- **Convert.** Change container, codec or resolution, or compress, through the Convert plugin.@@ -318,7 +318,7 @@ Status legend: no mark means ready, **beta** means it works but has not been tes- **Record screen.** Screen and system audio through FFmpeg, with a replay buffer that saves what just happened. *beta*- **Timeline editor.** *planned*-### <img src="https://api.iconify.design/ph:speaker-high.svg?color=%23E0203F" width="20" height="20" align="center" alt="Audio" /> Audio (2)+### <img src="https://api.iconify.design/ph/speaker-high.svg?color=%23E0203F" width="20" height="20" align="center" alt="Audio" /> Audio (2)- **Normalize loudness.** Two-pass EBU R128, so the audio lands where streaming, podcast or broadcast expects it.- **Remove noise.** Hiss, fan and room noise taken out of a recording, with nothing to download.@@ -410,7 +410,7 @@ Video downloads from Bilibili live on the home screen. These two are about the f- **Themes and colors.** Customize the Spotify client with Spicetify themes. *beta*- **Extensions.** Install Spicetify extensions and custom apps from its Marketplace. *beta*-### <img src="https://api.iconify.design/ph:music-notes.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="Music" /> Music (3)+### <img src="https://api.iconify.design/ph/music-notes.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="Music" /> Music (3)- **Playlist to M3U.** Match an exported playlist with the audio files you own and write `.m3u8` and `.pls` for any local player.- **Synced lyrics.** Fetch lyrics from LRCLIB and save an `.lrc` next to each track.@@ -425,13 +425,13 @@ All four read the official data export LinkedIn lets you request, on your own ma- **Messages.** Browse your chat history and save it as a local page.- **Profile score.** An offline completeness check with what is missing.-### <img src="https://api.iconify.design/ph:game-controller.svg?color=%233D5BF0" width="20" height="20" align="center" alt="Games" /> Games (3)+### <img src="https://api.iconify.design/ph/game-controller.svg?color=%233D5BF0" width="20" height="20" align="center" alt="Games" /> Games (3)- **Switch album.** Import screenshots and clips from the Switch SD card, named by game and date.- **Clip organizer.** Sort Game Bar, ShadowPlay, OBS and Steam captures into folders by game.- **Runs on Linux?** The ProtonDB tier for one game or your whole Steam library.-### <img src="https://api.iconify.design/ph:file-pdf.svg?color=%23E0303A" width="20" height="20" align="center" alt="PDF" /> PDF (13)+### <img src="https://api.iconify.design/ph/file-pdf.svg?color=%23E0303A" width="20" height="20" align="center" alt="PDF" /> PDF (13)- **Merge.** Join several PDFs into one, in the order you choose.- **Split.** Extract pages or break a PDF into parts.@@ -447,7 +447,7 @@ All four read the official data export LinkedIn lets you request, on your own ma- **Safe PDF.** Rebuild a PDF from pixels to strip scripts and forms.- **PDF to Markdown.** Clean Markdown with headings, lists and tables, ready to paste into an LLM.-### <img src="https://api.iconify.design/ph:file-text.svg?color=%231E6FE8" width="20" height="20" align="center" alt="Documents" /> Documents (5)+### <img src="https://api.iconify.design/ph/file-text.svg?color=%231E6FE8" width="20" height="20" align="center" alt="Documents" /> Documents (5)- **SlideShare to PDF.** Every slide at the largest size, assembled into one PDF.- **Google Docs export.** Public Docs, Slides and Sheets as PDF, DOCX, PPTX or XLSX.@@ -455,7 +455,7 @@ All four read the official data export LinkedIn lets you request, on your own ma- **Image galleries.** Whole galleries and profiles from 250+ sites with gallery-dl.- **Scribd.** Save readable books as PDF using your own session. *planned*-### <img src="https://api.iconify.design/ph:images.svg?color=%23E0A800" width="20" height="20" align="center" alt="Images" /> Images (9)+### <img src="https://api.iconify.design/ph/images.svg?color=%23E0A800" width="20" height="20" align="center" alt="Images" /> Images (9)- **Upscale.** Real-ESRGAN on any Vulkan GPU, 2x, 3x or 4x. *beta*- **Resize images.** Batch resize by width, height, fit or percent, converting the format if you want.@@ -467,7 +467,7 @@ All four read the official data export LinkedIn lets you request, on your own ma- **Spritesheet.** Slice a sheet into frames, pack frames back with an atlas, or resize a folder by rule.- **OCR.** Copy the text out of images and slides. *beta*-### <img src="https://api.iconify.design/ph:broom.svg?color=%231A9EB5" width="20" height="20" align="center" alt="System" /> System (10, Windows-only items marked)+### <img src="https://api.iconify.design/ph/broom.svg?color=%231A9EB5" width="20" height="20" align="center" alt="System" /> System (10, Windows-only items marked)- **Clean caches.** Temp files, logs and app caches with rules per operating system. You review the list before anything is deleted.- **Disk analyzer.** What takes space, as a treemap plus the largest files, with a send-to-trash button.@@ -480,7 +480,7 @@ All four read the official data export LinkedIn lets you request, on your own ma- **Registry cleaner.** Orphaned entries, with a `.reg` backup before removal. Windows. *beta*- **Software updater.** Update programs in bulk through winget, Chocolatey and Scoop. Windows. *beta*-### <img src="https://api.iconify.design/ph:folder-simple.svg?color=%23A66A24" width="20" height="20" align="center" alt="Files" /> Files (5)+### <img src="https://api.iconify.design/ph/folder-simple.svg?color=%23A66A24" width="20" height="20" align="center" alt="Files" /> Files (5)- **Duplicates.** Find identical files by hash and free space safely.- **Bulk rename.** Regex, counters and case changes with a preview before applying.@@ -488,20 +488,20 @@ All four read the official data export LinkedIn lets you request, on your own ma- **Find files.** Instant search with Everything on Windows, Spotlight on macOS or fd on Linux.- **Keep awake.** Stop the computer from sleeping during long jobs.-### <img src="https://api.iconify.design/ph:cloud-arrow-down.svg?color=%231E6FE8" width="20" height="20" align="center" alt="Downloads" /> Downloads (2)+### <img src="https://api.iconify.design/ph/cloud-arrow-down.svg?color=%231E6FE8" width="20" height="20" align="center" alt="Downloads" /> Downloads (2)- **Accelerated download.** Big files with 16 connections, resume and checksum via aria2.- **HLS / DASH manifest.** Paste a `.m3u8` or `.mpd` with Referer and cookie. FFmpeg saves an MP4.-### <img src="https://api.iconify.design/ph:cursor-click.svg?color=%23F28500" width="20" height="20" align="center" alt="Automation" /> Automation (1)+### <img src="https://api.iconify.design/ph/cursor-click.svg?color=%23F28500" width="20" height="20" align="center" alt="Automation" /> Automation (1)- **Auto clicker.** Click at the exact speed you set, with a global hotkey, limits and random ranges. Windows, macOS and Linux. *beta*-### <img src="https://api.iconify.design/ph:device-mobile.svg?color=%232AA845" width="20" height="20" align="center" alt="Phone" /> Phone (1)+### <img src="https://api.iconify.design/ph/device-mobile.svg?color=%232AA845" width="20" height="20" align="center" alt="Phone" /> Phone (1)- **Send to phone.** Files, links and text to a paired KDE Connect device.-### <img src="https://api.iconify.design/ph:sparkle.svg?color=%233D5BF0" width="20" height="20" align="center" alt="AI" /> AI (6)+### <img src="https://api.iconify.design/ph/sparkle.svg?color=%233D5BF0" width="20" height="20" align="center" alt="AI" /> AI (6)- **Compare prices.** The cost of the same model across providers, with prices from LiteLLM and models.dev.- **AI spending.** How much LibreGet spent on AI, by day, model and task, from a local ledger.@@ -510,7 +510,7 @@ All four read the official data export LinkedIn lets you request, on your own ma- **API keys.** A local vault for keys and accounts, with a connection test, balance for OpenRouter, DeepSeek, SiliconFlow and New API, and export to Claude Code, Codex, Cherry Studio, opencode or a `.env` file.- **MCP server.** LibreGet's tools exposed over the Model Context Protocol on the local bridge, 37 tools behind the same token the extension uses, with ready-made config snippets for Claude Code, Claude Desktop, Cursor, VS Code, Goose and Codex. See [LibreGet for AI agents](#libreget-for-ai-agents-mcp-server-and-claude-code-plugin). *beta*-### <img src="https://api.iconify.design/ph:sword.svg?color=%236F6F75" width="20" height="20" align="center" alt="CTF and analysis" /> CTF and analysis (6)+### <img src="https://api.iconify.design/ph/sword.svg?color=%236F6F75" width="20" height="20" align="center" alt="CTF and analysis" /> CTF and analysis (6)Six small offline utilities for capture-the-flag puzzles, forensics homework and "what is this file" moments.@@ -559,7 +559,7 @@ Core plugins are embedded directly into the application binary, eliminating runt<img src="assets/readme/marketplace.png" alt="LibreGet Marketplace listing the Courses, Telegram and Convert plugins with version, author, permissions and enable switches" width="900" /></p>-### <img src="https://api.iconify.design/ph:graduation-cap.svg?color=%23F28500" width="20" height="20" align="center" alt="Courses" /> Courses+### <img src="https://api.iconify.design/ph/graduation-cap.svg?color=%23F28500" width="20" height="20" align="center" alt="Courses" /> CoursesThe embedded Courses plugin supports 38 learning platforms, including **Hotmart**, **Udemy**, **Kiwify**, **Rocketseat**, **Coursera**, **Domestika**, **Skillshare**, **Alura**, and **Ebac**. Sign in through a webview inside the app, with saved cookies from the extension, or with account credentials where available. LibreGet lists your purchases, opens the course outline so you can select the sections you want (DRM-protected lectures are skipped and reported), and downloads lessons and attachments with optional continuous numbering.@@ -567,7 +567,7 @@ The embedded Courses plugin supports 38 learning platforms, including **Hotmart*Sign in with a QR code or your phone number. Browse every channel and group you belong to, filter by photo, video, document or audio, search files, and download individual media or entire chat archives with a progress list. Media downloads are organized into `{download_dir}/LibreGram/{channel_name}/` with sanitized folder names.-### <img src="https://api.iconify.design/ph:arrows-clockwise.svg?color=%232AA845" width="20" height="20" align="center" alt="Convert" /> Convert+### <img src="https://api.iconify.design/ph/arrows-clockwise.svg?color=%232AA845" width="20" height="20" align="center" alt="Convert" /> ConvertFFmpeg conversions with GPU acceleration where the machine has it: container, codec, resolution, bitrate and compression for video and audio, no internet required.diff --git a/README.ru.md b/README.ru.mdindex e98af962..1b527292 100644--- a/README.ru.md+++ b/README.ru.md@@ -195,12 +195,12 @@ sudo pacman -S gst-plugins-good gst-plugins-bad gst-libav # Arch| Категория | Сайты и форматы ||---|---|-| <img src="https://api.iconify.design/ph:graduation-cap.svg?color=%23F28500" width="18" height="18" align="center" alt="Онлайн-курсы" /> Онлайн-курсы | Hotmart, Udemy, Kiwify, Rocketseat и Meta-Analysis Academy через плагин Courses. Каждый урок, выбор разделов, вложения, продолжение с места остановки. |-| <img src="https://api.iconify.design/ph:film-slate.svg?color=%238E3FD8" width="18" height="18" align="center" alt="Видео и аудио" /> Видео и аудио | YouTube (видео, плейлисты, каналы, трансляции с начала, главы, SponsorBlock), Instagram, TikTok, X/Twitter, Reddit, Twitch (VOD, клипы, трансляции), Vimeo, Bluesky, Threads, Pinterest, Douyin |+| <img src="https://api.iconify.design/ph/graduation-cap.svg?color=%23F28500" width="18" height="18" align="center" alt="Онлайн-курсы" /> Онлайн-курсы | Hotmart, Udemy, Kiwify, Rocketseat и Meta-Analysis Academy через плагин Courses. Каждый урок, выбор разделов, вложения, продолжение с места остановки. |+| <img src="https://api.iconify.design/ph/film-slate.svg?color=%238E3FD8" width="18" height="18" align="center" alt="Видео и аудио" /> Видео и аудио | YouTube (видео, плейлисты, каналы, трансляции с начала, главы, SponsorBlock), Instagram, TikTok, X/Twitter, Reddit, Twitch (VOD, клипы, трансляции), Vimeo, Bluesky, Threads, Pinterest, Douyin || <img src="https://cdn.simpleicons.org/bilibili/00A1D6" width="18" height="18" align="center" alt="Bilibili" /> Bilibili, с входом в аккаунт | 4K, HDR, Dolby Vision, Hi-Res без потерь и Dolby Atmos в соответствии с вашей подпиской. Комментарии данмаку в виде XML, ASS или JSON, файлы NFO для Kodi и Jellyfin, свои шаблоны имён, 11 типов URL, включая bangumi, курсы, избранное, «посмотреть позже» и историю |-| <img src="https://api.iconify.design/ph:images.svg?color=%23E0A800" width="18" height="18" align="center" alt="Галереи изображений" /> Галереи изображений | Целые галереи и профили с 250+ сайтов через gallery-dl (DeviantArt, Pixiv, ArtStation, Flickr, Tumblr, Imgur, Kemono и другие) |-| <img src="https://api.iconify.design/ph:stack.svg?color=%23FFB340" width="18" height="18" align="center" alt="Массово" /> Массово | Вставьте много ссылок или загрузите `.txt`, скачивайте целые сабреддиты, профили Reddit и X, профили Instagram и Pinterest, альбомы Facebook |-| <img src="https://api.iconify.design/ph:folder-simple.svg?color=%23A66A24" width="18" height="18" align="center" alt="Файлы и передача" /> Файлы и передача | Файлы `.torrent` и magnet-ссылки со встроенным BitTorrent-клиентом, прямые файлы по HTTP, манифесты HLS и DASH и передача от человека к человеку между двумя установками LibreGet по короткому коду-слову |+| <img src="https://api.iconify.design/ph/images.svg?color=%23E0A800" width="18" height="18" align="center" alt="Галереи изображений" /> Галереи изображений | Целые галереи и профили с 250+ сайтов через gallery-dl (DeviantArt, Pixiv, ArtStation, Flickr, Tumblr, Imgur, Kemono и другие) |+| <img src="https://api.iconify.design/ph/stack.svg?color=%23FFB340" width="18" height="18" align="center" alt="Массово" /> Массово | Вставьте много ссылок или загрузите `.txt`, скачивайте целые сабреддиты, профили Reddit и X, профили Instagram и Pinterest, альбомы Facebook |+| <img src="https://api.iconify.design/ph/folder-simple.svg?color=%23A66A24" width="18" height="18" align="center" alt="Файлы и передача" /> Файлы и передача | Файлы `.torrent` и magnet-ссылки со встроенным BitTorrent-клиентом, прямые файлы по HTTP, манифесты HLS и DASH и передача от человека к человеку между двумя установками LibreGet по короткому коду-слову || <img src="https://cdn.simpleicons.org/telegram/2CA5E0" width="18" height="18" align="center" alt="Telegram" /> Telegram | Фото, видео, файлы и аудио из любого канала или группы, где вы состоите, через плагин Telegram |Настройки, которые задаются один раз: качество по умолчанию, формат только аудио (MP3, M4A, Opus, FLAC или WAV), языки и формат субтитров (SRT, VTT, ASS, встроенные или отдельным файлом), встраивание обложки и метаданных, шаблон имени файла, папки по платформам, пропуск существующих файлов, разбиение по главам, ограничение скорости, число одновременных загрузок, прокси. Правила отправляют канал или хост в выбранную папку и качество, не спрашивая снова. Отслеживаемые каналы проверяются в фоне и могут скачивать новые ролики автоматически с уведомлением в трее.@@ -292,7 +292,7 @@ Firefox: **Настройки → Плагины → Расширение для- **Настоящая обложка.** Кадры на отметках 25, 50 и 75 %, которые уже есть на CDN, вместо кликбейтной обложки.- **Принудительно H.264.** Переключатель в расширении для браузера, который держит YouTube на H.264 вместо VP9 и AV1, — для машин, которые тормозят на новых кодеках.-### <img src="https://api.iconify.design/ph:waveform.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="Речь и субтитры" /> Речь и субтитры (8)+### <img src="https://api.iconify.design/ph/waveform.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="Речь и субтитры" /> Речь и субтитры (8)- **Распознать речь.** Аудио или видео в субтитры через whisper.cpp, офлайн. Модели скачиваются по запросу, ускорение Metal на macOS.- **Текст в речь.** Естественные голоса из Microsoft Edge, бесплатно, с синхронизированным файлом субтитров.@@ -301,7 +301,7 @@ Firefox: **Настройки → Плагины → Расширение для- **Клонирование голоса**, **Проектирование голоса** и **Выделение вокала** через установленный на вашей машине VoiceStudio. *бета*- **Диктовка.** Нажмите глобальную комбинацию, говорите — и whisper напечатает текст там, где стоит курсор. *бета*-### <img src="https://api.iconify.design/ph:film-slate.svg?color=%238E3FD8" width="20" height="20" align="center" alt="Видеомонтаж" /> Видеомонтаж (14)+### <img src="https://api.iconify.design/ph/film-slate.svg?color=%238E3FD8" width="20" height="20" align="center" alt="Видеомонтаж" /> Видеомонтаж (14)- **Вырезать клип.** Выберите видео на диске и вырежьте фрагмент. Результат попадёт в очередь загрузок.- **Конвертировать.** Смените контейнер, кодек или разрешение либо сожмите файл через плагин Convert.@@ -317,7 +317,7 @@ Firefox: **Настройки → Плагины → Расширение для- **Запись экрана.** Экран и системный звук через FFmpeg, плюс буфер повтора, сохраняющий то, что только что произошло. *бета*- **Редактор таймлайна.** *в планах*-### <img src="https://api.iconify.design/ph:speaker-high.svg?color=%23E0203F" width="20" height="20" align="center" alt="Аудио" /> Аудио (2)+### <img src="https://api.iconify.design/ph/speaker-high.svg?color=%23E0203F" width="20" height="20" align="center" alt="Аудио" /> Аудио (2)- **Нормализация громкости.** Двухпроходный EBU R128 — звук попадёт на уровень, которого ждут стриминг, подкасты или вещание.- **Подавление шума.** Шипение, шум вентилятора и комнаты убираются из записи — ничего скачивать не нужно.@@ -409,7 +409,7 @@ Firefox: **Настройки → Плагины → Расширение для- **Темы и цвета.** Настройте клиент Spotify темами Spicetify. *бета*- **Расширения.** Устанавливайте расширения Spicetify и пользовательские приложения из его Marketplace. *бета*-### <img src="https://api.iconify.design/ph:music-notes.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="Музыка" /> Музыка (3)+### <img src="https://api.iconify.design/ph/music-notes.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="Музыка" /> Музыка (3)- **Плейлист в M3U.** Сопоставьте экспортированный плейлист со своими аудиофайлами и запишите `.m3u8` и `.pls` для любого локального плеера.- **Синхронизированные тексты.** Загрузите тексты песен из LRCLIB и сохраните `.lrc` рядом с каждым треком.@@ -424,13 +424,13 @@ Firefox: **Настройки → Плагины → Расширение для- **Сообщения.** Просмотрите историю переписки и сохраните её как локальную страницу.- **Оценка профиля.** Офлайн-проверка полноты профиля со списком того, чего не хватает.-### <img src="https://api.iconify.design/ph:game-controller.svg?color=%233D5BF0" width="20" height="20" align="center" alt="Игры" /> Игры (3)+### <img src="https://api.iconify.design/ph/game-controller.svg?color=%233D5BF0" width="20" height="20" align="center" alt="Игры" /> Игры (3)- **Альбом Switch.** Импортируйте скриншоты и клипы с SD-карты Switch — с именами по игре и дате.- **Организатор клипов.** Разложите записи Game Bar, ShadowPlay, OBS и Steam по папкам для каждой игры.- **Запустится на Linux?** Уровень ProtonDB для одной игры или всей вашей библиотеки Steam.-### <img src="https://api.iconify.design/ph:file-pdf.svg?color=%23E0303A" width="20" height="20" align="center" alt="PDF" /> PDF (13)+### <img src="https://api.iconify.design/ph/file-pdf.svg?color=%23E0303A" width="20" height="20" align="center" alt="PDF" /> PDF (13)- **Объединить.** Соедините несколько PDF в один в нужном вам порядке.- **Разделить.** Извлеките страницы или разбейте PDF на части.@@ -446,7 +446,7 @@ Firefox: **Настройки → Плагины → Расширение для- **Безопасный PDF.** Пересоберите PDF из пикселей, удалив скрипты и формы.- **PDF в Markdown.** Чистый Markdown с заголовками, списками и таблицами — готовый к вставке в LLM.-### <img src="https://api.iconify.design/ph:file-text.svg?color=%231E6FE8" width="20" height="20" align="center" alt="Документы" /> Документы (5)+### <img src="https://api.iconify.design/ph/file-text.svg?color=%231E6FE8" width="20" height="20" align="center" alt="Документы" /> Документы (5)- **SlideShare в PDF.** Каждый слайд в максимальном размере, собранный в один PDF.- **Экспорт Google Docs.** Публичные Docs, Slides и Sheets в формате PDF, DOCX, PPTX или XLSX.@@ -454,7 +454,7 @@ Firefox: **Настройки → Плагины → Расширение для- **Галереи изображений.** Целые галереи и профили с 250+ сайтов с помощью gallery-dl.- **Scribd.** Сохраняйте читаемые книги как PDF через вашу сессию. *в планах*-### <img src="https://api.iconify.design/ph:images.svg?color=%23E0A800" width="20" height="20" align="center" alt="Изображения" /> Изображения (9)+### <img src="https://api.iconify.design/ph/images.svg?color=%23E0A800" width="20" height="20" align="center" alt="Изображения" /> Изображения (9)- **Увеличение.** Real-ESRGAN на любом GPU с поддержкой Vulkan, 2x, 3x или 4x. *бета*- **Изменение размера.** Пакетно по ширине, высоте, вписыванию или процентам, при желании со сменой формата.@@ -466,7 +466,7 @@ Firefox: **Настройки → Плагины → Расширение для- **Спрайт-лист.** Нарежьте лист на кадры, соберите кадры обратно вместе с атласом или измените размер папки по правилу.- **OCR.** Скопируйте текст из изображений и слайдов. *бета*-### <img src="https://api.iconify.design/ph:broom.svg?color=%231A9EB5" width="20" height="20" align="center" alt="Система" /> Система (10, пункты только для Windows отмечены)+### <img src="https://api.iconify.design/ph/broom.svg?color=%231A9EB5" width="20" height="20" align="center" alt="Система" /> Система (10, пункты только для Windows отмечены)- **Очистка кэшей.** Временные файлы, логи и кэши приложений по правилам для каждой операционной системы. Вы просматриваете список, прежде чем что-то удалится.- **Анализ диска.** Что занимает место: карта-дерево и самые большие файлы, с кнопкой отправки в корзину.@@ -479,7 +479,7 @@ Firefox: **Настройки → Плагины → Расширение для- **Очистка реестра.** Осиротевшие записи, с резервной копией `.reg` перед удалением. Windows. *бета*- **Обновление ПО.** Обновляйте программы пакетно через winget, Chocolatey и Scoop. Windows. *бета*-### <img src="https://api.iconify.design/ph:folder-simple.svg?color=%23A66A24" width="20" height="20" align="center" alt="Файлы" /> Файлы (5)+### <img src="https://api.iconify.design/ph/folder-simple.svg?color=%23A66A24" width="20" height="20" align="center" alt="Файлы" /> Файлы (5)- **Дубликаты.** Найдите одинаковые файлы по хешу и безопасно освободите место.- **Массовое переименование.** Регулярные выражения, счётчики и смена регистра с предпросмотром перед применением.@@ -487,20 +487,20 @@ Firefox: **Настройки → Плагины → Расширение для- **Поиск файлов.** Мгновенный поиск через Everything на Windows, Spotlight на macOS или fd на Linux.- **Предотвращение сна.** Не давайте компьютеру уснуть во время долгих задач.-### <img src="https://api.iconify.design/ph:cloud-arrow-down.svg?color=%231E6FE8" width="20" height="20" align="center" alt="Загрузки" /> Загрузки (2)+### <img src="https://api.iconify.design/ph/cloud-arrow-down.svg?color=%231E6FE8" width="20" height="20" align="center" alt="Загрузки" /> Загрузки (2)- **Ускоренная загрузка.** Большие файлы в 16 соединений, докачка и контрольная сумма через aria2.- **Манифест HLS / DASH.** Вставьте `.m3u8` или `.mpd` с Referer и cookie. FFmpeg сохранит MP4.-### <img src="https://api.iconify.design/ph:cursor-click.svg?color=%23F28500" width="20" height="20" align="center" alt="Автоматизация" /> Автоматизация (1)+### <img src="https://api.iconify.design/ph/cursor-click.svg?color=%23F28500" width="20" height="20" align="center" alt="Автоматизация" /> Автоматизация (1)- **Авто-кликер.** Кликайте с точно заданной скоростью, с глобальной горячей клавишей, лимитами и случайными диапазонами. Windows, macOS и Linux. *бета*-### <img src="https://api.iconify.design/ph:device-mobile.svg?color=%232AA845" width="20" height="20" align="center" alt="Телефон" /> Телефон (1)+### <img src="https://api.iconify.design/ph/device-mobile.svg?color=%232AA845" width="20" height="20" align="center" alt="Телефон" /> Телефон (1)- **Отправить на телефон.** Файлы, ссылки и текст на сопряжённое устройство KDE Connect.-### <img src="https://api.iconify.design/ph:sparkle.svg?color=%233D5BF0" width="20" height="20" align="center" alt="ИИ" /> ИИ (6)+### <img src="https://api.iconify.design/ph/sparkle.svg?color=%233D5BF0" width="20" height="20" align="center" alt="ИИ" /> ИИ (6)- **Сравнение цен.** Стоимость одной и той же модели у разных провайдеров, с ценами из LiteLLM и models.dev.- **Расходы на ИИ.** Сколько LibreGet потратил на ИИ — по дням, моделям и задачам, из локального журнала.@@ -509,7 +509,7 @@ Firefox: **Настройки → Плагины → Расширение для- **API-ключи.** Локальное хранилище ключей и аккаунтов с проверкой соединения, балансом для OpenRouter, DeepSeek, SiliconFlow и New API и экспортом в Claude Code, Codex, Cherry Studio, opencode или файл `.env`.- **MCP-сервер.** Инструменты LibreGet, открытые по Model Context Protocol через локальный мост: 37 инструментов за тем же токеном, что использует расширение, с готовыми фрагментами конфигурации для Claude Code, Claude Desktop, Cursor, VS Code, Goose и Codex. Смотрите [LibreGet для ИИ-агентов](#libreget-для-ии-агентов-mcp-сервер-и-плагин-для-claude-code). *бета*-### <img src="https://api.iconify.design/ph:sword.svg?color=%236F6F75" width="20" height="20" align="center" alt="CTF и анализ" /> CTF и анализ (6)+### <img src="https://api.iconify.design/ph/sword.svg?color=%236F6F75" width="20" height="20" align="center" alt="CTF и анализ" /> CTF и анализ (6)Шесть небольших офлайн-утилит для задач capture-the-flag, домашних работ по форензике и моментов «что это за файл».@@ -558,7 +558,7 @@ Firefox: **Настройки → Плагины → Расширение для<img src="assets/readme/marketplace.png" alt="Marketplace LibreGet со списком плагинов Courses, Telegram и Convert: версия, автор, разрешения и переключатели" width="900" /></p>-### <img src="https://api.iconify.design/ph:graduation-cap.svg?color=%23F28500" width="20" height="20" align="center" alt="Courses" /> Courses+### <img src="https://api.iconify.design/ph/graduation-cap.svg?color=%23F28500" width="20" height="20" align="center" alt="Courses" /> CoursesВойдите в **Hotmart**, **Udemy**, **Kiwify**, **Rocketseat** или **Meta-Analysis Academy** через окно браузера внутри приложения, с cookies, сохранёнными расширением, или по email и паролю там, где платформа это позволяет. LibreGet покажет ваши покупки, откроет оглавление курса, чтобы отметить нужные разделы (с подсказкой, сколько уроков защищено DRM и будет пропущено), и скачает все уроки и вложения, при желании со сквозной нумерацией. Hotmart использует актуальный вход через OIDC, так что всё работает после смены авторизации в 2026 году; бесплатные курсы и курсы, выдаваемые вне Hotmart Club, тоже показываются в списке.@@ -566,7 +566,7 @@ Firefox: **Настройки → Плагины → Расширение дляВойдите по QR-коду или номеру телефона. Просматривайте все каналы и группы, где вы состоите, фильтруйте по фото, видео, документам или аудио, ищите файлы и скачивайте один элемент или весь чат со списком прогресса.-### <img src="https://api.iconify.design/ph:arrows-clockwise.svg?color=%232AA845" width="20" height="20" align="center" alt="Convert" /> Convert+### <img src="https://api.iconify.design/ph/arrows-clockwise.svg?color=%232AA845" width="20" height="20" align="center" alt="Convert" /> ConvertКонвертация через FFmpeg с GPU-ускорением, если оно есть: контейнер, кодек, разрешение, битрейт и сжатие видео и аудио, без интернета.diff --git a/README_pt_br.md b/README_pt_br.mdindex 01d734b6..f4ae0871 100644--- a/README_pt_br.md+++ b/README_pt_br.md@@ -172,12 +172,12 @@ O LibreGet tem extratores nativos para as plataformas que as pessoas mais usam e| Categoria | Sites e formatos ||---|---|-| <img src="https://api.iconify.design/ph:graduation-cap.svg?color=%23F28500" width="18" height="18" align="center" alt="Cursos online" /> Cursos online | Hotmart, Udemy, Kiwify, Rocketseat e Meta-Analysis Academy pelo plugin Courses. Todas as aulas, escolha de seções, anexos, continuar de onde parou. |-| <img src="https://api.iconify.design/ph:film-slate.svg?color=%238E3FD8" width="18" height="18" align="center" alt="Vídeo e áudio" /> Vídeo e áudio | YouTube (vídeos, playlists, canais, live desde o início, capítulos, SponsorBlock), Instagram, TikTok, X/Twitter, Reddit, Twitch (VODs, clipes, ao vivo), Vimeo, Bluesky, Threads, Pinterest, Douyin |+| <img src="https://api.iconify.design/ph/graduation-cap.svg?color=%23F28500" width="18" height="18" align="center" alt="Cursos online" /> Cursos online | Hotmart, Udemy, Kiwify, Rocketseat e Meta-Analysis Academy pelo plugin Courses. Todas as aulas, escolha de seções, anexos, continuar de onde parou. |+| <img src="https://api.iconify.design/ph/film-slate.svg?color=%238E3FD8" width="18" height="18" align="center" alt="Vídeo e áudio" /> Vídeo e áudio | YouTube (vídeos, playlists, canais, live desde o início, capítulos, SponsorBlock), Instagram, TikTok, X/Twitter, Reddit, Twitch (VODs, clipes, ao vivo), Vimeo, Bluesky, Threads, Pinterest, Douyin || <img src="https://cdn.simpleicons.org/bilibili/00A1D6" width="18" height="18" align="center" alt="Bilibili" /> Bilibili, logado | 4K, HDR, Dolby Vision, Hi-Res sem perdas e Dolby Atmos conforme sua assinatura. Danmaku em XML, ASS ou JSON, arquivos NFO para Kodi e Jellyfin, modelos de nome, 11 tipos de URL incluindo bangumi, cursos, favoritos, assistir depois e histórico |-| <img src="https://api.iconify.design/ph:images.svg?color=%23E0A800" width="18" height="18" align="center" alt="Galerias de imagens" /> Galerias de imagens | Galerias e perfis inteiros de mais de 250 sites via gallery-dl (DeviantArt, Pixiv, ArtStation, Flickr, Tumblr, Imgur, Kemono e outros) |-| <img src="https://api.iconify.design/ph:stack.svg?color=%23FFB340" width="18" height="18" align="center" alt="Em lote" /> Em lote | Cole vários links ou carregue um `.txt`, baixe subreddits inteiros, perfis do Reddit e do X, perfis do Instagram e do Pinterest |-| <img src="https://api.iconify.design/ph:folder-simple.svg?color=%23A66A24" width="18" height="18" align="center" alt="Arquivos e transferência" /> Arquivos e transferência | Arquivos `.torrent` e magnets com cliente BitTorrent embutido, arquivos HTTP diretos, manifestos HLS e DASH, e transferência direta entre duas instalações do LibreGet com um código curto de palavras |+| <img src="https://api.iconify.design/ph/images.svg?color=%23E0A800" width="18" height="18" align="center" alt="Galerias de imagens" /> Galerias de imagens | Galerias e perfis inteiros de mais de 250 sites via gallery-dl (DeviantArt, Pixiv, ArtStation, Flickr, Tumblr, Imgur, Kemono e outros) |+| <img src="https://api.iconify.design/ph/stack.svg?color=%23FFB340" width="18" height="18" align="center" alt="Em lote" /> Em lote | Cole vários links ou carregue um `.txt`, baixe subreddits inteiros, perfis do Reddit e do X, perfis do Instagram e do Pinterest |+| <img src="https://api.iconify.design/ph/folder-simple.svg?color=%23A66A24" width="18" height="18" align="center" alt="Arquivos e transferência" /> Arquivos e transferência | Arquivos `.torrent` e magnets com cliente BitTorrent embutido, arquivos HTTP diretos, manifestos HLS e DASH, e transferência direta entre duas instalações do LibreGet com um código curto de palavras || <img src="https://cdn.simpleicons.org/telegram/2CA5E0" width="18" height="18" align="center" alt="Telegram" /> Telegram | Fotos, vídeos, arquivos e áudios de qualquer canal ou grupo em que você esteja, pelo plugin Telegram |Opções que você define uma vez e esquece: qualidade padrão, formato de áudio (MP3, M4A, Opus, FLAC ou WAV), idiomas e formato de legenda (SRT, VTT, ASS, embutida ou ao lado), thumbnail e metadados embutidos, modelo de nome de arquivo, organizar por plataforma, pular arquivos existentes, dividir por capítulos, limite de velocidade, downloads simultâneos, proxy. Regras mandam um canal ou host para a pasta e a qualidade que você escolher sem perguntar de novo. Canais seguidos são verificados em segundo plano e podem baixar novos vídeos automaticamente, com notificação na bandeja.@@ -259,7 +259,7 @@ Legenda de status: sem marca significa pronta, **beta** significa que funciona m- **Thumbnail real.** Os frames que a CDN já tem em 25, 50 e 75 por cento, em vez da capa clickbait.- **Forçar H.264.** Um interruptor na extensão do navegador que mantém o YouTube em H.264 em vez de VP9 e AV1, para máquinas que engasgam com codecs novos.-### <img src="https://api.iconify.design/ph:waveform.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="Fala e legendas" /> Fala e legendas (8)+### <img src="https://api.iconify.design/ph/waveform.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="Fala e legendas" /> Fala e legendas (8)- **Transcrever.** Áudio ou vídeo para legendas com whisper.cpp, offline. Modelos baixam sob demanda, aceleração Metal no macOS.- **Texto para fala.** Vozes naturais do Microsoft Edge, grátis, com arquivo de legenda sincronizado.@@ -268,7 +268,7 @@ Legenda de status: sem marca significa pronta, **beta** significa que funciona m- **Clonar voz**, **Criar voz** e **Isolar vocais** por uma instalação do VoiceStudio na sua máquina. *beta*- **Ditado.** Aperte um atalho global, fale, e o whisper digita o texto onde o cursor está. *beta*-### <img src="https://api.iconify.design/ph:film-slate.svg?color=%238E3FD8" width="20" height="20" align="center" alt="Edição de vídeo" /> Edição de vídeo (6)+### <img src="https://api.iconify.design/ph/film-slate.svg?color=%238E3FD8" width="20" height="20" align="center" alt="Edição de vídeo" /> Edição de vídeo (6)- **Cortar trecho.** Escolha um vídeo no disco e corte um pedaço. O resultado cai na fila de downloads.- **Converter.** Troque contêiner, codec ou resolução, ou comprima, pelo plugin Convert.@@ -340,7 +340,7 @@ Funciona sem login para tudo que é público. Cookies só são necessários para- **Temas e cores.** Personalize o cliente do Spotify com temas do Spicetify. *beta*- **Extensões.** Instale extensões e apps do Marketplace do Spicetify. *beta*-### <img src="https://api.iconify.design/ph:file-pdf.svg?color=%23E0303A" width="20" height="20" align="center" alt="PDF" /> PDF (6)+### <img src="https://api.iconify.design/ph/file-pdf.svg?color=%23E0303A" width="20" height="20" align="center" alt="PDF" /> PDF (6)- **Juntar.** Una vários PDFs em um, na ordem que quiser.- **Dividir.** Extraia páginas ou quebre um PDF em partes.@@ -349,7 +349,7 @@ Funciona sem login para tudo que é público. Cookies só são necessários para- **OCR.** Torne PDFs escaneados pesquisáveis. *beta*- **PDF seguro.** Reconstrua um PDF a partir de pixels para remover scripts e formulários.-### <img src="https://api.iconify.design/ph:file-text.svg?color=%231E6FE8" width="20" height="20" align="center" alt="Documentos" /> Documentos (5)+### <img src="https://api.iconify.design/ph/file-text.svg?color=%231E6FE8" width="20" height="20" align="center" alt="Documentos" /> Documentos (5)- **SlideShare para PDF.** Todos os slides no maior tamanho, montados em um PDF.- **Exportar Google Docs.** Docs, Slides e Sheets públicos em PDF, DOCX, PPTX ou XLSX.@@ -357,29 +357,29 @@ Funciona sem login para tudo que é público. Cookies só são necessários para- **Galerias de imagens.** Galerias e perfis inteiros de mais de 250 sites com gallery-dl.- **Scribd.** Salve livros legíveis em PDF usando a sua própria sessão. *planejada*-### <img src="https://api.iconify.design/ph:images.svg?color=%23E0A800" width="20" height="20" align="center" alt="Imagens" /> Imagens (3)+### <img src="https://api.iconify.design/ph/images.svg?color=%23E0A800" width="20" height="20" align="center" alt="Imagens" /> Imagens (3)- **Upscale.** Real-ESRGAN em qualquer GPU Vulkan, 2x, 3x ou 4x. *beta*- **Redimensionar imagens.** Em lote por largura, altura, encaixe ou porcentagem, convertendo o formato se quiser.- **OCR.** Copie o texto de imagens e slides. *beta*-### <img src="https://api.iconify.design/ph:folder-simple.svg?color=%23A66A24" width="20" height="20" align="center" alt="Arquivos" /> Arquivos (4)+### <img src="https://api.iconify.design/ph/folder-simple.svg?color=%23A66A24" width="20" height="20" align="center" alt="Arquivos" /> Arquivos (4)- **Duplicados.** Encontre arquivos idênticos por hash e libere espaço com segurança.- **Renomear em lote.** Regex, contadores e troca de caixa com prévia antes de aplicar.- **Encontrar arquivos.** Busca instantânea com Everything no Windows, Spotlight no macOS ou fd no Linux.- **Manter acordado.** Impeça o computador de dormir durante trabalhos longos.-### <img src="https://api.iconify.design/ph:cloud-arrow-down.svg?color=%231E6FE8" width="20" height="20" align="center" alt="Downloads" /> Downloads (2)+### <img src="https://api.iconify.design/ph/cloud-arrow-down.svg?color=%231E6FE8" width="20" height="20" align="center" alt="Downloads" /> Downloads (2)- **Download acelerado.** Arquivos grandes com 16 conexões, retomada e checksum via aria2.- **Manifesto HLS / DASH.** Cole um `.m3u8` ou `.mpd` com Referer e cookie. O FFmpeg salva um MP4.-### <img src="https://api.iconify.design/ph:device-mobile.svg?color=%232AA845" width="20" height="20" align="center" alt="Celular" /> Celular (1)+### <img src="https://api.iconify.design/ph/device-mobile.svg?color=%232AA845" width="20" height="20" align="center" alt="Celular" /> Celular (1)- **Enviar para o celular.** Arquivos, links e texto para um dispositivo KDE Connect pareado.-### <img src="https://api.iconify.design/ph:broom.svg?color=%231A9EB5" width="20" height="20" align="center" alt="Sistema" /> Sistema (9, itens só para Windows marcados)+### <img src="https://api.iconify.design/ph/broom.svg?color=%231A9EB5" width="20" height="20" align="center" alt="Sistema" /> Sistema (9, itens só para Windows marcados)- **Limpar caches.** Temporários, logs e caches de apps com regras por sistema. Você revisa a lista antes de qualquer coisa ser apagada.- **Analisador de disco.** O que ocupa espaço, em treemap e na lista dos maiores arquivos, com botão de mandar para a lixeira.@@ -391,11 +391,11 @@ Funciona sem login para tudo que é público. Cookies só são necessários para- **Limpador de registro.** Entradas órfãs, com backup `.reg` antes de remover. Windows. *beta*- **Atualizador de programas.** Atualize programas em lote via winget, Chocolatey e Scoop. Windows. *beta*-### <img src="https://api.iconify.design/ph:cursor-click.svg?color=%23F28500" width="20" height="20" align="center" alt="Automação" /> Automação (1)+### <img src="https://api.iconify.design/ph/cursor-click.svg?color=%23F28500" width="20" height="20" align="center" alt="Automação" /> Automação (1)- **Auto clicker.** Clique na velocidade exata que você definir, com atalho global, limites e intervalos aleatórios. Windows, macOS e Linux. *beta*-### <img src="https://api.iconify.design/ph:sparkle.svg?color=%233D5BF0" width="20" height="20" align="center" alt="IA" /> IA (6)+### <img src="https://api.iconify.design/ph/sparkle.svg?color=%233D5BF0" width="20" height="20" align="center" alt="IA" /> IA (6)- **Comparar preços.** O custo do mesmo modelo em vários provedores, com preços do LiteLLM e do models.dev.- **Gastos com IA.** Quanto o LibreGet gastou com IA, por dia, modelo e tarefa, a partir de um registro local.@@ -416,7 +416,7 @@ Plugins são bibliotecas Rust separadas, carregadas na inicialização. O LibreG<img src="assets/readme/marketplace.png" alt="Marketplace do LibreGet listando os plugins Courses, Telegram e Convert com versão, autor, permissões e interruptores" width="900" /></p>-### <img src="https://api.iconify.design/ph:graduation-cap.svg?color=%23F28500" width="20" height="20" align="center" alt="Courses" /> Courses+### <img src="https://api.iconify.design/ph/graduation-cap.svg?color=%23F28500" width="20" height="20" align="center" alt="Courses" /> CoursesEntre na **Hotmart**, **Udemy**, **Kiwify**, **Rocketseat** ou **Meta-Analysis Academy** por uma janela de navegador dentro do app, com cookies salvos pela extensão, ou com e-mail e senha onde a plataforma permite. O LibreGet lista suas compras, abre o sumário do curso para você marcar as seções que quer (avisando quantas aulas têm DRM e serão puladas) e baixa todas as aulas e anexos, com numeração contínua se quiser. A Hotmart usa o fluxo de login OIDC atual, então continua funcionando depois da mudança de autenticação de 2026, e cursos gratuitos e cursos entregues fora do Hotmart Club também aparecem na lista.@@ -424,7 +424,7 @@ Entre na **Hotmart**, **Udemy**, **Kiwify**, **Rocketseat** ou **Meta-Analysis AEntre com QR code ou número de telefone. Navegue por todos os canais e grupos em que está, filtre por foto, vídeo, documento ou áudio, busque arquivos e baixe um item ou o chat inteiro com lista de progresso.-### <img src="https://api.iconify.design/ph:arrows-clockwise.svg?color=%232AA845" width="20" height="20" align="center" alt="Convert" /> Convert+### <img src="https://api.iconify.design/ph/arrows-clockwise.svg?color=%232AA845" width="20" height="20" align="center" alt="Convert" /> ConvertConversões com FFmpeg e aceleração por GPU quando a máquina tem: contêiner, codec, resolução, bitrate e compressão de vídeo e áudio, sem internet.diff --git a/README_zh_CN.md b/README_zh_CN.mdindex ce66fc0e..4b388cfc 100644--- a/README_zh_CN.md+++ b/README_zh_CN.md@@ -172,12 +172,12 @@ LibreGet 为最常用的平台写了原生提取器,其余的交给 [yt-dlp](h| 类别 | 网站与格式 ||---|---|-| <img src="https://api.iconify.design/ph:graduation-cap.svg?color=%23F28500" width="18" height="18" align="center" alt="在线课程" /> 在线课程 | 通过 Courses 插件支持 Hotmart、Udemy、Kiwify、Rocketseat 和 Meta-Analysis Academy。全部课时、章节选择、附件、从上次位置继续。 |-| <img src="https://api.iconify.design/ph:film-slate.svg?color=%238E3FD8" width="18" height="18" align="center" alt="视频与音频" /> 视频与音频 | YouTube(视频、播放列表、频道、从头录直播、章节、SponsorBlock)、Instagram、TikTok、X/Twitter、Reddit、Twitch(录像、剪辑、直播)、Vimeo、Bluesky、Threads、Pinterest、抖音 |+| <img src="https://api.iconify.design/ph/graduation-cap.svg?color=%23F28500" width="18" height="18" align="center" alt="在线课程" /> 在线课程 | 通过 Courses 插件支持 Hotmart、Udemy、Kiwify、Rocketseat 和 Meta-Analysis Academy。全部课时、章节选择、附件、从上次位置继续。 |+| <img src="https://api.iconify.design/ph/film-slate.svg?color=%238E3FD8" width="18" height="18" align="center" alt="视频与音频" /> 视频与音频 | YouTube(视频、播放列表、频道、从头录直播、章节、SponsorBlock)、Instagram、TikTok、X/Twitter、Reddit、Twitch(录像、剪辑、直播)、Vimeo、Bluesky、Threads、Pinterest、抖音 || <img src="https://cdn.simpleicons.org/bilibili/00A1D6" width="18" height="18" align="center" alt="哔哩哔哩" /> 哔哩哔哩,登录后 | 按你的会员等级提供 4K、HDR、杜比视界、Hi-Res 无损和杜比全景声。弹幕导出为 XML、ASS 或 JSON,为 Kodi 和 Jellyfin 生成 NFO,自定义命名模板,支持 11 种链接类型,包括番剧、课程、收藏夹、稍后再看和历史记录 |-| <img src="https://api.iconify.design/ph:images.svg?color=%23E0A800" width="18" height="18" align="center" alt="图片画廊" /> 图片画廊 | 通过 gallery-dl 下载 250+ 网站的整个画廊和主页(DeviantArt、Pixiv、ArtStation、Flickr、Tumblr、Imgur、Kemono 等) |-| <img src="https://api.iconify.design/ph:stack.svg?color=%23FFB340" width="18" height="18" align="center" alt="批量" /> 批量 | 粘贴多条链接或载入 `.txt`,下载整个 subreddit、Reddit 和 X 的主页、Instagram 和 Pinterest 的主页 |-| <img src="https://api.iconify.design/ph:folder-simple.svg?color=%23A66A24" width="18" height="18" align="center" alt="文件与传输" /> 文件与传输 | 用内置 BitTorrent 客户端下载 `.torrent` 和磁力链接,HTTP 直链,HLS 和 DASH 清单,以及两台装了 LibreGet 的电脑之间用一串短口令互传文件 |+| <img src="https://api.iconify.design/ph/images.svg?color=%23E0A800" width="18" height="18" align="center" alt="图片画廊" /> 图片画廊 | 通过 gallery-dl 下载 250+ 网站的整个画廊和主页(DeviantArt、Pixiv、ArtStation、Flickr、Tumblr、Imgur、Kemono 等) |+| <img src="https://api.iconify.design/ph/stack.svg?color=%23FFB340" width="18" height="18" align="center" alt="批量" /> 批量 | 粘贴多条链接或载入 `.txt`,下载整个 subreddit、Reddit 和 X 的主页、Instagram 和 Pinterest 的主页 |+| <img src="https://api.iconify.design/ph/folder-simple.svg?color=%23A66A24" width="18" height="18" align="center" alt="文件与传输" /> 文件与传输 | 用内置 BitTorrent 客户端下载 `.torrent` 和磁力链接,HTTP 直链,HLS 和 DASH 清单,以及两台装了 LibreGet 的电脑之间用一串短口令互传文件 || <img src="https://cdn.simpleicons.org/telegram/2CA5E0" width="18" height="18" align="center" alt="Telegram" /> Telegram | 通过 Telegram 插件下载你所在的任何频道或群组里的照片、视频、文件和音频 |设置一次就不用再管的选项:默认清晰度、纯音频格式(MP3、M4A、Opus、FLAC 或 WAV)、字幕语言和格式(SRT、VTT、ASS,内嵌或外挂)、封面和元数据嵌入、文件名模板、按平台分文件夹、跳过已有文件、按章节切分、限速、并发数、代理。规则可以把某个频道或域名固定送到指定文件夹和清晰度,不再每次询问。关注的频道会在后台检查,可以自动下载新视频并在托盘通知。@@ -259,7 +259,7 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工- **真实截图。** CDN 已有的 25%、50%、75% 位置画面帖,而不是标题党封面。- **强制 H.264。** 浏览器扩展里的一个开关,让 YouTube 保持使用 H.264 而不是 VP9 和 AV1,给新编码播放卡顿的机器用。-### <img src="https://api.iconify.design/ph:waveform.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="语音与字幕" /> 语音与字幕(8)+### <img src="https://api.iconify.design/ph/waveform.svg?color=%23FF5E7A" width="20" height="20" align="center" alt="语音与字幕" /> 语音与字幕(8)- **转写。** 用 whisper.cpp 离线把音频或视频转成字幕。模型按需下载,macOS 上用 Metal 加速。- **文字转语音。** 微软 Edge 的自然语音,免费,附带同步字幕文件。@@ -268,7 +268,7 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工- **声音克隆**、**声音设计** 和 **人声分离**,通过本机安装的 VoiceStudio 完成。*beta*- **听写。** 按下全局快捷键说话,whisper 把文字直接输入到光标所在处。*beta*-### <img src="https://api.iconify.design/ph:film-slate.svg?color=%238E3FD8" width="20" height="20" align="center" alt="视频编辑" /> 视频编辑(6)+### <img src="https://api.iconify.design/ph/film-slate.svg?color=%238E3FD8" width="20" height="20" align="center" alt="视频编辑" /> 视频编辑(6)- **剪片段。** 选一个本地视频,剪出一段。结果进入下载队列。- **转换。** 通过 Convert 插件更换容器、编码、分辨率或压缩。@@ -340,7 +340,7 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工- **主题与配色。** 用 Spicetify 主题定制 Spotify 客户端。*beta*- **扩展。** 从 Spicetify Marketplace 安装扩展和自定义应用。*beta*-### <img src="https://api.iconify.design/ph:file-pdf.svg?color=%23E0303A" width="20" height="20" align="center" alt="PDF" /> PDF(6)+### <img src="https://api.iconify.design/ph/file-pdf.svg?color=%23E0303A" width="20" height="20" align="center" alt="PDF" /> PDF(6)- **合并。** 按你选的顺序把多个 PDF 合成一个。- **拆分。** 提取页面,或把 PDF 拆成几份。@@ -349,7 +349,7 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工- **OCR。** 让扫描版 PDF 可以搜索。*beta*- **安全 PDF。** 从像素重建 PDF,去掉脚本和表单。-### <img src="https://api.iconify.design/ph:file-text.svg?color=%231E6FE8" width="20" height="20" align="center" alt="文档" /> 文档(5)+### <img src="https://api.iconify.design/ph/file-text.svg?color=%231E6FE8" width="20" height="20" align="center" alt="文档" /> 文档(5)- **SlideShare 转 PDF。** 每一页以最大尺寸抓取,合成一个 PDF。- **Google 文档导出。** 公开的 Docs、Slides、Sheets 导出为 PDF、DOCX、PPTX 或 XLSX。@@ -357,29 +357,29 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工- **图片画廊。** 通过 gallery-dl 下载 250+ 网站的整个画廊和主页。- **Scribd。** 用你自己的会话把可阅读的书存成 PDF。*计划中*-### <img src="https://api.iconify.design/ph:images.svg?color=%23E0A800" width="20" height="20" align="center" alt="图片" /> 图片(3)+### <img src="https://api.iconify.design/ph/images.svg?color=%23E0A800" width="20" height="20" align="center" alt="图片" /> 图片(3)- **超分放大。** 在任何 Vulkan GPU 上用 Real-ESRGAN 放大 2 倍、3 倍或 4 倍。*beta*- **批量缩放。** 按宽、高、适配或百分比批量缩放,可顺带转换格式。- **OCR。** 从图片和幻灯片里把文字复制出来。*beta*-### <img src="https://api.iconify.design/ph:folder-simple.svg?color=%23A66A24" width="20" height="20" align="center" alt="文件" /> 文件(4)+### <img src="https://api.iconify.design/ph/folder-simple.svg?color=%23A66A24" width="20" height="20" align="center" alt="文件" /> 文件(4)- **重复文件。** 按哈希找出完全相同的文件,安全释放空间。- **批量重命名。** 正则、计数器和大小写转换,应用前有预览。- **查找文件。** 即时搜索:Windows 上用 Everything,macOS 上用 Spotlight,Linux 上用 fd。- **保持唤醒。** 长任务期间阻止电脑休眠。-### <img src="https://api.iconify.design/ph:cloud-arrow-down.svg?color=%231E6FE8" width="20" height="20" align="center" alt="下载" /> 下载(2)+### <img src="https://api.iconify.design/ph/cloud-arrow-down.svg?color=%231E6FE8" width="20" height="20" align="center" alt="下载" /> 下载(2)- **加速下载。** 用 aria2 以 16 个连接下载大文件,支持续传和校验。- **HLS / DASH 清单。** 粘贴 `.m3u8` 或 `.mpd`,附上 Referer 和 Cookie,FFmpeg 保存为 MP4。-### <img src="https://api.iconify.design/ph:device-mobile.svg?color=%232AA845" width="20" height="20" align="center" alt="手机" /> 手机(1)+### <img src="https://api.iconify.design/ph/device-mobile.svg?color=%232AA845" width="20" height="20" align="center" alt="手机" /> 手机(1)- **发送到手机。** 把文件、链接和文字发到已配对的 KDE Connect 设备。-### <img src="https://api.iconify.design/ph:broom.svg?color=%231A9EB5" width="20" height="20" align="center" alt="系统" /> 系统(9,仅 Windows 的项目已标注)+### <img src="https://api.iconify.design/ph/broom.svg?color=%231A9EB5" width="20" height="20" align="center" alt="系统" /> 系统(9,仅 Windows 的项目已标注)- **清理缓存。** 按各系统的规则清理临时文件、日志和应用缓存。删除前先给你看清单。- **磁盘分析。** 用树状图和最大文件列表看清空间去哪了,一键移到废纸篓。@@ -391,11 +391,11 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工- **注册表清理。** 清理孤立项,删除前先备份 `.reg`。Windows。*beta*- **软件更新器。** 通过 winget、Chocolatey 和 Scoop 批量更新程序。Windows。*beta*-### <img src="https://api.iconify.design/ph:cursor-click.svg?color=%23F28500" width="20" height="20" align="center" alt="自动化" /> 自动化(1)+### <img src="https://api.iconify.design/ph/cursor-click.svg?color=%23F28500" width="20" height="20" align="center" alt="自动化" /> 自动化(1)- **自动点击器。** 按你设定的速度点击,支持全局快捷键、次数上限和随机间隔。Windows、macOS 和 Linux。*beta*-### <img src="https://api.iconify.design/ph:sparkle.svg?color=%233D5BF0" width="20" height="20" align="center" alt="AI" /> AI(6)+### <img src="https://api.iconify.design/ph/sparkle.svg?color=%233D5BF0" width="20" height="20" align="center" alt="AI" /> AI(6)- **比较价格。** 同一模型在不同服务商的价格,数据来自 LiteLLM 和 models.dev。- **AI 花费。** LibreGet 在 AI 上花了多少,按天、模型和任务统计,来自本地账本。@@ -416,7 +416,7 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工<img src="assets/readme/marketplace.png" alt="LibreGet 的 Marketplace,列出 Courses、Telegram 和 Convert 插件,显示版本、作者、权限和启用开关" width="900" /></p>-### <img src="https://api.iconify.design/ph:graduation-cap.svg?color=%23F28500" width="20" height="20" align="center" alt="Courses" /> Courses+### <img src="https://api.iconify.design/ph/graduation-cap.svg?color=%23F28500" width="20" height="20" align="center" alt="Courses" /> Courses通过应用内的浏览器窗口登录 **Hotmart**、**Udemy**、**Kiwify**、**Rocketseat** 或 **Meta-Analysis Academy**,也可以使用扩展保存的 Cookie,或在平台允许时直接用邮箱和密码。LibreGet 列出你购买的课程,打开课程大纲让你勾选想要的章节(并告诉你有多少课时受 DRM 保护、会被跳过),然后下载全部课时和附件,需要的话可以连续编号。Hotmart 使用当前的 OIDC 登录流程,所以在 Hotmart 2026 年更换认证方式之后仍然可用,免费课程和在 Hotmart Club 之外交付的课程也会列出来。@@ -424,7 +424,7 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工用二维码或手机号登录。浏览你所在的所有频道和群组,按照片、视频、文档或音频筛选,搜索文件,下载单个条目或整个聊天并显示进度列表。-### <img src="https://api.iconify.design/ph:arrows-clockwise.svg?color=%232AA845" width="20" height="20" align="center" alt="Convert" /> Convert+### <img src="https://api.iconify.design/ph/arrows-clockwise.svg?color=%232AA845" width="20" height="20" align="center" alt="Convert" /> ConvertFFmpeg 转换,机器支持时使用 GPU 加速:视频和音频的容器、编码、分辨率、码率和压缩,无需联网。diff --git a/SECURITY.md b/SECURITY.mdindex 6fca14d1..109ca046 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -6,8 +6,8 @@ Only the latest minor release receives active security updates and patches.| Version | Supported || ------- | --------- |-| 0.16.x | ✅ |-| < 0.16 | ❌ |+| 1.0.x | ✅ |+| < 1.0 | ❌ |## Reporting a Vulnerabilitydiff --git a/browser-extension/chrome/manifest.json b/browser-extension/chrome/manifest.jsonindex d529ff56..570fc505 100644--- a/browser-extension/chrome/manifest.json+++ b/browser-extension/chrome/manifest.json@@ -2,7 +2,7 @@"manifest_version": 3,"name": "LibreGet","description": "Detect supported media pages and send them to LibreGet with one click.",- "version": "0.4.1",+ "version": "0.4.5","default_locale": "en","key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ribk9X5HR4XBloFk2g/V6kjICK8XWYC/QqrGFTOjKkRhRNDJr8Z14JFLggvWBbrj0D/zYdd5CfHJG01bGWMZC0hxRtm71q5Pbu1jtChEfE4QO/xWvM8WfrXH895nJFcUzxi137eoWq+FtSGxqFnSl6IXg5EZdgYH5LN3t6kL0HTwKnJLB3/8d4JD1uF2tQxHzii+MosIozKyDatqtEaBLprY1gfAfCwfY8Iqr9yehFUm7IDH+TGwjE17GJY1ZhfkpNBRmH/h23hwyk6coocSsWpM9GbCFdBX22iUnZjxZqACO1n+8xw2364Lznqtuot4iawznQGF4ALL7CbIvHPOQIDAQAB","permissions": [diff --git a/browser-extension/chrome/pages/error.css b/browser-extension/chrome/pages/error.cssindex 023ddc8b..8dae9a42 100644--- a/browser-extension/chrome/pages/error.css+++ b/browser-extension/chrome/pages/error.css@@ -1,10 +1,24 @@:root {color-scheme: dark;- font-family: "Segoe UI", system-ui, sans-serif;- background:- radial-gradient(circle at top, rgba(255, 125, 56, 0.18), transparent 42%),- #101114;- color: #f5f7fb;+ --bg-page: #121315;+ --bg-card: #1C1C1E;+ --bg-secondary: #232325;+ --bg-tertiary: #2C2C2E;+ --border: rgba(255, 255, 255, 0.08);+ --border-strong: rgba(255, 255, 255, 0.14);+ --text-primary: #F5F5F7;+ --text-secondary: #98989D;+ --text-tertiary: #636366;+ --accent: #FF9F0A;+ --accent-hover: #FFAD2E;+ --on-accent: #1E1200;+ --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, "Segoe UI", sans-serif;+ --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, "Segoe UI", sans-serif;+ --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;++ font-family: var(--font-system);+ background: var(--bg-page);+ color: var(--text-primary);}* {@@ -14,89 +28,140 @@body {margin: 0;min-height: 100vh;+ -webkit-font-smoothing: antialiased;+ -moz-osx-font-smoothing: grayscale;}.shell {min-height: 100vh;- display: grid;- place-items: center;- padding: 24px;+ display: flex;+ align-items: center;+ justify-content: center;+ padding: 40px 16px;}.card {width: min(100%, 720px);- padding: 28px;- border-radius: 20px;- background: rgba(18, 20, 26, 0.92);- border: 1px solid rgba(255, 255, 255, 0.08);- box-shadow: 0 18px 80px rgba(0, 0, 0, 0.4);+ padding: 32px;+ border-radius: 16px;+ background: var(--bg-card);+ border: 1px solid var(--border);+ box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.25);}.eyebrow {- margin: 0 0 10px;- font-size: 12px;- letter-spacing: 0.12em;+ margin: 0 0 8px;+ font-size: 11px;+ letter-spacing: 0.08em;text-transform: uppercase;- color: #ff9a66;+ color: var(--accent);+ font-weight: 600;}h1 {margin: 0 0 12px;- font-size: clamp(28px, 4vw, 40px);- line-height: 1.1;+ font-family: var(--font-display);+ font-size: clamp(24px, 3.5vw, 32px);+ font-weight: 700;+ letter-spacing: -0.015em;+ line-height: 1.2;}.body {margin: 0;- color: #d9deea;- font-size: 16px;- line-height: 1.6;+ color: var(--text-secondary);+ font-size: 14px;+ line-height: 1.55;}-.detail {+.body + .body {+ margin-top: 10px;+}++ol.body {+ padding-left: 20px;+}++li + li {+ margin-top: 6px;+}++.code-wrap {+ position: relative;margin: 16px 0 0;- color: #95a0b7;- font-size: 14px;- line-height: 1.5;}-.url {- margin: 18px 0 0;- padding: 14px 16px;- border-radius: 14px;- background: rgba(255, 255, 255, 0.04);- color: #c9d4ec;+pre {+ margin: 0;+ padding: 12px 14px;+ border-radius: 8px;+ background: var(--bg-tertiary);+ border: 1px solid var(--border);+ font-family: var(--font-mono);+ font-size: 12px;overflow-x: auto;- white-space: pre-wrap;- word-break: break-word;+ color: var(--text-primary);+}++.copy-btn {+ position: absolute;+ top: 8px;+ right: 8px;+ padding: 4px 10px;+ border-radius: 6px;+ border: 1px solid var(--border-strong);+ background: var(--bg-secondary);+ color: var(--text-primary);+ font: inherit;+ font-size: 11px;+ font-weight: 500;+ cursor: pointer;+ transition: all 0.15s ease;+}++.copy-btn:hover {+ background: var(--bg-tertiary);+ border-color: rgba(255, 255, 255, 0.2);}.actions {display: flex;- gap: 12px;+ gap: 10px;flex-wrap: wrap;- margin-top: 22px;+ margin-top: 24px;}.button {display: inline-flex;align-items: center;justify-content: center;- min-height: 42px;+ height: 36px;padding: 0 16px;- border: none;- border-radius: 999px;+ border: 1px solid var(--border-strong);+ border-radius: 8px;appearance: none;- -webkit-appearance: none;cursor: pointer;font: inherit;- color: #f5f7fb;+ font-size: 13px;+ font-weight: 500;text-decoration: none;- background: rgba(255, 255, 255, 0.08);+ color: var(--text-primary);+ background: var(--bg-secondary);+ transition: all 0.15s ease;+}++.button:hover {+ background: var(--bg-tertiary);+ border-color: rgba(255, 255, 255, 0.2);}.button.primary {- background: #ff7d38;- color: #160d06;- font-weight: 700;+ background: var(--accent);+ color: var(--on-accent);+ font-weight: 600;+ border: none;+}++.button.primary:hover {+ background: var(--accent-hover);}diff --git a/browser-extension/chrome/pages/error.js b/browser-extension/chrome/pages/error.jsindex 875dbd59..ea9b7e87 100644--- a/browser-extension/chrome/pages/error.js+++ b/browser-extension/chrome/pages/error.js@@ -30,12 +30,9 @@ installLink.textContent = content.installLabel;openExtensionsBtn.textContent = content.openExtensionsLabel;openExtensionsBtn.addEventListener("click", () => {- // Firefox blocks opening privileged about:addons from extensions, so fall- // back to our own options page there; Chromium can deep-link its manager.- const isFirefox = typeof browser !== "undefined" && !!browser.runtime;- if (isFirefox) {+ if (typeof chrome.runtime.openOptionsPage === "function") {chrome.runtime.openOptionsPage();} else {- chrome.tabs.create({ url: "chrome://extensions" });+ window.location.href = "options.html";}});diff --git a/browser-extension/chrome/pages/options.css b/browser-extension/chrome/pages/options.cssindex e8f41cc9..2832149d 100644--- a/browser-extension/chrome/pages/options.css+++ b/browser-extension/chrome/pages/options.css@@ -1,64 +1,294 @@-:root {+/* ==========================================================================+ LibreGet extension: options and pairing page+ Bitwarden-style layout: 12px control radius, stacked labels,+ full-width primary button, outlined secondary buttons.+ Neutral gray surfaces, one blue accent. Two modes: light and dark.+ No green, no tinted banners, no mono, no glow, no gradients.+ ========================================================================== */++:root,+html[data-theme="dark"] {color-scheme: dark;- font-family: "Segoe UI", system-ui, sans-serif;- background:- radial-gradient(circle at top, rgba(255, 125, 56, 0.18), transparent 42%),- #101114;- color: #f5f7fb;++ --font-sans: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";++ --bg-page: #141415;+ --bg-primary: #1c1c1e;+ --bg-secondary: #242427;+ --bg-quaternary: #323236;+ --bg-hover: rgba(255, 255, 255, 0.06);++ --fg-heading: #f2f2f3;+ --fg-body: #c6c6cc;+ --fg-subtle: #8e8e96;+ --fg-brand: #6baefa;++ --border-light: #2a2a2d;+ --border-base: #3a3a3e;+ --border-strong: #5a5a60;+ --border-brand: #6baefa;++ --btn-bg: #2a70f4;+ --btn-bg-hover: #4182f6;+ --btn-ink: #ffffff;++ --dot-found: #6baefa;+ --danger-fg: #f0827c;+ --danger-bg: #2e1c1c;+ --danger-border: #6b3434;+}++html[data-theme="light"] {+ color-scheme: light;++ --bg-page: #f4f5f7;+ --bg-primary: #ffffff;+ --bg-secondary: #f7f8fa;+ --bg-quaternary: #e8eaee;+ --bg-hover: rgba(0, 0, 0, 0.05);++ --fg-heading: #16181d;+ --fg-body: #4a4f59;+ --fg-subtle: #6b7280;+ --fg-brand: #175ddc;++ --border-light: #e8eaee;+ --border-base: #d6d9df;+ --border-strong: #8b919c;+ --border-brand: #175ddc;++ --btn-bg: #175ddc;+ --btn-bg-hover: #0d43af;+ --btn-ink: #ffffff;++ --dot-found: #175ddc;+ --danger-fg: #b42318;+ --danger-bg: #fdf0ee;+ --danger-border: #f0c4bf;}-* { box-sizing: border-box; }+*,+*::before,+*::after {+ box-sizing: border-box;+}++html {+ background: var(--bg-page);+}-body { margin: 0; min-height: 100vh; }+body {+ margin: 0;+ min-height: 100vh;+ background: var(--bg-page);+ color: var(--fg-body);+ font-family: var(--font-sans);+ font-size: 14px;+ line-height: 20px;+ -webkit-font-smoothing: antialiased;+ -moz-osx-font-smoothing: grayscale;+}.shell {min-height: 100vh;- display: grid;- place-items: center;- padding: 24px;+ display: flex;+ justify-content: center;+ align-items: flex-start;+ padding: 40px 16px 64px;}+/* Main panel */.card {- width: min(100%, 540px);- padding: 28px;- border-radius: 20px;- background: rgba(18, 20, 26, 0.92);- border: 1px solid rgba(255, 255, 255, 0.08);- box-shadow: 0 18px 80px rgba(0, 0, 0, 0.4);+ width: 100%;+ max-width: 480px;+ padding: 24px;+ background: var(--bg-primary);+ border: 1px solid var(--border-base);+ border-radius: 16px;+ transition: max-width 0.2s ease;}-.eyebrow {- margin: 0 0 10px;- font-size: 12px;- letter-spacing: 0.12em;- text-transform: uppercase;- color: #ff9a66;+.card:has(#capture-rules[open]) {+ max-width: 760px;+}++/* Header */+.brand-row {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 12px;+ padding-bottom: 16px;+ margin-bottom: 20px;+ border-bottom: 1px solid var(--border-light);}-h1 {- margin: 0 0 12px;- font-size: clamp(22px, 3vw, 28px);- line-height: 1.2;+.brand-main {+ display: flex;+ align-items: center;+ gap: 10px;+ min-width: 0;+}++.brand-logo {+ width: 32px;+ height: 32px;+ border-radius: 8px;+ flex-shrink: 0;+}++.brand-name {+ font-size: 16px;+ line-height: 24px;+ font-weight: 600;+ color: var(--fg-heading);+}++.theme-toggle {+ width: 36px;+ height: 36px;+ padding: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ border: 0;+ border-radius: 10px;+ background: transparent;+ color: var(--fg-brand);+ cursor: pointer;+ transition: background-color 0.12s ease;+}++.theme-toggle:hover {+ background: var(--bg-hover);+}++html[data-theme="dark"] .icon-moon { display: none; }+html[data-theme="dark"] .icon-sun { display: block; }+html[data-theme="light"] .icon-sun { display: none; }+html[data-theme="light"] .icon-moon { display: block; }++/* Heading and intro */+.card-title {+ margin: 0 0 8px;+ font-size: 20px;+ line-height: 28px;+ font-weight: 600;+ color: var(--fg-heading);}.body {- margin: 0 0 18px;- color: #d9deea;+ margin: 0 0 16px;font-size: 14px;- line-height: 1.55;+ line-height: 20px;+ color: var(--fg-body);+}++.body strong {+ font-weight: 600;+ color: var(--fg-heading);+}++/* Removed from view. Elements stay in the DOM so options.js keeps working. */+.card-title,+.default-desc {+ display: none !important;+}++#endpoint-hint:not(.error) {+ display: none;+}++/* Discovery banner: hidden until connected, then fades out on its own */+.discovery {+ display: none;+ align-items: center;+ gap: 10px;+ overflow: hidden;+ padding: 12px 14px;+ border: 1px solid var(--border-base);+ border-radius: 12px;+ background: var(--bg-secondary);+ font-size: 14px;+ line-height: 20px;+ color: var(--fg-body);+}++.discovery.connected,+.discovery.found {+ display: flex;+ margin-bottom: 20px;+ animation: banner-life 6s ease forwards;+ pointer-events: none;+}++@keyframes banner-life {+ 0% {+ opacity: 0;+ max-height: 0;+ margin-bottom: 0;+ padding-top: 0;+ padding-bottom: 0;+ border-width: 0;+ }+ 5%, 80% {+ opacity: 1;+ max-height: 64px;+ margin-bottom: 20px;+ padding-top: 12px;+ padding-bottom: 12px;+ border-width: 1px;+ }+ 100% {+ opacity: 0;+ max-height: 0;+ margin-bottom: 0;+ padding-top: 0;+ padding-bottom: 0;+ border-width: 0;+ }+}++.spinner {+ width: 16px;+ height: 16px;+ flex-shrink: 0;+ border-radius: 50%;+ border: 2px solid var(--border-base);+ border-top-color: var(--border-brand);+ animation: spin 0.8s linear infinite;+}++.discovery.connected .spinner,+.discovery.found .spinner {+ width: 10px;+ height: 10px;+ margin: 3px;+ border: 0;+ background: var(--dot-found);+ animation: none;}-form { display: grid; gap: 16px; }+@keyframes spin {+ to { transform: rotate(360deg); }+}++/* Form: label above control, 8px gap, 16px between fields */+form {+ display: block;+}.field {display: grid;- gap: 6px;- position: relative;+ gap: 8px;+ margin-bottom: 16px;}.label {- font-size: 13px;- color: #95a0b7;+ font-size: 14px;+ line-height: 20px;+ font-weight: 500;+ color: var(--fg-heading);}input[type="url"],@@ -67,48 +297,100 @@ input[type="password"] {width: 100%;min-height: 40px;padding: 0 12px;- border-radius: 10px;- background: rgba(255, 255, 255, 0.04);- color: #f5f7fb;- border: 1px solid rgba(255, 255, 255, 0.08);+ border-radius: 12px;+ background: var(--bg-primary);+ color: var(--fg-heading);+ border: 1px solid var(--border-strong);font: inherit;+ font-size: 14px;+ outline: none;+ transition: border-color 0.12s ease;+}++input::placeholder {+ color: var(--fg-subtle);+}++input:hover {+ border-color: var(--border-brand);}input:focus {- outline: none;- border-color: rgba(255, 125, 56, 0.55);+ border-color: var(--border-brand);+ outline: 1px solid var(--border-brand);+ outline-offset: 0;}.hint {font-size: 12px;- color: #6b7691;+ line-height: 16px;+ color: var(--fg-subtle);}.hint code {- background: rgba(255, 255, 255, 0.05);- padding: 1px 6px;- border-radius: 4px;+ font-family: inherit;+ font-weight: 600;+ color: var(--fg-body);+}++/* Token field with Show button inside */+.token-wrap {+ position: relative;+ display: flex;+ align-items: center;+}++.token-wrap input {+ padding-right: 64px;}.reveal {position: absolute;right: 6px;- top: 27px;+ top: 50%;+ transform: translateY(-50%);+ padding: 4px 10px;+ border: 0;+ border-radius: 8px;background: transparent;- border: none;- color: #95a0b7;+ color: var(--fg-brand);+ font: inherit;+ font-size: 14px;+ font-weight: 500;cursor: pointer;- padding: 4px 8px;- border-radius: 6px;- font-size: 12px;}-.reveal:hover { background: rgba(255, 255, 255, 0.05); color: #f5f7fb; }+.reveal:hover {+ background: var(--bg-hover);+}-.actions {+/* Checkbox row */+.checkbox-field {display: flex;+}++.checkbox-label {+ display: inline-flex;+ align-items: center;gap: 10px;+ font-weight: 400;+ color: var(--fg-body);+ cursor: pointer;+}++.checkbox-label input[type="checkbox"] {+ width: 16px;+ height: 16px;+ margin: 0;+ accent-color: var(--btn-bg);+ cursor: pointer;+}++/* Buttons: primary full width, secondaries outlined and side by side */+.actions {+ display: flex;flex-wrap: wrap;+ gap: 8px;margin-top: 4px;}@@ -118,230 +400,277 @@ input:focus {justify-content: center;min-height: 40px;padding: 0 16px;- border: none;- border-radius: 999px;+ border: 1px solid var(--border-brand);+ border-radius: 12px;appearance: none;- cursor: pointer;+ background: transparent;+ color: var(--fg-brand);font: inherit;- color: #f5f7fb;- background: rgba(255, 255, 255, 0.08);+ font-size: 14px;+ line-height: 20px;+ font-weight: 600;+ cursor: pointer;+ transition: background-color 0.12s ease, border-color 0.12s ease;}-.button.primary {- background: #ff7d38;- color: #160d06;- font-weight: 700;+.button:hover {+ background: var(--bg-hover);}-.status {- margin: 6px 0 0;- min-height: 18px;- font-size: 13px;- color: #95a0b7;+.actions > .button {+ flex: 1 1 0;}-.status.ok { color: #59d8a0; }-.status.error { color: #ff7d7d; }+.actions > .button.primary {+ flex: 1 1 100%;+}-.discovery {- display: flex;- align-items: center;- gap: 10px;- padding: 10px 12px;- border-radius: 10px;- background: rgba(255, 255, 255, 0.04);- border: 1px solid rgba(255, 255, 255, 0.08);- font-size: 13px;- color: #d9deea;- margin-bottom: 4px;+.button.primary {+ background: var(--btn-bg);+ border-color: var(--btn-bg);+ color: var(--btn-ink);}-.discovery.found {- background: rgba(89, 216, 160, 0.08);- border-color: rgba(89, 216, 160, 0.35);- color: #79e1b3;++.button.primary:hover {+ background: var(--btn-bg-hover);+ border-color: var(--btn-bg-hover);}-.discovery.missing {- background: rgba(255, 125, 125, 0.06);- border-color: rgba(255, 125, 125, 0.3);- color: #ffb1b1;++.button:disabled {+ opacity: 0.5;+ cursor: default;}-.spinner {- width: 14px;- height: 14px;- border-radius: 50%;- border: 2px solid rgba(255, 255, 255, 0.18);- border-top-color: #ff9a66;- animation: spin 0.85s linear infinite;+.button:focus-visible,+.reveal:focus-visible,+.theme-toggle:focus-visible,+.install-help summary:focus-visible {+ outline: 2px solid var(--border-brand);+ outline-offset: 2px;}-.discovery.found .spinner,-.discovery.missing .spinner { display: none; }-@keyframes spin {- to { transform: rotate(360deg); }+.status {+ margin: 12px 0 0;+ min-height: 20px;+ font-size: 14px;+ line-height: 20px;+ color: var(--fg-body);}+.status.ok {+ color: var(--fg-heading);+}++.status.error {+ color: var(--danger-fg);+}++/* Capture rules: a bordered section like Bitwarden's settings groups */.install-help {- margin-top: 8px;- padding: 10px 12px;- border-radius: 10px;- border: 1px solid rgba(255, 255, 255, 0.06);- background: rgba(255, 255, 255, 0.02);- font-size: 13px;- color: #95a0b7;+ margin-top: 20px;+ border: 1px solid var(--border-base);+ border-radius: 12px;+ background: var(--bg-primary);}+.install-help summary {+ display: flex;+ align-items: center;+ gap: 10px;+ padding: 12px 16px;+ list-style: none;cursor: pointer;user-select: none;+ border-radius: 12px;+ font-size: 14px;+ line-height: 20px;+ font-weight: 600;+ color: var(--fg-heading);}-.install-help p {- margin: 8px 0 0;- line-height: 1.55;++.install-help summary:hover {+ background: var(--bg-hover);}-.install-help a {- color: #ff9a66;++.install-help summary::-webkit-details-marker {+ display: none;}-.advanced {- margin-top: 4px;- padding: 10px 12px;- border-radius: 10px;- border: 1px solid rgba(255, 255, 255, 0.06);- background: rgba(255, 255, 255, 0.02);- font-size: 13px;- color: #95a0b7;+.install-help summary::before {+ content: "";+ width: 6px;+ height: 6px;+ border-right: 2px solid var(--fg-brand);+ border-bottom: 2px solid var(--fg-brand);+ transform: rotate(-45deg);+ transition: transform 0.15s ease;}-.advanced summary {- cursor: pointer;- user-select: none;- list-style: none;++.install-help[open] summary::before {+ transform: rotate(45deg);+}++.install-help[open] summary {+ border-bottom: 1px solid var(--border-light);+ border-bottom-left-radius: 0;+ border-bottom-right-radius: 0;}-.advanced summary::-webkit-details-marker { display: none; }-.advanced summary::before {- content: "▸ ";- color: #6b7691;++.install-help > p,+.install-help > .rules-block,+.install-help > .actions,+.install-help > .status {+ margin-left: 16px;+ margin-right: 16px;}-.advanced[open] summary::before { content: "▾ "; }-.advanced .field { margin-top: 10px; }-/* --- Capture rules -------------------------------------------------------- */-/* The three rule tables need more room than the pairing form, so the card- grows only while the section is open. */-.card:has(#capture-rules[open]) {- width: min(100%, 760px);+.install-help > p {+ margin-top: 12px;+ margin-bottom: 0;+ font-size: 14px;+ line-height: 20px;+ color: var(--fg-body);}#capture-rules h2 {margin: 0;- font-size: 13px;- letter-spacing: 0.04em;- text-transform: uppercase;- color: #d9deea;+ font-size: 14px;+ line-height: 20px;+ font-weight: 600;+ color: var(--fg-heading);}.rules-block {- margin-top: 16px;+ margin-top: 20px;}.rules-head {display: flex;align-items: center;justify-content: space-between;- gap: 10px;- margin-bottom: 6px;+ gap: 12px;+ margin-bottom: 8px;}.rules-scroll {overflow-x: auto;+ border: 1px solid var(--border-base);+ border-radius: 12px;}.rules-table {width: 100%;border-collapse: collapse;- font-size: 12px;+ font-size: 14px;}.rules-table th {+ padding: 8px 10px;text-align: left;- font-weight: 500;- color: #6b7691;- padding: 4px 6px;- border-bottom: 1px solid rgba(255, 255, 255, 0.08);+ font-size: 12px;+ line-height: 16px;+ font-weight: 600;+ color: var(--fg-subtle);white-space: nowrap;+ background: var(--bg-secondary);+ border-bottom: 1px solid var(--border-base);}.rules-table td {- padding: 4px 6px;+ padding: 8px 10px;vertical-align: top;- border-bottom: 1px solid rgba(255, 255, 255, 0.04);+ border-bottom: 1px solid var(--border-light);+}++.rules-table tbody tr:last-child td {+ border-bottom: 0;}-.rules-table .col-on { width: 34px; }-.rules-table .col-flags { width: 56px; }-.rules-table .col-action { width: 88px; }-.rules-table .col-ext { width: 72px; }-.rules-table .col-remove { width: 78px; }+.rules-table .col-on { width: 44px; }+.rules-table .col-flags { width: 68px; }+.rules-table .col-action { width: 104px; }+.rules-table .col-ext { width: 88px; }+.rules-table .col-remove { width: 88px; }.rule-stack {display: grid;- gap: 2px;+ gap: 4px;}.rule-stack .hint {- font-size: 11px;- line-height: 1.35;+ font-size: 12px;+ line-height: 16px;}.rules-table input[type="text"],+.rules-table input[type="number"],.rules-table select {width: 100%;- min-height: 28px;+ min-height: 32px;padding: 0 8px;border-radius: 8px;- background: rgba(255, 255, 255, 0.04);- color: #f5f7fb;- border: 1px solid rgba(255, 255, 255, 0.08);+ background: var(--bg-primary);+ color: var(--fg-heading);+ border: 1px solid var(--border-strong);font: inherit;- font-size: 12px;+ font-size: 14px;+ outline: none;+}++.rules-table input:focus,+.rules-table select:focus {+ border-color: var(--border-brand);+ outline: 1px solid var(--border-brand);+ outline-offset: 0;}.rules-table input.invalid {- border-color: rgba(255, 125, 125, 0.55);- background: rgba(255, 125, 125, 0.06);+ border-color: var(--danger-fg);+ background: var(--danger-bg);}.rule-toggle {- margin: 6px 0 0;- accent-color: #ff7d38;+ margin: 8px 0 0;+ accent-color: var(--btn-bg);}-.rules-test {- margin-top: 12px;+.field.rules-test {+ margin: 16px 0 0;}-.hint.error { color: #ff7d7d; }-.hint.ok { color: #59d8a0; }+.hint.error { color: var(--danger-fg); }+.hint.ok { color: var(--fg-body); }.button.small {- min-height: 28px;+ min-height: 32px;padding: 0 12px;font-size: 12px;+ line-height: 16px;+ border-radius: 10px;}.button.ghost {background: transparent;- border: 1px solid rgba(255, 255, 255, 0.1);- color: #95a0b7;+ border-color: transparent;+ color: var(--fg-subtle);}.button.ghost:hover {- color: #f5f7fb;- border-color: rgba(255, 125, 125, 0.4);+ background: var(--danger-bg);+ color: var(--danger-fg);}-.button.danger {- background: rgba(255, 125, 125, 0.16);- color: #ffb1b1;+#capture-rules .actions {+ margin-top: 20px;+}++#capture-rules .actions > .button {+ flex: 0 0 auto;+}++#capture-rules .status {+ margin-top: 8px;+ margin-bottom: 12px;}.sr-only {@@ -355,3 +684,32 @@ input:focus {white-space: nowrap;border: 0;}++@media (max-width: 560px) {+ .shell {+ padding: 0 0 32px;+ }++ .card {+ padding: 16px;+ border-radius: 0;+ border-left: 0;+ border-right: 0;+ }+}++@media (prefers-reduced-motion: reduce) {+ .spinner {+ animation-duration: 2.4s;+ }++ .discovery.connected,+ .discovery.found {+ animation-duration: 4s;+ }++ .card,+ .install-help summary::before {+ transition: none;+ }+}diff --git a/browser-extension/chrome/pages/options.html b/browser-extension/chrome/pages/options.htmlindex b45121b3..f9463236 100644--- a/browser-extension/chrome/pages/options.html+++ b/browser-extension/chrome/pages/options.html@@ -1,79 +1,102 @@<!doctype html>-<html lang="en">+<html lang="en" data-theme="dark"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" />- <title>LibreGet Extension — Pair with desktop app</title>+ <title>LibreGet extension: pair with desktop app</title><link rel="stylesheet" href="options.css" /></head><body><main class="shell"><div class="card" id="card">- <p class="eyebrow">LibreGet Extension</p>+ <!-- Header: logo, name, theme switch -->+ <div class="brand-row">+ <div class="brand-main">+ <img+ src="../icons/active-48.png"+ srcset="../icons/active-128.png 2x"+ alt="LibreGet"+ class="brand-logo"+ width="32"+ height="32"+ />+ <span class="brand-name">LibreGet</span>+ </div>+ <button id="theme-toggle" class="theme-toggle" type="button" title="Toggle color theme" aria-label="Toggle color theme">+ <svg class="icon-sun" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>+ </svg>+ <svg class="icon-moon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>+ </svg>+ </button>+ </div>++ <h1 class="card-title">Pair with the desktop app</h1><header id="welcome-header" hidden>- <h1>Welcome to LibreGet</h1><p class="body">- Let's connect this browser to the desktop app. We're looking for it- now — almost done.+ We are looking for the desktop app now. This page connects as soon as it is found.</p></header><header id="settings-header" hidden>- <h1>Pair this browser</h1><p class="body">- Open LibreGet, go to <strong>Settings → Network → Browser- extension</strong> and click <strong>Pair extension</strong> —- this page picks the token up automatically within a few seconds.- Or copy the <em>token</em> shown there into the field below.+ In LibreGet, open <strong>Settings > Network > Browser extension</strong> and click <strong>Pair extension</strong>. This page picks up the token within a few seconds. You can also copy the token from there into the field below.</p></header>+ <p class="body default-desc">+ Connect this browser to the LibreGet desktop app so it can capture downloads and streams for you.+ </p>++ <!-- Discovery status --><div id="discovery-status" class="discovery" role="status" aria-live="polite"><span class="spinner" aria-hidden="true"></span><span id="discovery-message">Looking for the desktop app on this machine…</span></div><form id="pair-form" novalidate>- <label class="field">- <span class="label">Pairing token</span>+ <!-- Desktop bridge endpoint -->+ <div class="field" id="advanced">+ <span class="label">Desktop endpoint</span><input- id="token"- name="token"- type="password"- placeholder="Paste the token from LibreGet → Settings → Network → Browser extension"+ id="endpoint"+ name="endpoint"+ type="url"+ placeholder="http://127.0.0.1:47720"autocomplete="off"spellcheck="false"- required/>- <button id="reveal" type="button" class="reveal" aria-pressed="false">- Show- </button>- </label>+ <span class="hint" id="endpoint-hint">Default: <code>http://127.0.0.1:47720</code></span>+ </div>- <details id="advanced" class="advanced">- <summary>Advanced: change endpoint URL</summary>- <label class="field">- <span class="label">Endpoint URL</span>+ <!-- Pairing token -->+ <label class="field">+ <span class="label">Pairing token</span>+ <div class="token-wrap"><input- id="endpoint"- name="endpoint"- type="url"- placeholder="http://127.0.0.1:47720"+ id="token"+ name="token"+ type="password"+ placeholder="Paste the token from LibreGet settings"autocomplete="off"spellcheck="false"+ required/>- <span class="hint" id="endpoint-hint">Default: <code>http://127.0.0.1:47720</code></span>- </label>- </details>+ <button id="reveal" type="button" class="reveal" aria-pressed="false">Show</button>+ </div>+ </label>- <label class="field">- <span class="label">+ <!-- Cookie sync -->+ <label class="field checkbox-field">+ <span class="label checkbox-label"><input id="auto-capture-cookies" type="checkbox" checked />- Automatically sync browser cookies to LibreGet+ Sync browser cookies to LibreGet automatically</span></label>+ <!-- Actions --><div class="actions"><button id="pair-now" type="button" class="button primary">Pair now</button><button id="save" type="submit" class="button">Save</button>@@ -83,13 +106,13 @@<p id="status" class="status" role="status" aria-live="polite"></p></form>+ <!-- Capture rules --><details id="capture-rules" class="install-help"><summary>Advanced: capture rules</summary><p>Three tables decide what the sniffer picks up: file extensions,response content types, and regular expressions over the URL.- Changes save on their own a moment after you stop typing, and- empty rows are dropped.+ Changes save on their own a moment after you stop typing.</p><section class="rules-block">@@ -170,27 +193,6 @@</div><p id="rules-status" class="status" role="status" aria-live="polite"></p></details>-- <details id="extension-backup" class="install-help">- <summary>Back up your list of installed extensions</summary>- <p>- Chrome is turning off Manifest V2 extensions. Export what you have- installed — with permissions and store links — on the- <a href="ext-backup.html" target="_blank" rel="noreferrer">extension backup page</a>.- It asks for access to that list only when you click, and nothing- leaves this computer.- </p>- </details>-- <details id="install-help" class="install-help">- <summary>Don't have LibreGet installed yet?</summary>- <p>- Install the desktop app from- <a href="https://github.com/OpenSelena/libreget/releases/latest" target="_blank" rel="noreferrer">- github.com/OpenSelena/libreget- </a>, launch it once, then come back to this page.- </p>- </details></div></main><script type="module" src="options.js"></script>diff --git a/browser-extension/chrome/pages/options.js b/browser-extension/chrome/pages/options.jsindex 4bfa0e5d..215f8402 100644--- a/browser-extension/chrome/pages/options.js+++ b/browser-extension/chrome/pages/options.js@@ -237,6 +237,23 @@ if (typeof document !== "undefined") {const endpointHint = document.getElementById("endpoint-hint");const advancedDetails = document.getElementById("advanced");const autoCaptureCookiesInput = document.getElementById("auto-capture-cookies");+ const themeToggle = document.getElementById("theme-toggle");++ if (themeToggle) {+ try {+ const savedTheme = localStorage.getItem("libreget-extension-theme");+ if (savedTheme) {+ document.documentElement.setAttribute("data-theme", savedTheme);+ }+ themeToggle.addEventListener("click", () => {+ const isDark = document.documentElement.getAttribute("data-theme") === "dark" ||+ (!document.documentElement.getAttribute("data-theme") && window.matchMedia("(prefers-color-scheme: dark)").matches);+ const next = isDark ? "light" : "dark";+ document.documentElement.setAttribute("data-theme", next);+ localStorage.setItem("libreget-extension-theme", next);+ });+ } catch {}+ }const FALLBACK_ENDPOINT = "http://127.0.0.1:47720";@@ -275,8 +292,8 @@ if (typeof document !== "undefined") {stopPairPolling();}- async function tryAutoPair() {- const result = await autoPair().catch(() => ({ ok: false }));+ async function tryAutoPair({ force = false } = {}) {+ const result = await autoPair({ force }).catch(() => ({ ok: false }));if (!result?.ok) return false;if (result.reason === "already-paired") {stopPairPolling();@@ -411,7 +428,7 @@ if (typeof document !== "undefined") {if (pairNowBtn) {pairNowBtn.addEventListener("click", async () => {setStatus("Trying to pair automatically…");- const paired = await tryAutoPair();+ const paired = await tryAutoPair({ force: true });if (paired) return;setStatus("No open pairing window found. In LibreGet, go to Settings → Network → Browser extension and click \"Pair extension\", then try again (or just wait — this page keeps retrying).",@@ -782,7 +799,7 @@ if (typeof document !== "undefined") {// The tables are advanced settings: build them the first time the section is// opened, not on every visit to the pairing page.if (captureDetails) {- captureDetails.addEventListener("toggle", async () => {+ const loadRulesOnce = async () => {if (!captureDetails.open || rulesLoaded) return;rulesLoaded = true;try {@@ -790,6 +807,8 @@ if (typeof document !== "undefined") {} catch {renderRules(defaultCaptureRules());}- });+ };+ captureDetails.addEventListener("toggle", loadRulesOnce);+ if (captureDetails.open) loadRulesOnce();}}diff --git a/browser-extension/chrome/popup/popup.css b/browser-extension/chrome/popup/popup.cssindex 1ea42e7a..4d4d2d68 100644--- a/browser-extension/chrome/popup/popup.css+++ b/browser-extension/chrome/popup/popup.css@@ -1,15 +1,16 @@:root {- --bg-primary: #141414;- --bg-secondary: #1e1e1e;- --bg-tertiary: #282828;- --text-primary: #f0f0f0;- --text-secondary: #999;- --text-tertiary: #666;- --accent: #F04E23;- --accent-hover: #d4421e;- --success: #22c55e;- --error: #ef4444;- --border: #2a2a2a;+ --bg-primary: #1C1C1E;+ --bg-secondary: #232325;+ --bg-tertiary: #2C2C2E;+ --text-primary: #F5F5F7;+ --text-secondary: #98989D;+ --text-tertiary: #636366;+ --accent: #FF9F0A;+ --accent-hover: #FFAD2E;+ --on-accent: #1E1200;+ --success: #30D158;+ --error: #FF453A;+ --border: rgba(255, 255, 255, 0.08);--radius: 8px;}@@ -65,9 +66,9 @@ body {.toggle-slider {position: absolute;inset: 0;- background: #444;- border-radius: 10px;- transition: background 0.25s ease;+ background: rgba(120, 120, 128, 0.32);+ border-radius: 9999px;+ transition: background 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);}.toggle-slider::before {@@ -79,7 +80,8 @@ body {top: 2px;background: #fff;border-radius: 50%;- transition: transform 0.25s ease;+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);+ transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);}.toggle input:checked + .toggle-slider { background: var(--accent); }@@ -97,7 +99,8 @@ body {gap: 12px;padding: 12px 16px;background: var(--accent);- color: white;+ color: var(--on-accent);+ font-weight: 600;border: none;border-radius: var(--radius);font-size: 14px;diff --git a/browser-extension/chrome/popup/popup.js b/browser-extension/chrome/popup/popup.jsindex 7b3b37ed..fa3e2061 100644--- a/browser-extension/chrome/popup/popup.js+++ b/browser-extension/chrome/popup/popup.js@@ -86,8 +86,28 @@ async function init() {render();});- toggle.addEventListener("change", () => {+ toggle.addEventListener("change", async () => {const requested = toggle.checked;+ if (requested && chrome.permissions?.request) {+ try {+ const granted = await chrome.permissions.request({ origins: ["*://*/*"] });+ if (!granted) {+ toggle.checked = false;+ if (currentData) {+ currentData.snifferEnabled = false;+ render();+ }+ return;+ }+ } catch {+ toggle.checked = false;+ if (currentData) {+ currentData.snifferEnabled = false;+ render();+ }+ return;+ }+ }chrome.runtime.sendMessage({ type: "toggleSniffer", enabled: requested }, (response) => {const effective = response?.enabled ?? requested;if (toggle.checked !== effective) toggle.checked = effective;@@ -511,6 +531,9 @@ async function sendBatch(groups) {}msg.openApp = isOpenAppEnabled();+ const headers = extractSendableHeaders(group.master.requestHeaders);+ if (headers) msg.headers = headers;+try {await new Promise((resolve) => {chrome.runtime.sendMessage(msg, (response) => {@@ -575,6 +598,11 @@ function pickBestMedia(media) {return videoItems.reduce((best, m) => m.contentLength > best.contentLength ? m : best, videoItems[0]);}+ const audioItems = media.filter(m => m.mediaType === "audio" && isListableMedia(m));+ if (audioItems.length > 0) {+ return audioItems.reduce((best, m) => (m.contentLength > best.contentLength ? m : best), audioItems[0]);+ }+// A DASH manifest carries no useful size, so it can only be picked by recency// — and without this a page whose only media is an mpd renders as "listening"// while the item sits in the list underneath.diff --git a/browser-extension/chrome/src/background.js b/browser-extension/chrome/src/background.jsindex 92bea9a9..ea08ab25 100644--- a/browser-extension/chrome/src/background.js+++ b/browser-extension/chrome/src/background.js@@ -13,6 +13,7 @@ import {} from "./deep-search-toggle.js";import { loadH264State, isH264Enabled, isBlock60, setH264 } from "./h264-toggle.js";import { registerContextMenu, getContextMenuId } from "./context-menu.js";+import { loadOpenAppState, isOpenAppEnabled } from "./open-app-toggle.js";import { openLibregetScheme } from "./send-via-scheme.js";import { isSyntheticManifestUrl } from "./synthetic-manifest.js";import {@@ -182,6 +183,7 @@ if (menusApi?.onClicked) {url,platform: "generic",referer: tab?.url || "",+ openApp: isOpenAppEnabled(),});if (result.ok) {@@ -192,6 +194,7 @@ if (menusApi?.onClicked) {chrome.runtime.onStartup.addListener(() => {registerContextMenu();+ loadOpenAppState().catch(() => {});refreshActiveTab().catch(() => {});void runAutoPairTick();void ensureAutoPairAlarm();@@ -210,6 +213,7 @@ if (chrome.commands && chrome.commands.onCommand) {url: tab.url,platform: detected.platform,referer: tab.url,+ openApp: isOpenAppEnabled(),});if (result?.ok && tab.id !== undefined) {actionFeedback.showSuccessBadge(tab.id);@@ -382,7 +386,7 @@ function updateBadge(tabId) {}).catch(() => {});chrome.action.setBadgeBackgroundColor({tabId,- color: "#F04E23",+ color: "#FF9F0A",}).catch(() => {});}diff --git a/browser-extension/chrome/src/bridge-client.js b/browser-extension/chrome/src/bridge-client.jsindex 79ecb0ec..1122ca96 100644--- a/browser-extension/chrome/src/bridge-client.js+++ b/browser-extension/chrome/src/bridge-client.js@@ -198,10 +198,11 @@ export async function autoPair({fetchImpl = typeof fetch !== "undefined" ? fetch : null,storage = globalThis.chrome?.storage?.local,timeoutMs = HEALTH_TIMEOUT_MS,+ force = false,} = {}) {if (!fetchImpl) return { ok: false, reason: "no-fetch" };const current = await loadBridgeConfig({ storage });- if (current.token) return { ok: true, reason: "already-paired" };+ if (!force && current.token) return { ok: true, reason: "already-paired" };let endpoint = current.endpoint;const discovered = await discoverBridgeEndpoint({ fetchImpl, timeoutMs });diff --git a/browser-extension/chrome/src/capture-rules.js b/browser-extension/chrome/src/capture-rules.jsindex 57adee62..ee6674ea 100644--- a/browser-extension/chrome/src/capture-rules.js+++ b/browser-extension/chrome/src/capture-rules.js@@ -415,7 +415,7 @@ export const DEFAULT_REGEX_RULES = Object.freeze([enabled: true,}),Object.freeze({- pattern: ".*\\.bilivideo\\.(com|cn).*\\/live-bvc\\/.*m4s",+ pattern: "^https?://[^/]*\\.bilivideo\\.(com|cn)/.*live-bvc/.*m4s",flags: "ig",action: "block",ext: "",diff --git a/browser-extension/chrome/src/detect.js b/browser-extension/chrome/src/detect.jsindex 4e4c854e..9060c863 100644--- a/browser-extension/chrome/src/detect.js+++ b/browser-extension/chrome/src/detect.js@@ -57,6 +57,7 @@ function detectPlatform(url) {if (matchesHost(host, "vimeo.com")) return "vimeo";if (matchesHost(host, "udemy.com")) return "udemy";if (matchesHost(host, "bilibili.com") || host === "b23.tv") return "bilibili";+ if (host === "docs.google.com") return "gdocs";return null;}@@ -90,6 +91,8 @@ function detectContentType(platform, url) {return parseUdemy(segments);case "bilibili":return parseBilibili(segments);+ case "gdocs":+ return parseGdocs(segments);default:return "unknown";}@@ -265,6 +268,20 @@ function parseBilibili(segments) {return segments[0] === "video" && segments[1] ? "video" : "unknown";}+function parseGdocs(segments) {+ if (+ (segments[0] === "presentation" || segments[0] === "document" || segments[0] === "spreadsheets") &&+ segments[1] === "d" &&+ segments[2]+ ) {+ if (segments[2] === "e") {+ return segments[3] ? "post" : "unknown";+ }+ return "post";+ }+ return "unknown";+}+function matchesHost(host, domain) {return host === domain || host.endsWith(`.${domain}`);}diff --git a/browser-extension/chrome/src/media-sniffer.js b/browser-extension/chrome/src/media-sniffer.jsindex 00a868ad..64a7710d 100644--- a/browser-extension/chrome/src/media-sniffer.js+++ b/browser-extension/chrome/src/media-sniffer.js@@ -179,12 +179,15 @@ function isHlsSegment(url, contentType) {function isPlatformCdnFragment(url, contentType, contentLength) {try {- const host = new URL(url).hostname;+ const u = new URL(url);+ const host = u.hostname;const isPlatformCdn = PLATFORM_CDN_HOSTS.some(cdn => host.includes(cdn));if (!isPlatformCdn) return false;- if (contentLength > 0 && contentLength < 5 * 1024 * 1024) return true;+ if (u.searchParams.has("bytestart") || u.searchParams.has("byterange")) return true;const ct = contentType.toLowerCase();if (ct.includes("octet-stream")) return true;+ const isMetaCdn = host.includes("fbcdn.net") || host.includes("cdninstagram.com");+ if (isMetaCdn && contentLength > 0 && contentLength < 5 * 1024 * 1024) return true;return false;} catch { return false; }}diff --git a/browser-extension/chrome/src/send-via-scheme.js b/browser-extension/chrome/src/send-via-scheme.jsindex 890c0143..02e3720b 100644--- a/browser-extension/chrome/src/send-via-scheme.js+++ b/browser-extension/chrome/src/send-via-scheme.js@@ -15,7 +15,10 @@ export function buildLibregetSchemeUrl(url) {if (trimmed.startsWith("magnet:") || trimmed.startsWith("p2p:")) {return `libreget:${trimmed}`;}- const withoutProtocol = trimmed.replace(/^https?:\/\//i, "");+ if (trimmed.startsWith("http://")) {+ return `${LIBREGET_SCHEME}http://${trimmed.slice(7)}`;+ }+ const withoutProtocol = trimmed.replace(/^https:\/\//i, "");if (!withoutProtocol) {return null;}diff --git a/browser-extension/chrome/tests/detect.test.mjs b/browser-extension/chrome/tests/detect.test.mjsindex d0986639..73595361 100644--- a/browser-extension/chrome/tests/detect.test.mjs+++ b/browser-extension/chrome/tests/detect.test.mjs@@ -341,3 +341,15 @@ test("Bilibili: b23.tv short link", () => {test("Bilibili: homepage is unknown", () => {assertUnsupported("https://www.bilibili.com/", "bilibili", "unknown");});++// ── Google Docs / Slides / Sheets ────────────────────────────────────────++test("Google Slides: standard presentation and pubembed", () => {+ assertSupported("https://docs.google.com/presentation/d/1AbC_d-e/edit#slide=1", "gdocs", "post");+ assertSupported(+ "https://docs.google.com/presentation/d/e/2PACX-1vMockDummyId1234567890abcdefghijklmnopqrstuvwxyz/pubembed?start=false",+ "gdocs",+ "post"+ );+ assertUnsupported("https://docs.google.com/presentation/u/0/", "gdocs", "unknown");+});diff --git a/browser-extension/chrome/tests/send-via-scheme.test.mjs b/browser-extension/chrome/tests/send-via-scheme.test.mjsindex d92e5f07..96e91ddd 100644--- a/browser-extension/chrome/tests/send-via-scheme.test.mjs+++ b/browser-extension/chrome/tests/send-via-scheme.test.mjs@@ -3,14 +3,14 @@ import assert from "node:assert/strict";import { buildLibregetSchemeUrl, openLibregetScheme } from "../src/send-via-scheme.js";-test("buildLibregetSchemeUrl strips http(s) prefix and prepends libreget://", () => {+test("buildLibregetSchemeUrl strips https prefix and preserves http protocol in libreget://", () => {assert.equal(buildLibregetSchemeUrl("https://www.youtube.com/watch?v=abc"),"libreget://www.youtube.com/watch?v=abc");assert.equal(buildLibregetSchemeUrl("http://example.com/v"),- "libreget://example.com/v"+ "libreget://http://example.com/v");});diff --git a/browser-extension/firefox/icons/active-128.png b/browser-extension/firefox/icons/active-128.pngindex 452bf90f..271e772a 100644Binary files a/browser-extension/firefox/icons/active-128.png and b/browser-extension/firefox/icons/active-128.png differdiff --git a/browser-extension/firefox/icons/active-16.png b/browser-extension/firefox/icons/active-16.pngindex 13de7f9c..ce8ab16d 100644Binary files a/browser-extension/firefox/icons/active-16.png and b/browser-extension/firefox/icons/active-16.png differdiff --git a/browser-extension/firefox/icons/active-24.png b/browser-extension/firefox/icons/active-24.pngindex 9cb6b584..509414fe 100644Binary files a/browser-extension/firefox/icons/active-24.png and b/browser-extension/firefox/icons/active-24.png differdiff --git a/browser-extension/firefox/icons/active-32.png b/browser-extension/firefox/icons/active-32.pngindex ad4a05df..8a4b0dd0 100644Binary files a/browser-extension/firefox/icons/active-32.png and b/browser-extension/firefox/icons/active-32.png differdiff --git a/browser-extension/firefox/icons/active-48.png b/browser-extension/firefox/icons/active-48.pngindex c6d096f9..0e017b08 100644Binary files a/browser-extension/firefox/icons/active-48.png and b/browser-extension/firefox/icons/active-48.png differdiff --git a/browser-extension/firefox/icons/inactive-128.png b/browser-extension/firefox/icons/inactive-128.pngindex 734bd6f3..ecbaa110 100644Binary files a/browser-extension/firefox/icons/inactive-128.png and b/browser-extension/firefox/icons/inactive-128.png differdiff --git a/browser-extension/firefox/icons/inactive-16.png b/browser-extension/firefox/icons/inactive-16.pngindex 75dd4d37..4b4b47aa 100644Binary files a/browser-extension/firefox/icons/inactive-16.png and b/browser-extension/firefox/icons/inactive-16.png differdiff --git a/browser-extension/firefox/icons/inactive-24.png b/browser-extension/firefox/icons/inactive-24.pngindex 187a866e..10b1c074 100644Binary files a/browser-extension/firefox/icons/inactive-24.png and b/browser-extension/firefox/icons/inactive-24.png differdiff --git a/browser-extension/firefox/icons/inactive-32.png b/browser-extension/firefox/icons/inactive-32.pngindex fe34446a..1a458e53 100644Binary files a/browser-extension/firefox/icons/inactive-32.png and b/browser-extension/firefox/icons/inactive-32.png differdiff --git a/browser-extension/firefox/icons/inactive-48.png b/browser-extension/firefox/icons/inactive-48.pngindex a8f13fbe..675196e0 100644Binary files a/browser-extension/firefox/icons/inactive-48.png and b/browser-extension/firefox/icons/inactive-48.png differdiff --git a/browser-extension/firefox/manifest.json b/browser-extension/firefox/manifest.jsonindex 1d53c47c..881060bc 100644--- a/browser-extension/firefox/manifest.json+++ b/browser-extension/firefox/manifest.json@@ -2,7 +2,7 @@"manifest_version": 3,"name": "LibreGet","description": "Detect supported media pages and send them to LibreGet with one click.",- "version": "0.4.1",+ "version": "0.4.5","default_locale": "en","browser_specific_settings": {"gecko": {diff --git a/browser-extension/firefox/pages/error.css b/browser-extension/firefox/pages/error.cssindex 023ddc8b..8dae9a42 100644--- a/browser-extension/firefox/pages/error.css+++ b/browser-extension/firefox/pages/error.css@@ -1,10 +1,24 @@:root {color-scheme: dark;- font-family: "Segoe UI", system-ui, sans-serif;- background:- radial-gradient(circle at top, rgba(255, 125, 56, 0.18), transparent 42%),- #101114;- color: #f5f7fb;+ --bg-page: #121315;+ --bg-card: #1C1C1E;+ --bg-secondary: #232325;+ --bg-tertiary: #2C2C2E;+ --border: rgba(255, 255, 255, 0.08);+ --border-strong: rgba(255, 255, 255, 0.14);+ --text-primary: #F5F5F7;+ --text-secondary: #98989D;+ --text-tertiary: #636366;+ --accent: #FF9F0A;+ --accent-hover: #FFAD2E;+ --on-accent: #1E1200;+ --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, "Segoe UI", sans-serif;+ --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, "Segoe UI", sans-serif;+ --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;++ font-family: var(--font-system);+ background: var(--bg-page);+ color: var(--text-primary);}* {@@ -14,89 +28,140 @@body {margin: 0;min-height: 100vh;+ -webkit-font-smoothing: antialiased;+ -moz-osx-font-smoothing: grayscale;}.shell {min-height: 100vh;- display: grid;- place-items: center;- padding: 24px;+ display: flex;+ align-items: center;+ justify-content: center;+ padding: 40px 16px;}.card {width: min(100%, 720px);- padding: 28px;- border-radius: 20px;- background: rgba(18, 20, 26, 0.92);- border: 1px solid rgba(255, 255, 255, 0.08);- box-shadow: 0 18px 80px rgba(0, 0, 0, 0.4);+ padding: 32px;+ border-radius: 16px;+ background: var(--bg-card);+ border: 1px solid var(--border);+ box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.25);}.eyebrow {- margin: 0 0 10px;- font-size: 12px;- letter-spacing: 0.12em;+ margin: 0 0 8px;+ font-size: 11px;+ letter-spacing: 0.08em;text-transform: uppercase;- color: #ff9a66;+ color: var(--accent);+ font-weight: 600;}h1 {margin: 0 0 12px;- font-size: clamp(28px, 4vw, 40px);- line-height: 1.1;+ font-family: var(--font-display);+ font-size: clamp(24px, 3.5vw, 32px);+ font-weight: 700;+ letter-spacing: -0.015em;+ line-height: 1.2;}.body {margin: 0;- color: #d9deea;- font-size: 16px;- line-height: 1.6;+ color: var(--text-secondary);+ font-size: 14px;+ line-height: 1.55;}-.detail {+.body + .body {+ margin-top: 10px;+}++ol.body {+ padding-left: 20px;+}++li + li {+ margin-top: 6px;+}++.code-wrap {+ position: relative;margin: 16px 0 0;- color: #95a0b7;- font-size: 14px;- line-height: 1.5;}-.url {- margin: 18px 0 0;- padding: 14px 16px;- border-radius: 14px;- background: rgba(255, 255, 255, 0.04);- color: #c9d4ec;+pre {+ margin: 0;+ padding: 12px 14px;+ border-radius: 8px;+ background: var(--bg-tertiary);+ border: 1px solid var(--border);+ font-family: var(--font-mono);+ font-size: 12px;overflow-x: auto;- white-space: pre-wrap;- word-break: break-word;+ color: var(--text-primary);+}++.copy-btn {+ position: absolute;+ top: 8px;+ right: 8px;+ padding: 4px 10px;+ border-radius: 6px;+ border: 1px solid var(--border-strong);+ background: var(--bg-secondary);+ color: var(--text-primary);+ font: inherit;+ font-size: 11px;+ font-weight: 500;+ cursor: pointer;+ transition: all 0.15s ease;+}++.copy-btn:hover {+ background: var(--bg-tertiary);+ border-color: rgba(255, 255, 255, 0.2);}.actions {display: flex;- gap: 12px;+ gap: 10px;flex-wrap: wrap;- margin-top: 22px;+ margin-top: 24px;}.button {display: inline-flex;align-items: center;justify-content: center;- min-height: 42px;+ height: 36px;padding: 0 16px;- border: none;- border-radius: 999px;+ border: 1px solid var(--border-strong);+ border-radius: 8px;appearance: none;- -webkit-appearance: none;cursor: pointer;font: inherit;- color: #f5f7fb;+ font-size: 13px;+ font-weight: 500;text-decoration: none;- background: rgba(255, 255, 255, 0.08);+ color: var(--text-primary);+ background: var(--bg-secondary);+ transition: all 0.15s ease;+}++.button:hover {+ background: var(--bg-tertiary);+ border-color: rgba(255, 255, 255, 0.2);}.button.primary {- background: #ff7d38;- color: #160d06;- font-weight: 700;+ background: var(--accent);+ color: var(--on-accent);+ font-weight: 600;+ border: none;+}++.button.primary:hover {+ background: var(--accent-hover);}diff --git a/browser-extension/firefox/pages/error.js b/browser-extension/firefox/pages/error.jsindex 875dbd59..ea9b7e87 100644--- a/browser-extension/firefox/pages/error.js+++ b/browser-extension/firefox/pages/error.js@@ -30,12 +30,9 @@ installLink.textContent = content.installLabel;openExtensionsBtn.textContent = content.openExtensionsLabel;openExtensionsBtn.addEventListener("click", () => {- // Firefox blocks opening privileged about:addons from extensions, so fall- // back to our own options page there; Chromium can deep-link its manager.- const isFirefox = typeof browser !== "undefined" && !!browser.runtime;- if (isFirefox) {+ if (typeof chrome.runtime.openOptionsPage === "function") {chrome.runtime.openOptionsPage();} else {- chrome.tabs.create({ url: "chrome://extensions" });+ window.location.href = "options.html";}});diff --git a/browser-extension/firefox/pages/options.css b/browser-extension/firefox/pages/options.cssindex e8f41cc9..2832149d 100644--- a/browser-extension/firefox/pages/options.css+++ b/browser-extension/firefox/pages/options.css@@ -1,64 +1,294 @@-:root {+/* ==========================================================================+ LibreGet extension: options and pairing page+ Bitwarden-style layout: 12px control radius, stacked labels,+ full-width primary button, outlined secondary buttons.+ Neutral gray surfaces, one blue accent. Two modes: light and dark.+ No green, no tinted banners, no mono, no glow, no gradients.+ ========================================================================== */++:root,+html[data-theme="dark"] {color-scheme: dark;- font-family: "Segoe UI", system-ui, sans-serif;- background:- radial-gradient(circle at top, rgba(255, 125, 56, 0.18), transparent 42%),- #101114;- color: #f5f7fb;++ --font-sans: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";++ --bg-page: #141415;+ --bg-primary: #1c1c1e;+ --bg-secondary: #242427;+ --bg-quaternary: #323236;+ --bg-hover: rgba(255, 255, 255, 0.06);++ --fg-heading: #f2f2f3;+ --fg-body: #c6c6cc;+ --fg-subtle: #8e8e96;+ --fg-brand: #6baefa;++ --border-light: #2a2a2d;+ --border-base: #3a3a3e;+ --border-strong: #5a5a60;+ --border-brand: #6baefa;++ --btn-bg: #2a70f4;+ --btn-bg-hover: #4182f6;+ --btn-ink: #ffffff;++ --dot-found: #6baefa;+ --danger-fg: #f0827c;+ --danger-bg: #2e1c1c;+ --danger-border: #6b3434;+}++html[data-theme="light"] {+ color-scheme: light;++ --bg-page: #f4f5f7;+ --bg-primary: #ffffff;+ --bg-secondary: #f7f8fa;+ --bg-quaternary: #e8eaee;+ --bg-hover: rgba(0, 0, 0, 0.05);++ --fg-heading: #16181d;+ --fg-body: #4a4f59;+ --fg-subtle: #6b7280;+ --fg-brand: #175ddc;++ --border-light: #e8eaee;+ --border-base: #d6d9df;+ --border-strong: #8b919c;+ --border-brand: #175ddc;++ --btn-bg: #175ddc;+ --btn-bg-hover: #0d43af;+ --btn-ink: #ffffff;++ --dot-found: #175ddc;+ --danger-fg: #b42318;+ --danger-bg: #fdf0ee;+ --danger-border: #f0c4bf;}-* { box-sizing: border-box; }+*,+*::before,+*::after {+ box-sizing: border-box;+}++html {+ background: var(--bg-page);+}-body { margin: 0; min-height: 100vh; }+body {+ margin: 0;+ min-height: 100vh;+ background: var(--bg-page);+ color: var(--fg-body);+ font-family: var(--font-sans);+ font-size: 14px;+ line-height: 20px;+ -webkit-font-smoothing: antialiased;+ -moz-osx-font-smoothing: grayscale;+}.shell {min-height: 100vh;- display: grid;- place-items: center;- padding: 24px;+ display: flex;+ justify-content: center;+ align-items: flex-start;+ padding: 40px 16px 64px;}+/* Main panel */.card {- width: min(100%, 540px);- padding: 28px;- border-radius: 20px;- background: rgba(18, 20, 26, 0.92);- border: 1px solid rgba(255, 255, 255, 0.08);- box-shadow: 0 18px 80px rgba(0, 0, 0, 0.4);+ width: 100%;+ max-width: 480px;+ padding: 24px;+ background: var(--bg-primary);+ border: 1px solid var(--border-base);+ border-radius: 16px;+ transition: max-width 0.2s ease;}-.eyebrow {- margin: 0 0 10px;- font-size: 12px;- letter-spacing: 0.12em;- text-transform: uppercase;- color: #ff9a66;+.card:has(#capture-rules[open]) {+ max-width: 760px;+}++/* Header */+.brand-row {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 12px;+ padding-bottom: 16px;+ margin-bottom: 20px;+ border-bottom: 1px solid var(--border-light);}-h1 {- margin: 0 0 12px;- font-size: clamp(22px, 3vw, 28px);- line-height: 1.2;+.brand-main {+ display: flex;+ align-items: center;+ gap: 10px;+ min-width: 0;+}++.brand-logo {+ width: 32px;+ height: 32px;+ border-radius: 8px;+ flex-shrink: 0;+}++.brand-name {+ font-size: 16px;+ line-height: 24px;+ font-weight: 600;+ color: var(--fg-heading);+}++.theme-toggle {+ width: 36px;+ height: 36px;+ padding: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ border: 0;+ border-radius: 10px;+ background: transparent;+ color: var(--fg-brand);+ cursor: pointer;+ transition: background-color 0.12s ease;+}++.theme-toggle:hover {+ background: var(--bg-hover);+}++html[data-theme="dark"] .icon-moon { display: none; }+html[data-theme="dark"] .icon-sun { display: block; }+html[data-theme="light"] .icon-sun { display: none; }+html[data-theme="light"] .icon-moon { display: block; }++/* Heading and intro */+.card-title {+ margin: 0 0 8px;+ font-size: 20px;+ line-height: 28px;+ font-weight: 600;+ color: var(--fg-heading);}.body {- margin: 0 0 18px;- color: #d9deea;+ margin: 0 0 16px;font-size: 14px;- line-height: 1.55;+ line-height: 20px;+ color: var(--fg-body);+}++.body strong {+ font-weight: 600;+ color: var(--fg-heading);+}++/* Removed from view. Elements stay in the DOM so options.js keeps working. */+.card-title,+.default-desc {+ display: none !important;+}++#endpoint-hint:not(.error) {+ display: none;+}++/* Discovery banner: hidden until connected, then fades out on its own */+.discovery {+ display: none;+ align-items: center;+ gap: 10px;+ overflow: hidden;+ padding: 12px 14px;+ border: 1px solid var(--border-base);+ border-radius: 12px;+ background: var(--bg-secondary);+ font-size: 14px;+ line-height: 20px;+ color: var(--fg-body);+}++.discovery.connected,+.discovery.found {+ display: flex;+ margin-bottom: 20px;+ animation: banner-life 6s ease forwards;+ pointer-events: none;+}++@keyframes banner-life {+ 0% {+ opacity: 0;+ max-height: 0;+ margin-bottom: 0;+ padding-top: 0;+ padding-bottom: 0;+ border-width: 0;+ }+ 5%, 80% {+ opacity: 1;+ max-height: 64px;+ margin-bottom: 20px;+ padding-top: 12px;+ padding-bottom: 12px;+ border-width: 1px;+ }+ 100% {+ opacity: 0;+ max-height: 0;+ margin-bottom: 0;+ padding-top: 0;+ padding-bottom: 0;+ border-width: 0;+ }+}++.spinner {+ width: 16px;+ height: 16px;+ flex-shrink: 0;+ border-radius: 50%;+ border: 2px solid var(--border-base);+ border-top-color: var(--border-brand);+ animation: spin 0.8s linear infinite;+}++.discovery.connected .spinner,+.discovery.found .spinner {+ width: 10px;+ height: 10px;+ margin: 3px;+ border: 0;+ background: var(--dot-found);+ animation: none;}-form { display: grid; gap: 16px; }+@keyframes spin {+ to { transform: rotate(360deg); }+}++/* Form: label above control, 8px gap, 16px between fields */+form {+ display: block;+}.field {display: grid;- gap: 6px;- position: relative;+ gap: 8px;+ margin-bottom: 16px;}.label {- font-size: 13px;- color: #95a0b7;+ font-size: 14px;+ line-height: 20px;+ font-weight: 500;+ color: var(--fg-heading);}input[type="url"],@@ -67,48 +297,100 @@ input[type="password"] {width: 100%;min-height: 40px;padding: 0 12px;- border-radius: 10px;- background: rgba(255, 255, 255, 0.04);- color: #f5f7fb;- border: 1px solid rgba(255, 255, 255, 0.08);+ border-radius: 12px;+ background: var(--bg-primary);+ color: var(--fg-heading);+ border: 1px solid var(--border-strong);font: inherit;+ font-size: 14px;+ outline: none;+ transition: border-color 0.12s ease;+}++input::placeholder {+ color: var(--fg-subtle);+}++input:hover {+ border-color: var(--border-brand);}input:focus {- outline: none;- border-color: rgba(255, 125, 56, 0.55);+ border-color: var(--border-brand);+ outline: 1px solid var(--border-brand);+ outline-offset: 0;}.hint {font-size: 12px;- color: #6b7691;+ line-height: 16px;+ color: var(--fg-subtle);}.hint code {- background: rgba(255, 255, 255, 0.05);- padding: 1px 6px;- border-radius: 4px;+ font-family: inherit;+ font-weight: 600;+ color: var(--fg-body);+}++/* Token field with Show button inside */+.token-wrap {+ position: relative;+ display: flex;+ align-items: center;+}++.token-wrap input {+ padding-right: 64px;}.reveal {position: absolute;right: 6px;- top: 27px;+ top: 50%;+ transform: translateY(-50%);+ padding: 4px 10px;+ border: 0;+ border-radius: 8px;background: transparent;- border: none;- color: #95a0b7;+ color: var(--fg-brand);+ font: inherit;+ font-size: 14px;+ font-weight: 500;cursor: pointer;- padding: 4px 8px;- border-radius: 6px;- font-size: 12px;}-.reveal:hover { background: rgba(255, 255, 255, 0.05); color: #f5f7fb; }+.reveal:hover {+ background: var(--bg-hover);+}-.actions {+/* Checkbox row */+.checkbox-field {display: flex;+}++.checkbox-label {+ display: inline-flex;+ align-items: center;gap: 10px;+ font-weight: 400;+ color: var(--fg-body);+ cursor: pointer;+}++.checkbox-label input[type="checkbox"] {+ width: 16px;+ height: 16px;+ margin: 0;+ accent-color: var(--btn-bg);+ cursor: pointer;+}++/* Buttons: primary full width, secondaries outlined and side by side */+.actions {+ display: flex;flex-wrap: wrap;+ gap: 8px;margin-top: 4px;}@@ -118,230 +400,277 @@ input:focus {justify-content: center;min-height: 40px;padding: 0 16px;- border: none;- border-radius: 999px;+ border: 1px solid var(--border-brand);+ border-radius: 12px;appearance: none;- cursor: pointer;+ background: transparent;+ color: var(--fg-brand);font: inherit;- color: #f5f7fb;- background: rgba(255, 255, 255, 0.08);+ font-size: 14px;+ line-height: 20px;+ font-weight: 600;+ cursor: pointer;+ transition: background-color 0.12s ease, border-color 0.12s ease;}-.button.primary {- background: #ff7d38;- color: #160d06;- font-weight: 700;+.button:hover {+ background: var(--bg-hover);}-.status {- margin: 6px 0 0;- min-height: 18px;- font-size: 13px;- color: #95a0b7;+.actions > .button {+ flex: 1 1 0;}-.status.ok { color: #59d8a0; }-.status.error { color: #ff7d7d; }+.actions > .button.primary {+ flex: 1 1 100%;+}-.discovery {- display: flex;- align-items: center;- gap: 10px;- padding: 10px 12px;- border-radius: 10px;- background: rgba(255, 255, 255, 0.04);- border: 1px solid rgba(255, 255, 255, 0.08);- font-size: 13px;- color: #d9deea;- margin-bottom: 4px;+.button.primary {+ background: var(--btn-bg);+ border-color: var(--btn-bg);+ color: var(--btn-ink);}-.discovery.found {- background: rgba(89, 216, 160, 0.08);- border-color: rgba(89, 216, 160, 0.35);- color: #79e1b3;++.button.primary:hover {+ background: var(--btn-bg-hover);+ border-color: var(--btn-bg-hover);}-.discovery.missing {- background: rgba(255, 125, 125, 0.06);- border-color: rgba(255, 125, 125, 0.3);- color: #ffb1b1;++.button:disabled {+ opacity: 0.5;+ cursor: default;}-.spinner {- width: 14px;- height: 14px;- border-radius: 50%;- border: 2px solid rgba(255, 255, 255, 0.18);- border-top-color: #ff9a66;- animation: spin 0.85s linear infinite;+.button:focus-visible,+.reveal:focus-visible,+.theme-toggle:focus-visible,+.install-help summary:focus-visible {+ outline: 2px solid var(--border-brand);+ outline-offset: 2px;}-.discovery.found .spinner,-.discovery.missing .spinner { display: none; }-@keyframes spin {- to { transform: rotate(360deg); }+.status {+ margin: 12px 0 0;+ min-height: 20px;+ font-size: 14px;+ line-height: 20px;+ color: var(--fg-body);}+.status.ok {+ color: var(--fg-heading);+}++.status.error {+ color: var(--danger-fg);+}++/* Capture rules: a bordered section like Bitwarden's settings groups */.install-help {- margin-top: 8px;- padding: 10px 12px;- border-radius: 10px;- border: 1px solid rgba(255, 255, 255, 0.06);- background: rgba(255, 255, 255, 0.02);- font-size: 13px;- color: #95a0b7;+ margin-top: 20px;+ border: 1px solid var(--border-base);+ border-radius: 12px;+ background: var(--bg-primary);}+.install-help summary {+ display: flex;+ align-items: center;+ gap: 10px;+ padding: 12px 16px;+ list-style: none;cursor: pointer;user-select: none;+ border-radius: 12px;+ font-size: 14px;+ line-height: 20px;+ font-weight: 600;+ color: var(--fg-heading);}-.install-help p {- margin: 8px 0 0;- line-height: 1.55;++.install-help summary:hover {+ background: var(--bg-hover);}-.install-help a {- color: #ff9a66;++.install-help summary::-webkit-details-marker {+ display: none;}-.advanced {- margin-top: 4px;- padding: 10px 12px;- border-radius: 10px;- border: 1px solid rgba(255, 255, 255, 0.06);- background: rgba(255, 255, 255, 0.02);- font-size: 13px;- color: #95a0b7;+.install-help summary::before {+ content: "";+ width: 6px;+ height: 6px;+ border-right: 2px solid var(--fg-brand);+ border-bottom: 2px solid var(--fg-brand);+ transform: rotate(-45deg);+ transition: transform 0.15s ease;}-.advanced summary {- cursor: pointer;- user-select: none;- list-style: none;++.install-help[open] summary::before {+ transform: rotate(45deg);+}++.install-help[open] summary {+ border-bottom: 1px solid var(--border-light);+ border-bottom-left-radius: 0;+ border-bottom-right-radius: 0;}-.advanced summary::-webkit-details-marker { display: none; }-.advanced summary::before {- content: "▸ ";- color: #6b7691;++.install-help > p,+.install-help > .rules-block,+.install-help > .actions,+.install-help > .status {+ margin-left: 16px;+ margin-right: 16px;}-.advanced[open] summary::before { content: "▾ "; }-.advanced .field { margin-top: 10px; }-/* --- Capture rules -------------------------------------------------------- */-/* The three rule tables need more room than the pairing form, so the card- grows only while the section is open. */-.card:has(#capture-rules[open]) {- width: min(100%, 760px);+.install-help > p {+ margin-top: 12px;+ margin-bottom: 0;+ font-size: 14px;+ line-height: 20px;+ color: var(--fg-body);}#capture-rules h2 {margin: 0;- font-size: 13px;- letter-spacing: 0.04em;- text-transform: uppercase;- color: #d9deea;+ font-size: 14px;+ line-height: 20px;+ font-weight: 600;+ color: var(--fg-heading);}.rules-block {- margin-top: 16px;+ margin-top: 20px;}.rules-head {display: flex;align-items: center;justify-content: space-between;- gap: 10px;- margin-bottom: 6px;+ gap: 12px;+ margin-bottom: 8px;}.rules-scroll {overflow-x: auto;+ border: 1px solid var(--border-base);+ border-radius: 12px;}.rules-table {width: 100%;border-collapse: collapse;- font-size: 12px;+ font-size: 14px;}.rules-table th {+ padding: 8px 10px;text-align: left;- font-weight: 500;- color: #6b7691;- padding: 4px 6px;- border-bottom: 1px solid rgba(255, 255, 255, 0.08);+ font-size: 12px;+ line-height: 16px;+ font-weight: 600;+ color: var(--fg-subtle);white-space: nowrap;+ background: var(--bg-secondary);+ border-bottom: 1px solid var(--border-base);}.rules-table td {- padding: 4px 6px;+ padding: 8px 10px;vertical-align: top;- border-bottom: 1px solid rgba(255, 255, 255, 0.04);+ border-bottom: 1px solid var(--border-light);+}++.rules-table tbody tr:last-child td {+ border-bottom: 0;}-.rules-table .col-on { width: 34px; }-.rules-table .col-flags { width: 56px; }-.rules-table .col-action { width: 88px; }-.rules-table .col-ext { width: 72px; }-.rules-table .col-remove { width: 78px; }+.rules-table .col-on { width: 44px; }+.rules-table .col-flags { width: 68px; }+.rules-table .col-action { width: 104px; }+.rules-table .col-ext { width: 88px; }+.rules-table .col-remove { width: 88px; }.rule-stack {display: grid;- gap: 2px;+ gap: 4px;}.rule-stack .hint {- font-size: 11px;- line-height: 1.35;+ font-size: 12px;+ line-height: 16px;}.rules-table input[type="text"],+.rules-table input[type="number"],.rules-table select {width: 100%;- min-height: 28px;+ min-height: 32px;padding: 0 8px;border-radius: 8px;- background: rgba(255, 255, 255, 0.04);- color: #f5f7fb;- border: 1px solid rgba(255, 255, 255, 0.08);+ background: var(--bg-primary);+ color: var(--fg-heading);+ border: 1px solid var(--border-strong);font: inherit;- font-size: 12px;+ font-size: 14px;+ outline: none;+}++.rules-table input:focus,+.rules-table select:focus {+ border-color: var(--border-brand);+ outline: 1px solid var(--border-brand);+ outline-offset: 0;}.rules-table input.invalid {- border-color: rgba(255, 125, 125, 0.55);- background: rgba(255, 125, 125, 0.06);+ border-color: var(--danger-fg);+ background: var(--danger-bg);}.rule-toggle {- margin: 6px 0 0;- accent-color: #ff7d38;+ margin: 8px 0 0;+ accent-color: var(--btn-bg);}-.rules-test {- margin-top: 12px;+.field.rules-test {+ margin: 16px 0 0;}-.hint.error { color: #ff7d7d; }-.hint.ok { color: #59d8a0; }+.hint.error { color: var(--danger-fg); }+.hint.ok { color: var(--fg-body); }.button.small {- min-height: 28px;+ min-height: 32px;padding: 0 12px;font-size: 12px;+ line-height: 16px;+ border-radius: 10px;}.button.ghost {background: transparent;- border: 1px solid rgba(255, 255, 255, 0.1);- color: #95a0b7;+ border-color: transparent;+ color: var(--fg-subtle);}.button.ghost:hover {- color: #f5f7fb;- border-color: rgba(255, 125, 125, 0.4);+ background: var(--danger-bg);+ color: var(--danger-fg);}-.button.danger {- background: rgba(255, 125, 125, 0.16);- color: #ffb1b1;+#capture-rules .actions {+ margin-top: 20px;+}++#capture-rules .actions > .button {+ flex: 0 0 auto;+}++#capture-rules .status {+ margin-top: 8px;+ margin-bottom: 12px;}.sr-only {@@ -355,3 +684,32 @@ input:focus {white-space: nowrap;border: 0;}++@media (max-width: 560px) {+ .shell {+ padding: 0 0 32px;+ }++ .card {+ padding: 16px;+ border-radius: 0;+ border-left: 0;+ border-right: 0;+ }+}++@media (prefers-reduced-motion: reduce) {+ .spinner {+ animation-duration: 2.4s;+ }++ .discovery.connected,+ .discovery.found {+ animation-duration: 4s;+ }++ .card,+ .install-help summary::before {+ transition: none;+ }+}diff --git a/browser-extension/firefox/pages/options.html b/browser-extension/firefox/pages/options.htmlindex b45121b3..f9463236 100644--- a/browser-extension/firefox/pages/options.html+++ b/browser-extension/firefox/pages/options.html@@ -1,79 +1,102 @@<!doctype html>-<html lang="en">+<html lang="en" data-theme="dark"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" />- <title>LibreGet Extension — Pair with desktop app</title>+ <title>LibreGet extension: pair with desktop app</title><link rel="stylesheet" href="options.css" /></head><body><main class="shell"><div class="card" id="card">- <p class="eyebrow">LibreGet Extension</p>+ <!-- Header: logo, name, theme switch -->+ <div class="brand-row">+ <div class="brand-main">+ <img+ src="../icons/active-48.png"+ srcset="../icons/active-128.png 2x"+ alt="LibreGet"+ class="brand-logo"+ width="32"+ height="32"+ />+ <span class="brand-name">LibreGet</span>+ </div>+ <button id="theme-toggle" class="theme-toggle" type="button" title="Toggle color theme" aria-label="Toggle color theme">+ <svg class="icon-sun" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>+ </svg>+ <svg class="icon-moon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>+ </svg>+ </button>+ </div>++ <h1 class="card-title">Pair with the desktop app</h1><header id="welcome-header" hidden>- <h1>Welcome to LibreGet</h1><p class="body">- Let's connect this browser to the desktop app. We're looking for it- now — almost done.+ We are looking for the desktop app now. This page connects as soon as it is found.</p></header><header id="settings-header" hidden>- <h1>Pair this browser</h1><p class="body">- Open LibreGet, go to <strong>Settings → Network → Browser- extension</strong> and click <strong>Pair extension</strong> —- this page picks the token up automatically within a few seconds.- Or copy the <em>token</em> shown there into the field below.+ In LibreGet, open <strong>Settings > Network > Browser extension</strong> and click <strong>Pair extension</strong>. This page picks up the token within a few seconds. You can also copy the token from there into the field below.</p></header>+ <p class="body default-desc">+ Connect this browser to the LibreGet desktop app so it can capture downloads and streams for you.+ </p>++ <!-- Discovery status --><div id="discovery-status" class="discovery" role="status" aria-live="polite"><span class="spinner" aria-hidden="true"></span><span id="discovery-message">Looking for the desktop app on this machine…</span></div><form id="pair-form" novalidate>- <label class="field">- <span class="label">Pairing token</span>+ <!-- Desktop bridge endpoint -->+ <div class="field" id="advanced">+ <span class="label">Desktop endpoint</span><input- id="token"- name="token"- type="password"- placeholder="Paste the token from LibreGet → Settings → Network → Browser extension"+ id="endpoint"+ name="endpoint"+ type="url"+ placeholder="http://127.0.0.1:47720"autocomplete="off"spellcheck="false"- required/>- <button id="reveal" type="button" class="reveal" aria-pressed="false">- Show- </button>- </label>+ <span class="hint" id="endpoint-hint">Default: <code>http://127.0.0.1:47720</code></span>+ </div>- <details id="advanced" class="advanced">- <summary>Advanced: change endpoint URL</summary>- <label class="field">- <span class="label">Endpoint URL</span>+ <!-- Pairing token -->+ <label class="field">+ <span class="label">Pairing token</span>+ <div class="token-wrap"><input- id="endpoint"- name="endpoint"- type="url"- placeholder="http://127.0.0.1:47720"+ id="token"+ name="token"+ type="password"+ placeholder="Paste the token from LibreGet settings"autocomplete="off"spellcheck="false"+ required/>- <span class="hint" id="endpoint-hint">Default: <code>http://127.0.0.1:47720</code></span>- </label>- </details>+ <button id="reveal" type="button" class="reveal" aria-pressed="false">Show</button>+ </div>+ </label>- <label class="field">- <span class="label">+ <!-- Cookie sync -->+ <label class="field checkbox-field">+ <span class="label checkbox-label"><input id="auto-capture-cookies" type="checkbox" checked />- Automatically sync browser cookies to LibreGet+ Sync browser cookies to LibreGet automatically</span></label>+ <!-- Actions --><div class="actions"><button id="pair-now" type="button" class="button primary">Pair now</button><button id="save" type="submit" class="button">Save</button>@@ -83,13 +106,13 @@<p id="status" class="status" role="status" aria-live="polite"></p></form>+ <!-- Capture rules --><details id="capture-rules" class="install-help"><summary>Advanced: capture rules</summary><p>Three tables decide what the sniffer picks up: file extensions,response content types, and regular expressions over the URL.- Changes save on their own a moment after you stop typing, and- empty rows are dropped.+ Changes save on their own a moment after you stop typing.</p><section class="rules-block">@@ -170,27 +193,6 @@</div><p id="rules-status" class="status" role="status" aria-live="polite"></p></details>-- <details id="extension-backup" class="install-help">- <summary>Back up your list of installed extensions</summary>- <p>- Chrome is turning off Manifest V2 extensions. Export what you have- installed — with permissions and store links — on the- <a href="ext-backup.html" target="_blank" rel="noreferrer">extension backup page</a>.- It asks for access to that list only when you click, and nothing- leaves this computer.- </p>- </details>-- <details id="install-help" class="install-help">- <summary>Don't have LibreGet installed yet?</summary>- <p>- Install the desktop app from- <a href="https://github.com/OpenSelena/libreget/releases/latest" target="_blank" rel="noreferrer">- github.com/OpenSelena/libreget- </a>, launch it once, then come back to this page.- </p>- </details></div></main><script type="module" src="options.js"></script>diff --git a/browser-extension/firefox/pages/options.js b/browser-extension/firefox/pages/options.jsindex 4bfa0e5d..215f8402 100644--- a/browser-extension/firefox/pages/options.js+++ b/browser-extension/firefox/pages/options.js@@ -237,6 +237,23 @@ if (typeof document !== "undefined") {const endpointHint = document.getElementById("endpoint-hint");const advancedDetails = document.getElementById("advanced");const autoCaptureCookiesInput = document.getElementById("auto-capture-cookies");+ const themeToggle = document.getElementById("theme-toggle");++ if (themeToggle) {+ try {+ const savedTheme = localStorage.getItem("libreget-extension-theme");+ if (savedTheme) {+ document.documentElement.setAttribute("data-theme", savedTheme);+ }+ themeToggle.addEventListener("click", () => {+ const isDark = document.documentElement.getAttribute("data-theme") === "dark" ||+ (!document.documentElement.getAttribute("data-theme") && window.matchMedia("(prefers-color-scheme: dark)").matches);+ const next = isDark ? "light" : "dark";+ document.documentElement.setAttribute("data-theme", next);+ localStorage.setItem("libreget-extension-theme", next);+ });+ } catch {}+ }const FALLBACK_ENDPOINT = "http://127.0.0.1:47720";@@ -275,8 +292,8 @@ if (typeof document !== "undefined") {stopPairPolling();}- async function tryAutoPair() {- const result = await autoPair().catch(() => ({ ok: false }));+ async function tryAutoPair({ force = false } = {}) {+ const result = await autoPair({ force }).catch(() => ({ ok: false }));if (!result?.ok) return false;if (result.reason === "already-paired") {stopPairPolling();@@ -411,7 +428,7 @@ if (typeof document !== "undefined") {if (pairNowBtn) {pairNowBtn.addEventListener("click", async () => {setStatus("Trying to pair automatically…");- const paired = await tryAutoPair();+ const paired = await tryAutoPair({ force: true });if (paired) return;setStatus("No open pairing window found. In LibreGet, go to Settings → Network → Browser extension and click \"Pair extension\", then try again (or just wait — this page keeps retrying).",@@ -782,7 +799,7 @@ if (typeof document !== "undefined") {// The tables are advanced settings: build them the first time the section is// opened, not on every visit to the pairing page.if (captureDetails) {- captureDetails.addEventListener("toggle", async () => {+ const loadRulesOnce = async () => {if (!captureDetails.open || rulesLoaded) return;rulesLoaded = true;try {@@ -790,6 +807,8 @@ if (typeof document !== "undefined") {} catch {renderRules(defaultCaptureRules());}- });+ };+ captureDetails.addEventListener("toggle", loadRulesOnce);+ if (captureDetails.open) loadRulesOnce();}}diff --git a/browser-extension/firefox/popup/popup.css b/browser-extension/firefox/popup/popup.cssindex 1ea42e7a..4d4d2d68 100644--- a/browser-extension/firefox/popup/popup.css+++ b/browser-extension/firefox/popup/popup.css@@ -1,15 +1,16 @@:root {- --bg-primary: #141414;- --bg-secondary: #1e1e1e;- --bg-tertiary: #282828;- --text-primary: #f0f0f0;- --text-secondary: #999;- --text-tertiary: #666;- --accent: #F04E23;- --accent-hover: #d4421e;- --success: #22c55e;- --error: #ef4444;- --border: #2a2a2a;+ --bg-primary: #1C1C1E;+ --bg-secondary: #232325;+ --bg-tertiary: #2C2C2E;+ --text-primary: #F5F5F7;+ --text-secondary: #98989D;+ --text-tertiary: #636366;+ --accent: #FF9F0A;+ --accent-hover: #FFAD2E;+ --on-accent: #1E1200;+ --success: #30D158;+ --error: #FF453A;+ --border: rgba(255, 255, 255, 0.08);--radius: 8px;}@@ -65,9 +66,9 @@ body {.toggle-slider {position: absolute;inset: 0;- background: #444;- border-radius: 10px;- transition: background 0.25s ease;+ background: rgba(120, 120, 128, 0.32);+ border-radius: 9999px;+ transition: background 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);}.toggle-slider::before {@@ -79,7 +80,8 @@ body {top: 2px;background: #fff;border-radius: 50%;- transition: transform 0.25s ease;+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);+ transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);}.toggle input:checked + .toggle-slider { background: var(--accent); }@@ -97,7 +99,8 @@ body {gap: 12px;padding: 12px 16px;background: var(--accent);- color: white;+ color: var(--on-accent);+ font-weight: 600;border: none;border-radius: var(--radius);font-size: 14px;diff --git a/browser-extension/firefox/popup/popup.js b/browser-extension/firefox/popup/popup.jsindex 7b3b37ed..fa3e2061 100644--- a/browser-extension/firefox/popup/popup.js+++ b/browser-extension/firefox/popup/popup.js@@ -86,8 +86,28 @@ async function init() {render();});- toggle.addEventListener("change", () => {+ toggle.addEventListener("change", async () => {const requested = toggle.checked;+ if (requested && chrome.permissions?.request) {+ try {+ const granted = await chrome.permissions.request({ origins: ["*://*/*"] });+ if (!granted) {+ toggle.checked = false;+ if (currentData) {+ currentData.snifferEnabled = false;+ render();+ }+ return;+ }+ } catch {+ toggle.checked = false;+ if (currentData) {+ currentData.snifferEnabled = false;+ render();+ }+ return;+ }+ }chrome.runtime.sendMessage({ type: "toggleSniffer", enabled: requested }, (response) => {const effective = response?.enabled ?? requested;if (toggle.checked !== effective) toggle.checked = effective;@@ -511,6 +531,9 @@ async function sendBatch(groups) {}msg.openApp = isOpenAppEnabled();+ const headers = extractSendableHeaders(group.master.requestHeaders);+ if (headers) msg.headers = headers;+try {await new Promise((resolve) => {chrome.runtime.sendMessage(msg, (response) => {@@ -575,6 +598,11 @@ function pickBestMedia(media) {return videoItems.reduce((best, m) => m.contentLength > best.contentLength ? m : best, videoItems[0]);}+ const audioItems = media.filter(m => m.mediaType === "audio" && isListableMedia(m));+ if (audioItems.length > 0) {+ return audioItems.reduce((best, m) => (m.contentLength > best.contentLength ? m : best), audioItems[0]);+ }+// A DASH manifest carries no useful size, so it can only be picked by recency// — and without this a page whose only media is an mpd renders as "listening"// while the item sits in the list underneath.diff --git a/browser-extension/firefox/src/background.js b/browser-extension/firefox/src/background.jsindex 92bea9a9..ea08ab25 100644--- a/browser-extension/firefox/src/background.js+++ b/browser-extension/firefox/src/background.js@@ -13,6 +13,7 @@ import {} from "./deep-search-toggle.js";import { loadH264State, isH264Enabled, isBlock60, setH264 } from "./h264-toggle.js";import { registerContextMenu, getContextMenuId } from "./context-menu.js";+import { loadOpenAppState, isOpenAppEnabled } from "./open-app-toggle.js";import { openLibregetScheme } from "./send-via-scheme.js";import { isSyntheticManifestUrl } from "./synthetic-manifest.js";import {@@ -182,6 +183,7 @@ if (menusApi?.onClicked) {url,platform: "generic",referer: tab?.url || "",+ openApp: isOpenAppEnabled(),});if (result.ok) {@@ -192,6 +194,7 @@ if (menusApi?.onClicked) {chrome.runtime.onStartup.addListener(() => {registerContextMenu();+ loadOpenAppState().catch(() => {});refreshActiveTab().catch(() => {});void runAutoPairTick();void ensureAutoPairAlarm();@@ -210,6 +213,7 @@ if (chrome.commands && chrome.commands.onCommand) {url: tab.url,platform: detected.platform,referer: tab.url,+ openApp: isOpenAppEnabled(),});if (result?.ok && tab.id !== undefined) {actionFeedback.showSuccessBadge(tab.id);@@ -382,7 +386,7 @@ function updateBadge(tabId) {}).catch(() => {});chrome.action.setBadgeBackgroundColor({tabId,- color: "#F04E23",+ color: "#FF9F0A",}).catch(() => {});}diff --git a/browser-extension/firefox/src/bridge-client.js b/browser-extension/firefox/src/bridge-client.jsindex 79ecb0ec..1122ca96 100644--- a/browser-extension/firefox/src/bridge-client.js+++ b/browser-extension/firefox/src/bridge-client.js@@ -198,10 +198,11 @@ export async function autoPair({fetchImpl = typeof fetch !== "undefined" ? fetch : null,storage = globalThis.chrome?.storage?.local,timeoutMs = HEALTH_TIMEOUT_MS,+ force = false,} = {}) {if (!fetchImpl) return { ok: false, reason: "no-fetch" };const current = await loadBridgeConfig({ storage });- if (current.token) return { ok: true, reason: "already-paired" };+ if (!force && current.token) return { ok: true, reason: "already-paired" };let endpoint = current.endpoint;const discovered = await discoverBridgeEndpoint({ fetchImpl, timeoutMs });diff --git a/browser-extension/firefox/src/capture-rules.js b/browser-extension/firefox/src/capture-rules.jsindex 57adee62..ee6674ea 100644--- a/browser-extension/firefox/src/capture-rules.js+++ b/browser-extension/firefox/src/capture-rules.js@@ -415,7 +415,7 @@ export const DEFAULT_REGEX_RULES = Object.freeze([enabled: true,}),Object.freeze({- pattern: ".*\\.bilivideo\\.(com|cn).*\\/live-bvc\\/.*m4s",+ pattern: "^https?://[^/]*\\.bilivideo\\.(com|cn)/.*live-bvc/.*m4s",flags: "ig",action: "block",ext: "",diff --git a/browser-extension/firefox/src/detect.js b/browser-extension/firefox/src/detect.jsindex 4e4c854e..9060c863 100644--- a/browser-extension/firefox/src/detect.js+++ b/browser-extension/firefox/src/detect.js@@ -57,6 +57,7 @@ function detectPlatform(url) {if (matchesHost(host, "vimeo.com")) return "vimeo";if (matchesHost(host, "udemy.com")) return "udemy";if (matchesHost(host, "bilibili.com") || host === "b23.tv") return "bilibili";+ if (host === "docs.google.com") return "gdocs";return null;}@@ -90,6 +91,8 @@ function detectContentType(platform, url) {return parseUdemy(segments);case "bilibili":return parseBilibili(segments);+ case "gdocs":+ return parseGdocs(segments);default:return "unknown";}@@ -265,6 +268,20 @@ function parseBilibili(segments) {return segments[0] === "video" && segments[1] ? "video" : "unknown";}+function parseGdocs(segments) {+ if (+ (segments[0] === "presentation" || segments[0] === "document" || segments[0] === "spreadsheets") &&+ segments[1] === "d" &&+ segments[2]+ ) {+ if (segments[2] === "e") {+ return segments[3] ? "post" : "unknown";+ }+ return "post";+ }+ return "unknown";+}+function matchesHost(host, domain) {return host === domain || host.endsWith(`.${domain}`);}diff --git a/browser-extension/firefox/src/media-sniffer.js b/browser-extension/firefox/src/media-sniffer.jsindex 00a868ad..64a7710d 100644--- a/browser-extension/firefox/src/media-sniffer.js+++ b/browser-extension/firefox/src/media-sniffer.js@@ -179,12 +179,15 @@ function isHlsSegment(url, contentType) {function isPlatformCdnFragment(url, contentType, contentLength) {try {- const host = new URL(url).hostname;+ const u = new URL(url);+ const host = u.hostname;const isPlatformCdn = PLATFORM_CDN_HOSTS.some(cdn => host.includes(cdn));if (!isPlatformCdn) return false;- if (contentLength > 0 && contentLength < 5 * 1024 * 1024) return true;+ if (u.searchParams.has("bytestart") || u.searchParams.has("byterange")) return true;const ct = contentType.toLowerCase();if (ct.includes("octet-stream")) return true;+ const isMetaCdn = host.includes("fbcdn.net") || host.includes("cdninstagram.com");+ if (isMetaCdn && contentLength > 0 && contentLength < 5 * 1024 * 1024) return true;return false;} catch { return false; }}diff --git a/browser-extension/firefox/src/send-via-scheme.js b/browser-extension/firefox/src/send-via-scheme.jsindex 890c0143..02e3720b 100644--- a/browser-extension/firefox/src/send-via-scheme.js+++ b/browser-extension/firefox/src/send-via-scheme.js@@ -15,7 +15,10 @@ export function buildLibregetSchemeUrl(url) {if (trimmed.startsWith("magnet:") || trimmed.startsWith("p2p:")) {return `libreget:${trimmed}`;}- const withoutProtocol = trimmed.replace(/^https?:\/\//i, "");+ if (trimmed.startsWith("http://")) {+ return `${LIBREGET_SCHEME}http://${trimmed.slice(7)}`;+ }+ const withoutProtocol = trimmed.replace(/^https:\/\//i, "");if (!withoutProtocol) {return null;}diff --git a/demos/nami-preview/index.html b/demos/nami-preview/index.htmlnew file mode 100644index 00000000..ceb832db--- /dev/null+++ b/demos/nami-preview/index.html@@ -0,0 +1,6761 @@+<!DOCTYPE html>+<html lang="en" data-theme="dark" data-shell="mac">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>LibreGet — Nami</title>+ <style>+/*+ * LibreGet buttons — macOS push-button family.+ * <button class="btn btn-primary"> filled accent, one per surface+ * <button class="btn btn-secondary">bezel (surface + hairline), the default look+ * <button class="btn btn-ghost"> borderless, toolbar-style+ * <button class="btn btn-destructive">+ * <button class="btn btn-pill"> filter chip / tag toggle+ * <button class="btn btn-icon"> 28×28 symbol-only+ * Sizes: btn-sm 24px · default 28px · btn-lg 36px · btn-xl 44px (hero CTA).+ */++.btn {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 6px;+ height: var(--control-h);+ padding: 0 var(--space-3);+ font-family: inherit;+ font-size: var(--text-base);+ font-weight: 500;+ line-height: 1;+ letter-spacing: 0;+ color: var(--text);+ background: var(--surface);+ border: none;+ border-radius: var(--radius-sm);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ cursor: pointer;+ user-select: none;+ white-space: nowrap;+ vertical-align: middle;+ -webkit-tap-highlight-color: transparent;+ transition:+ background var(--duration-fast) var(--ease-out),+ color var(--duration-fast) var(--ease-out),+ box-shadow var(--duration-fast) var(--ease-out),+ opacity var(--duration-fast) var(--ease-out);+}++.btn > svg {+ flex-shrink: 0;+}++.btn:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++.btn:disabled,+.btn[aria-disabled="true"] {+ opacity: 0.45;+ cursor: default;+ pointer-events: none;+}++/* sizes */+.btn-sm {+ height: 24px;+ padding: 0 var(--space-2);+ font-size: var(--text-sm);+ border-radius: 5px;+}++.btn-lg {+ height: var(--control-h-lg);+ padding: 0 var(--space-4);+ font-size: var(--text-md);+ font-weight: 600;+ border-radius: var(--radius-md);+}++.btn-xl {+ height: 44px;+ padding: 0 var(--space-5);+ font-size: var(--text-md);+ font-weight: 600;+ border-radius: var(--radius-lg);+}++.btn-block {+ width: 100%;+}++/* secondary is the plain bezel button; kept as an explicit class for clarity */+.btn-secondary {+ background: var(--surface);+ color: var(--text);+}++@media (hover: hover) {+ .btn-secondary:hover:not(:disabled),+ .btn:not([class*="btn-"]):hover:not(:disabled) {+ background: var(--surface-hi);+ }+}++.btn-secondary:active:not(:disabled),+.btn:not([class*="btn-"]):active:not(:disabled) {+ background: var(--button-press);+}++/* primary — the action the user came for */+.btn-primary {+ background: var(--cta);+ color: var(--on-cta);+ box-shadow: inset 0 0 0 var(--hairline) color-mix(in srgb, var(--on-cta) 12%, transparent);+}++@media (hover: hover) {+ .btn-primary:hover:not(:disabled) {+ background: var(--cta-hover);+ }+}++.btn-primary:active:not(:disabled) {+ background: var(--cta-press);+}++.btn-primary .spinner {+ border-color: color-mix(in srgb, var(--on-cta) 30%, transparent);+ border-top-color: var(--on-cta);+}++/* ghost — borderless, lives in toolbars and rows */+.btn-ghost {+ background: transparent;+ color: var(--text-muted);+ box-shadow: none;+}++@media (hover: hover) {+ .btn-ghost:hover:not(:disabled) {+ background: var(--fill-2);+ color: var(--text);+ }+}++.btn-ghost:active:not(:disabled) {+ background: var(--fill-3);+}++/* tinted — accent text on accent-soft fill (secondary emphasis) */+.btn-tinted {+ background: var(--accent-soft);+ color: var(--accent-hi);+ box-shadow: none;+}++@media (hover: hover) {+ .btn-tinted:hover:not(:disabled) {+ background: color-mix(in srgb, var(--accent) 22%, transparent);+ }+}++/* destructive — delete, cancel-with-loss */+.btn-destructive {+ background: color-mix(in srgb, var(--danger) 12%, transparent);+ color: var(--danger);+ box-shadow: none;+}++@media (hover: hover) {+ .btn-destructive:hover:not(:disabled) {+ background: var(--danger);+ color: var(--on-status);+ }+}++/* icon-only */+.btn-icon {+ width: var(--control-h);+ padding: 0;+ color: var(--text-muted);+ background: transparent;+ box-shadow: none;+ border-radius: var(--radius-sm);+}++.btn-icon.btn-sm {+ width: 24px;+}++.btn-icon.btn-lg {+ width: var(--control-h-lg);+}++@media (hover: hover) {+ .btn-icon:hover:not(:disabled) {+ background: var(--fill-2);+ color: var(--text);+ }+}++.btn-icon:active:not(:disabled) {+ background: var(--fill-3);+}++.btn-icon.active,+.btn-icon[aria-pressed="true"] {+ background: var(--accent-soft);+ color: var(--accent-hi);+}++/* pill — filter chips, tag toggles */+.btn-pill {+ height: 24px;+ padding: 0 var(--space-3);+ font-size: var(--text-sm);+ font-weight: 500;+ border-radius: var(--radius-full);+ background: var(--fill-1);+ color: var(--text-muted);+ box-shadow: none;+}++@media (hover: hover) {+ .btn-pill:hover:not(:disabled) {+ background: var(--fill-2);+ color: var(--text);+ }+}++.btn-pill.active,+.btn-pill[aria-pressed="true"],+.btn-pill[aria-selected="true"] {+ background: var(--accent-soft);+ color: var(--accent-hi);+}++/* loading */+.btn.loading {+ pointer-events: none;+ opacity: 0.8;+}++.btn.loading .spinner {+ width: 12px;+ height: 12px;+ border-width: 1.5px;+}++/* keyboard shortcut hint inside a button */+.btn .kbd {+ margin-left: var(--space-1);+ opacity: 0.7;+}++/* a row of buttons, macOS dialog order: cancel on the left of the default */+.btn-row {+ display: flex;+ align-items: center;+ gap: var(--space-2);+}++.btn-row.end {+ justify-content: flex-end;+}++/*+ * LibreGet primitives — the shared vocabulary every surface (core and plugin)+ * builds from. Apple idioms: grouped inset lists with hairline separators,+ * bezel controls, pop-up buttons, switches, segmented controls, sheets, popovers.+ * Each primitive covers default / hover / active / focus-visible / disabled.+ */++/* ---------- Field (input + label + hint/error) ---------- */++.field {+ display: flex;+ flex-direction: column;+ gap: var(--space-1);+ min-width: 0;+}++.field-label {+ font-size: var(--text-base);+ font-weight: 500;+ color: var(--text);+}++.field-hint {+ font-size: var(--text-sm);+ line-height: var(--leading-sm);+ color: var(--text-dim);+}++.field-error {+ font-size: var(--text-sm);+ color: var(--danger);+}++.input {+ height: var(--control-h);+ padding: 0 var(--space-2);+ font-family: inherit;+ font-size: var(--text-base);+ color: var(--text);+ background: var(--control-bg);+ border: none;+ border-radius: var(--radius-sm);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ transition: background var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);+}++.input::placeholder {+ color: var(--text-dim);+}++.input:hover:not(:disabled):not(:focus) {+ background: var(--control-bg-hover);+}++.input:focus,+.input:focus-visible {+ outline: none;+ box-shadow:+ inset 0 0 0 var(--hairline) var(--accent),+ 0 0 0 3px var(--accent-soft);+}++.input:disabled {+ opacity: 0.5;+ cursor: not-allowed;+}++.input.error {+ box-shadow: inset 0 0 0 var(--hairline) var(--danger);+}++.input.error:focus {+ box-shadow:+ inset 0 0 0 var(--hairline) var(--danger),+ 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);+}++.input-lg {+ height: var(--control-h-lg);+ padding: 0 var(--space-3);+ font-size: var(--text-md);+ border-radius: var(--radius-md);+}++.input-search {+ padding-left: 28px;+ border-radius: var(--radius-md);+ background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23888'><path d='M8.5 2.5a6 6 0 1 0 3.67 10.74l3.8 3.79a1 1 0 0 0 1.41-1.41l-3.79-3.8A6 6 0 0 0 8.5 2.5zM4.5 8.5a4 4 0 1 1 8 0 4 4 0 0 1-8 0z'/></svg>");+ background-repeat: no-repeat;+ background-position: 9px center;+ background-size: 13px 13px;+}++textarea.input {+ height: auto;+ min-height: 72px;+ padding: var(--space-2);+ resize: vertical;+ line-height: var(--leading-base);+}++/* ---------- Checkbox & radio (macOS 14pt) ---------- */++.checkbox,+.radio,+input[type="checkbox"]:not([class]),+input[type="radio"]:not([class]) {+ appearance: none;+ -webkit-appearance: none;+ width: 14px;+ height: 14px;+ margin: 0;+ flex-shrink: 0;+ border: none;+ background: var(--control-bg);+ box-shadow: inset 0 0 0 var(--hairline) var(--input-border);+ cursor: pointer;+ display: inline-grid;+ place-content: center;+ vertical-align: middle;+ transition: background var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);+}++.checkbox,+input[type="checkbox"]:not([class]) {+ border-radius: 3.5px;+}++.radio,+input[type="radio"]:not([class]) {+ border-radius: var(--radius-full);+}++.checkbox:hover:not(:disabled),+.radio:hover:not(:disabled),+input[type="checkbox"]:not([class]):hover:not(:disabled),+input[type="radio"]:not([class]):hover:not(:disabled) {+ background: var(--control-bg-hover);+}++.checkbox:checked,+.radio:checked,+input[type="checkbox"]:not([class]):checked,+input[type="radio"]:not([class]):checked {+ background: var(--accent);+ box-shadow: none;+}++.checkbox:checked::before,+input[type="checkbox"]:not([class]):checked::before {+ content: "";+ width: 8px;+ height: 8px;+ background: var(--on-accent);+ clip-path: polygon(14% 46%, 0 62%, 40% 100%, 100% 18%, 84% 4%, 38% 68%);+}++.radio:checked::before,+input[type="radio"]:not([class]):checked::before {+ content: "";+ width: 5px;+ height: 5px;+ border-radius: var(--radius-full);+ background: var(--on-accent);+}++.checkbox:focus-visible,+.radio:focus-visible,+input[type="checkbox"]:not([class]):focus-visible,+input[type="radio"]:not([class]):focus-visible {+ outline: var(--focus-ring);+ outline-offset: 2px;+}++.checkbox:disabled,+.radio:disabled,+input[type="checkbox"]:not([class]):disabled,+input[type="radio"]:not([class]):disabled {+ opacity: 0.45;+ cursor: not-allowed;+}++/* ---------- Switch (macOS toggle, 38×22) ---------- */++.toggle {+ position: relative;+ width: 38px;+ height: 22px;+ flex-shrink: 0;+ padding: 0;+ border: none;+ border-radius: var(--radius-full);+ background: var(--fill-3);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ cursor: pointer;+ transition: background var(--duration-base) var(--ease-out);+}++.toggle.on,+.toggle[aria-checked="true"] {+ background: var(--accent);+ box-shadow: none;+}++.toggle-knob {+ position: absolute;+ top: 2px;+ left: 2px;+ width: 18px;+ height: 18px;+ border-radius: var(--radius-full);+ background: #ffffff;+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.08);+ transition: transform var(--duration-base) var(--ease-spring);+ pointer-events: none;+}++.toggle.on .toggle-knob,+.toggle[aria-checked="true"] .toggle-knob {+ transform: translateX(16px);+}++.toggle:active .toggle-knob {+ width: 21px;+}++.toggle.on:active .toggle-knob,+.toggle[aria-checked="true"]:active .toggle-knob {+ transform: translateX(13px);+}++.toggle:focus-visible {+ outline: var(--focus-ring);+ outline-offset: 2px;+}++.toggle:disabled {+ opacity: 0.45;+ cursor: default;+}++.toggle-sm {+ width: 30px;+ height: 18px;+}++.toggle-sm .toggle-knob {+ width: 14px;+ height: 14px;+}++.toggle-sm.on .toggle-knob,+.toggle-sm[aria-checked="true"] .toggle-knob {+ transform: translateX(12px);+}++/* ---------- Segmented control ---------- */++.segmented,+.mac-segmented {+ display: inline-flex;+ align-items: center;+ padding: 2px;+ gap: 1px;+ background: var(--fill-2);+ border-radius: var(--radius-md);+}++.segmented-btn,+.mac-segmented-btn {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 6px;+ height: 24px;+ padding: 0 var(--space-3);+ font-size: var(--text-sm);+ font-weight: 500;+ border: none;+ background: transparent;+ color: var(--text-muted);+ border-radius: 6px;+ cursor: pointer;+ white-space: nowrap;+ transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);+}++@media (hover: hover) {+ .segmented-btn:hover:not(.active):not(:disabled),+ .mac-segmented-btn:hover:not(.active):not(:disabled) {+ color: var(--text);+ }+}++.segmented-btn.active,+.segmented-btn[aria-selected="true"],+.segmented-btn[aria-checked="true"],+.mac-segmented-btn.active {+ background: var(--surface-hi);+ color: var(--text);+ box-shadow: 0 1px 2px rgba(var(--shadow-ink), var(--elev-alpha-1)), inset 0 0 0 var(--hairline) var(--content-border);+}++.segmented-btn:focus-visible,+.mac-segmented-btn:focus-visible {+ outline: var(--focus-ring);+ outline-offset: -1px;+}++.segmented-btn:disabled,+.mac-segmented-btn:disabled {+ opacity: 0.4;+ cursor: default;+}++.segmented-lg .segmented-btn {+ height: 28px;+ font-size: var(--text-base);+}++/* ---------- Badge & tag ---------- */++.badge {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ min-width: 18px;+ height: 18px;+ padding: 0 5px;+ font-size: var(--text-xs);+ font-weight: 600;+ line-height: 1;+ color: var(--on-accent);+ background: var(--accent);+ border-radius: var(--radius-full);+ font-variant-numeric: tabular-nums;+}++.badge-neutral {+ background: var(--fill-2);+ color: var(--text-muted);+}++.badge-danger {+ background: var(--danger);+ color: var(--on-status);+}++.tag {+ display: inline-flex;+ align-items: center;+ gap: var(--space-1);+ height: 20px;+ padding: 0 var(--space-2);+ font-size: var(--text-xs);+ font-weight: 500;+ color: var(--text-muted);+ background: var(--fill-1);+ border-radius: var(--radius-full);+ white-space: nowrap;+}++.tag-accent { color: var(--accent-hi); background: var(--accent-soft); }+.tag-success { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }+.tag-warning { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }+.tag-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }+.tag-info { color: var(--info); background: color-mix(in srgb, var(--info) 14%, transparent); }++/* ---------- Avatar ---------- */++.avatar {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ width: 28px;+ height: 28px;+ border-radius: var(--radius-full);+ background: var(--fill-2);+ color: var(--text-muted);+ font-size: var(--text-xs);+ font-weight: 600;+ overflow: hidden;+ flex-shrink: 0;+ user-select: none;+}++.avatar img {+ width: 100%;+ height: 100%;+ object-fit: cover;+}++.avatar-sm { width: 20px; height: 20px; font-size: var(--text-caption); }+.avatar-lg { width: 44px; height: 44px; font-size: var(--text-md); }++/* ---------- Symbol tile (app-icon style icon container) ---------- */++.symbol-tile {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ width: 28px;+ height: 28px;+ flex-shrink: 0;+ border-radius: 7px;+ background: var(--accent);+ color: var(--on-accent);+}++.symbol-tile-lg {+ width: 40px;+ height: 40px;+ border-radius: 10px;+}++.symbol-tile-neutral {+ background: var(--fill-2);+ color: var(--text-muted);+}++/* ---------- Card / surface ---------- */++.surface-card {+ background: var(--surface);+ border-radius: var(--radius-lg);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+}++.surface-card.interactive {+ cursor: pointer;+ transition: background var(--duration-fast) var(--ease-out);+}++@media (hover: hover) {+ .surface-card.interactive:hover {+ background: var(--surface-hi);+ }+}++.surface-card.interactive:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++/* ---------- Grouped inset list (System Settings style) ---------- */++.group {+ background: var(--surface);+ border-radius: var(--radius-lg);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ overflow: hidden;+}++.group-label {+ display: block;+ padding: 0 var(--space-2);+ margin: 0 0 var(--space-2);+ font-size: var(--text-sm);+ font-weight: 600;+ color: var(--text-dim);+}++.group-footer {+ display: block;+ padding: 0 var(--space-2);+ margin: var(--space-2) 0 0;+ font-size: var(--text-sm);+ line-height: var(--leading-sm);+ color: var(--text-dim);+}++.group + .group-label,+.group-footer + .group-label {+ margin-top: var(--space-5);+}++.group > .group-row + .group-row,+.group > .list-row + .list-row,+.group > .setting-row + .setting-row {+ position: relative;+}++.group > .group-row + .group-row::before,+.group > .list-row + .list-row::before,+.group > .setting-row + .setting-row::before {+ content: "";+ position: absolute;+ top: 0;+ left: var(--space-3);+ right: 0;+ height: var(--hairline);+ background: var(--separator);+ pointer-events: none;+}++.group-row {+ display: flex;+ align-items: center;+ gap: var(--space-3);+ min-height: var(--row-base);+ padding: var(--space-2) var(--space-3);+}++.group-row-content {+ flex: 1;+ min-width: 0;+ display: flex;+ flex-direction: column;+ gap: 2px;+}++.group-row-title {+ font-size: var(--text-base);+ color: var(--text);+}++.group-row-sub {+ font-size: var(--text-sm);+ line-height: var(--leading-sm);+ color: var(--text-dim);+}++.group-row-trailing {+ display: flex;+ align-items: center;+ gap: var(--space-2);+ flex-shrink: 0;+}++/* ---------- List row ---------- */++.list-row {+ display: flex;+ align-items: center;+ gap: var(--space-3);+ min-height: var(--row-base);+ padding: var(--space-2) var(--space-3);+ border-radius: var(--radius-md);+ color: var(--text);+ font-size: var(--text-base);+ text-align: left;+ width: 100%;+ background: transparent;+}++.list-row.compact {+ min-height: var(--row-compact);+ padding: var(--space-1) var(--space-3);+}++.list-row.interactive {+ cursor: pointer;+ transition: background var(--duration-fast) var(--ease-out);+}++@media (hover: hover) {+ .list-row.interactive:hover {+ background: var(--fill-1);+ }+}++.list-row.interactive:active {+ background: var(--fill-2);+}++.list-row.interactive:focus-visible {+ outline: var(--focus-ring);+ outline-offset: -2px;+}++.list-row.selected {+ background: var(--accent);+ color: var(--on-accent);+}++.list-row.selected .list-row-sub,+.list-row.selected .list-row-trailing {+ color: inherit;+ opacity: 0.8;+}++.list-row-content {+ flex: 1;+ min-width: 0;+ display: flex;+ flex-direction: column;+ gap: 1px;+}++.list-row-title {+ font-size: var(--text-base);+ font-weight: 500;+ color: inherit;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}++.list-row-sub {+ font-size: var(--text-sm);+ color: var(--text-dim);+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}++.list-row-trailing {+ display: flex;+ align-items: center;+ gap: var(--space-2);+ flex-shrink: 0;+ color: var(--text-dim);+ font-size: var(--text-sm);+}++.chevron {+ color: var(--text-faint);+ flex-shrink: 0;+}++/* ---------- Section header (sentence case, tertiary) ---------- */++.section-header {+ display: flex;+ align-items: baseline;+ justify-content: space-between;+ gap: var(--space-3);+ padding: 0 var(--space-1);+ margin: 0 0 var(--space-2);+}++.section-header-title {+ font-size: var(--text-sm);+ font-weight: 600;+ letter-spacing: 0;+ text-transform: none;+ color: var(--text-dim);+}++.section-header-action {+ font-size: var(--text-sm);+ font-weight: 500;+ color: var(--accent-hi);+ background: none;+ border: none;+ cursor: pointer;+ padding: 0;+}++.section-header-action:hover {+ text-decoration: underline;+ text-underline-offset: 2px;+}++.section-header-action:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+ border-radius: var(--radius-xs);+}++/* ---------- Separator ---------- */++.separator {+ border: none;+ height: var(--hairline);+ margin: var(--space-2) 0;+ background: var(--separator);+}++.separator.inset {+ margin-left: var(--space-3);+}++/* ---------- Tooltip ---------- */++.tooltip {+ position: absolute;+ z-index: 300;+ max-width: 260px;+ padding: var(--space-1) var(--space-2);+ font-size: var(--text-xs);+ line-height: var(--leading-xs);+ color: var(--text);+ background: var(--popup-bg);+ border-radius: var(--radius-sm);+ box-shadow: var(--elev-2);+ pointer-events: none;+ white-space: normal;+}++/* ---------- Menu / popover ---------- */++.popover {+ background: var(--material-thick);+ backdrop-filter: var(--material-blur);+ -webkit-backdrop-filter: var(--material-blur);+ border-radius: var(--radius-lg);+ box-shadow: var(--elev-2);+ padding: 5px;+ min-width: 180px;+ z-index: 250;+}++.menu-item {+ display: flex;+ align-items: center;+ gap: var(--space-2);+ width: 100%;+ min-height: 26px;+ padding: 3px 10px;+ border: none;+ background: transparent;+ border-radius: 5px;+ color: var(--text);+ font-size: var(--text-base);+ text-align: left;+ cursor: pointer;+}++.menu-item > svg {+ flex-shrink: 0;+ color: var(--text-muted);+}++@media (hover: hover) {+ .menu-item:hover:not(:disabled) {+ background: var(--accent);+ color: var(--on-accent);+ }++ .menu-item:hover:not(:disabled) > svg {+ color: inherit;+ }+}++.menu-item:focus-visible {+ outline: none;+ background: var(--accent);+ color: var(--on-accent);+}++.menu-item:disabled {+ opacity: 0.4;+ cursor: default;+}++.menu-item.destructive {+ color: var(--danger);+}++@media (hover: hover) {+ .menu-item.destructive:hover:not(:disabled) {+ background: var(--danger);+ color: var(--on-status);+ }+}++.menu-separator {+ height: var(--hairline);+ margin: 5px 8px;+ background: var(--separator);+}++/* ---------- Dialog / sheet ---------- */++.dialog-backdrop {+ position: fixed;+ inset: 0;+ background: var(--dialog-backdrop);+ z-index: 400;+ display: flex;+ align-items: center;+ justify-content: center;+ padding: var(--space-5);+}++.dialog-card {+ width: min(440px, 100%);+ background: var(--popup-bg);+ border-radius: var(--radius-xl);+ box-shadow: var(--elev-3);+ padding: var(--space-5);+ display: flex;+ flex-direction: column;+ gap: var(--space-3);+}++.dialog-title {+ font-family: var(--font-display);+ font-size: var(--text-md);+ line-height: var(--leading-md);+ font-weight: 600;+ letter-spacing: var(--track-snug);+ color: var(--text);+ margin: 0;+}++.dialog-body {+ font-size: var(--text-base);+ line-height: var(--leading-base);+ color: var(--text-muted);+}++.dialog-actions {+ display: flex;+ justify-content: flex-end;+ gap: var(--space-2);+ margin-top: var(--space-2);+}++/* ---------- Skeleton ---------- */++.skeleton {+ background: var(--fill-1);+ border-radius: var(--radius-sm);+ position: relative;+ overflow: hidden;+ min-height: 12px;+}++.skeleton::after {+ content: "";+ position: absolute;+ inset: 0;+ transform: translateX(-100%);+ background: linear-gradient(90deg, transparent, var(--fill-2), transparent);+ animation: skeleton-sweep calc(var(--duration-bounce) * 3) var(--ease-out) infinite;+}++.skeleton.circle {+ border-radius: var(--radius-full);+}++@keyframes skeleton-sweep {+ 100% { transform: translateX(100%); }+}++@media (prefers-reduced-motion: reduce) {+ .skeleton::after {+ animation: none;+ }+}++/* ---------- Empty state (never blank: title, hint, one action) ---------- */++.empty-state {+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: var(--space-2);+ padding: var(--space-7) var(--space-5);+ text-align: center;+}++.empty-state-icon {+ color: var(--text-faint);+ margin-bottom: var(--space-1);+}++.empty-state-art {+ width: 72px;+ height: 72px;+ object-fit: contain;+ margin-bottom: var(--space-2);+ filter: drop-shadow(0 6px 10px rgba(var(--shadow-ink), var(--elev-alpha-2)));+}++.empty-state-title {+ font-family: var(--font-display);+ font-size: var(--text-md);+ font-weight: 600;+ letter-spacing: var(--track-snug);+ color: var(--text);+}++.empty-state-hint {+ font-size: var(--text-base);+ line-height: var(--leading-base);+ color: var(--text-dim);+ max-width: 360px;+}++.empty-state .btn {+ margin-top: var(--space-2);+}++/* ---------- Progress ---------- */++.progress {+ width: 100%;+ height: 4px;+ border-radius: var(--radius-full);+ background: var(--fill-2);+ overflow: hidden;+}++.progress-fill {+ height: 100%;+ border-radius: var(--radius-full);+ background: var(--accent);+ transition: width var(--duration-base) var(--ease-out);+}++.progress-fill.success { background: var(--success); }+.progress-fill.danger { background: var(--danger); }+.progress-fill.paused { background: var(--text-dim); }++.progress.indeterminate .progress-fill {+ width: 40%;+ animation: progress-slide calc(var(--duration-bounce) * 2.5) var(--ease-in-out) infinite;+}++@keyframes progress-slide {+ 0% { transform: translateX(-100%); }+ 100% { transform: translateX(350%); }+}++.spinner {+ display: inline-block;+ width: 16px;+ height: 16px;+ border: 2px solid var(--fill-3);+ border-top-color: var(--text-muted);+ border-radius: var(--radius-full);+ animation: spin calc(var(--duration-bounce) * 1.6) linear infinite;+ flex-shrink: 0;+}++@keyframes spin {+ to { transform: rotate(360deg); }+}++@keyframes soft-pulse {+ 0%, 100% { opacity: 1; }+ 50% { opacity: 0.45; }+}++@media (prefers-reduced-motion: reduce) {+ .progress.indeterminate .progress-fill {+ animation: soft-pulse calc(var(--duration-bounce) * 3) var(--ease-in-out) infinite;+ transform: none;+ width: 100%;+ }++ .spinner {+ animation: soft-pulse calc(var(--duration-bounce) * 3) var(--ease-in-out) infinite;+ }+}++/* ---------- Toast ---------- */++.toast-card {+ display: flex;+ align-items: flex-start;+ gap: var(--space-2);+ min-width: 260px;+ max-width: 420px;+ padding: var(--space-3) var(--space-4);+ background: var(--material-thick);+ backdrop-filter: var(--material-blur);+ -webkit-backdrop-filter: var(--material-blur);+ border-radius: var(--radius-lg);+ box-shadow: var(--elev-2);+ font-size: var(--text-base);+ color: var(--text);+}++/* ---------- Kbd ---------- */++.kbd,+.mac-kbd {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ min-width: 18px;+ height: 18px;+ padding: 0 5px;+ border-radius: 4px;+ background: var(--fill-2);+ font-size: var(--text-xs);+ font-family: var(--font-body);+ font-weight: 500;+ color: var(--text-muted);+ letter-spacing: 0.02em;+}++/* ---------- Callout / notice ---------- */++.notice {+ display: flex;+ align-items: flex-start;+ gap: var(--space-3);+ padding: var(--space-3) var(--space-4);+ border-radius: var(--radius-lg);+ background: var(--fill-1);+ color: var(--text);+ font-size: var(--text-base);+ line-height: var(--leading-base);+}++.notice > svg {+ flex-shrink: 0;+ margin-top: 1px;+ color: var(--text-muted);+}++.notice-body {+ flex: 1;+ min-width: 0;+}++.notice-title {+ font-weight: 600;+ display: block;+}++.notice-text {+ color: var(--text-muted);+}++.notice-info { background: color-mix(in srgb, var(--info) 10%, transparent); }+.notice-info > svg { color: var(--info); }+.notice-success { background: color-mix(in srgb, var(--success) 10%, transparent); }+.notice-success > svg { color: var(--success); }+.notice-warning { background: color-mix(in srgb, var(--warning) 12%, transparent); }+.notice-warning > svg { color: var(--warning); }+.notice-danger { background: color-mix(in srgb, var(--danger) 10%, transparent); }+.notice-danger > svg { color: var(--danger); }++/*+ * Settings — System Settings idiom.+ * Rows live inside grouped inset lists (`.card` = group), label left, control+ * right, hairline separators, 40pt rows. Drill lists use chevrons. No card+ * shadows: depth is one surface step above the pane.+ */++.settings {+ display: flex;+ flex-direction: column;+ align-items: stretch;+ min-height: 0;+ gap: var(--space-3);+ width: 100%;+ max-width: none;+}++.settings.settings-mac {+ align-items: stretch;+ min-height: 0;+ flex: 1;+ padding: 0;+ gap: 0;+}++.settings > :global(*) {+ width: 100%;+}++.settings-loading {+ display: flex;+ align-items: center;+ justify-content: center;+ flex: 1;+ min-height: 12rem;+}++.settings-search-row {+ display: flex;+ padding: 0 0 var(--space-2);+}++.settings-search {+ width: 100%;+ height: var(--control-h);+ padding: 0 var(--space-2) 0 28px;+ background: var(--control-bg);+ color: var(--text);+ border: none;+ border-radius: var(--radius-md);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ font-size: var(--text-base);+ outline: none;+ transition: box-shadow var(--duration-fast) var(--ease-out);+ background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23888'><path d='M8.5 2.5a6 6 0 1 0 3.67 10.74l3.8 3.79a1 1 0 0 0 1.41-1.41l-3.79-3.8A6 6 0 0 0 8.5 2.5zM4.5 8.5a4 4 0 1 1 8 0 4 4 0 0 1-8 0z'/></svg>");+ background-repeat: no-repeat;+ background-position: 9px center;+ background-size: 13px 13px;+}++.settings-search::-webkit-search-cancel-button {+ -webkit-appearance: none;+ appearance: none;+}++.settings-search:focus {+ box-shadow:+ inset 0 0 0 var(--hairline) var(--accent),+ 0 0 0 3px var(--accent-soft);+}++.settings-content :global(mark.settings-search-hit) {+ padding: 0 1px;+ border-radius: 2px;+ background: color-mix(in srgb, var(--accent) 30%, transparent);+ color: inherit;+ font-weight: 600;+}++.category-tabs.searching {+ opacity: 0.5;+ pointer-events: auto;+}++.settings-content {+ display: flex;+ flex-direction: column;+ gap: var(--space-3);+}++.settings-panel {+ display: flex;+ flex-direction: column;+ gap: var(--space-3);+}++.settings-panel.is-hidden {+ display: none !important;+}++.settings-panel:not(.is-hidden) ~ .settings-panel:not(.is-hidden) {+ margin-top: var(--space-6);+}++.spinner {+ width: 20px;+ height: 20px;+ border: 2px solid var(--fill-3);+ border-top-color: var(--text-muted);+ border-radius: 50%;+ animation: spin var(--duration-slow) linear infinite;+}++@keyframes spin {+ to {+ transform: rotate(360deg);+ }+}++.section {+ display: flex;+ flex-direction: column;+ gap: var(--space-2);+}++.section + .section {+ margin-top: var(--space-4);+}++.settings-section-head {+ display: flex;+ flex-direction: column;+ gap: 2px;+ padding-top: var(--space-5);+ margin-top: 0;+}++.settings-section-head:first-child {+ padding-top: 0;+ margin-top: 0;+}++.settings-section-head .section-title {+ margin-bottom: 0;+ font-size: var(--text-xl);+ line-height: var(--leading-xl);+ font-weight: 700;+ letter-spacing: var(--track-tight);+}++/* h5.section-title directly above a group reads as a System Settings group label */+.section > .section-title,+.section > h5.section-title {+ font-size: var(--text-sm);+ font-weight: 600;+ letter-spacing: 0;+ color: var(--text-dim);+ margin: 0 0 var(--space-1) var(--space-2);+}++.section-title {+ font-size: var(--text-md);+}++.settings-section-hint {+ font-size: var(--text-base);+ font-weight: 400;+ color: var(--text-dim);+ margin: 0 0 var(--space-2) 0;+ line-height: var(--leading-base);+ max-width: 60ch;+}++.platform-subhead {+ font-size: var(--text-sm);+ font-weight: 600;+ color: var(--text-dim);+ margin: var(--space-4) 0 var(--space-1) var(--space-2);+}++.platform-subhead:first-child {+ margin-top: 0;+}++/* ---------- Group (card) + rows ---------- */++.card {+ background: var(--surface);+ border-radius: var(--radius-lg);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ padding: 0 var(--space-3);+}++.card > .setting-row + .setting-row,+.card > .divider + .setting-row {+ border-top: var(--hairline) solid var(--separator);+}++.setting-row {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: var(--space-4);+ padding: var(--space-2) 0;+ min-height: var(--row-base);+}++.setting-col {+ display: flex;+ flex-direction: column;+ gap: 2px;+ min-width: 0;+ flex: 1;+}++.setting-label {+ font-size: var(--text-base);+ font-weight: 400;+ color: var(--text);+}++.setting-path {+ font-size: var(--text-sm);+ font-weight: 400;+ color: var(--text-dim);+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ line-height: var(--leading-sm);+}++.divider {+ height: 0;+ background: none;+}++/* ---------- Controls ---------- */++.select {+ height: var(--control-h);+ padding: 0 26px 0 var(--space-3);+ font-size: var(--text-base);+ font-weight: 400;+ background-color: var(--control-bg);+ border-radius: var(--radius-sm);+ color: var(--text);+ border: none;+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ cursor: pointer;+ flex-shrink: 0;+ max-width: 260px;+ appearance: none;+ -webkit-appearance: none;+ background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M3.5 4.75 6 2.25l2.5 2.5M3.5 7.25 6 9.75l2.5-2.5'/></svg>");+ background-repeat: no-repeat;+ background-position: right 8px center;+ background-size: 12px 12px;+}++.select:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++.input-number,+.input-hotkey,+.input-text,+.input-template,+.naming-input,+.downloads-speed-input,+.flag-value-input {+ height: var(--control-h);+ padding: 0 var(--space-2);+ font-size: var(--text-base);+ font-weight: 400;+ background: var(--control-bg);+ border-radius: var(--radius-sm);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ color: var(--text);+ border: none;+ transition: box-shadow var(--duration-fast) var(--ease-out);+}++.input-number:focus-visible,+.input-hotkey:focus-visible,+.input-text:focus-visible,+.input-template:focus-visible,+.naming-input:focus-visible,+.downloads-speed-input:focus-visible,+.flag-value-input:focus-visible {+ outline: none;+ box-shadow:+ inset 0 0 0 var(--hairline) var(--accent),+ 0 0 0 3px var(--accent-soft);+}++.input-number {+ width: 72px;+ text-align: center;+ font-variant-numeric: tabular-nums;+}++.input-hotkey {+ width: 180px;+ font-size: var(--text-sm);+ text-align: center;+ flex-shrink: 0;+}++.input-text {+ flex: 1;+ min-width: 120px;+ max-width: 220px;+}++.input-template {+ width: 100%;+ font-family: var(--font-mono);+ font-size: var(--text-sm);+}++.naming-input {+ font-family: var(--font-mono);+ font-size: var(--text-sm);+}++.downloads-speed-input {+ width: 88px;+ text-align: right;+ font-variant-numeric: tabular-nums;+}++.flag-value-input {+ width: 70px;+ height: 22px;+ font-size: var(--text-xs);+ border-radius: 4px;+}++.hotkey-row {+ flex-wrap: wrap;+}++.hotkey-controls {+ display: flex;+ flex-direction: column;+ gap: var(--space-2);+ align-items: flex-end;+}++.hotkey-mode-switch {+ display: flex;+ gap: 1px;+ padding: 2px;+ background: var(--fill-2);+ border-radius: var(--radius-md);+}++.hotkey-mode-btn {+ height: 22px;+ padding: 0 var(--space-3);+ font-size: var(--text-sm);+ font-weight: 500;+ background: transparent;+ color: var(--text-muted);+ border: none;+ border-radius: 6px;+ cursor: pointer;+}++.hotkey-mode-btn.active {+ background: var(--surface-hi);+ color: var(--text);+ box-shadow: 0 1px 2px rgba(var(--shadow-ink), var(--elev-alpha-1)), inset 0 0 0 var(--hairline) var(--content-border);+}++.hotkey-mode-btn:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++.hotkey-record-btn {+ cursor: pointer;+ user-select: none;+}++.hotkey-record-btn.recording {+ box-shadow: 0 0 0 3px var(--accent-soft);+ animation: hotkey-pulse calc(var(--duration-bounce) * 3) var(--ease-in-out) infinite;+}++@keyframes hotkey-pulse {+ 0%, 100% { box-shadow: 0 0 0 3px var(--accent-soft); }+ 50% { box-shadow: 0 0 0 3px transparent; }+}++.template-row {+ flex-direction: column;+ align-items: stretch;+ gap: var(--space-2);+}++.template-preview {+ padding: 0 0 var(--space-3);+}++.template-preview .setting-path {+ word-break: break-all;+ white-space: normal;+}++/* switch — the primitive in primitives.css already styles .toggle; keep the+ legacy 44px name compatible by not overriding it here. */++.reset-btn {+ height: var(--control-h);+ padding: 0 var(--space-3);+ font-size: var(--text-base);+ font-weight: 500;+ color: var(--danger);+ background: color-mix(in srgb, var(--danger) 10%, transparent);+ border-radius: var(--radius-sm);+ border: none;+ cursor: pointer;+}++@media (hover: hover) {+ .reset-btn:hover {+ background: var(--danger);+ color: var(--on-status);+ }+}++/* ---------- Presets / chips ---------- */++.preset-grid {+ display: grid;+ grid-template-columns: repeat(3, minmax(0, 1fr));+ gap: var(--space-2);+}++@media (max-width: 720px) {+ .preset-grid {+ grid-template-columns: 1fr;+ }+}++.preset-card {+ display: flex;+ flex-direction: column;+ align-items: flex-start;+ gap: 2px;+ padding: var(--space-3);+ border: none;+ border-radius: var(--radius-md);+ background: var(--surface);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ color: var(--text);+ cursor: pointer;+ text-align: left;+ transition: box-shadow var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);+}++@media (hover: hover) {+ .preset-card:hover {+ background: var(--surface-hi);+ }+}++.preset-card.active {+ box-shadow: inset 0 0 0 2px var(--accent);+ background: var(--accent-soft);+}++.preset-card:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++.preset-label {+ font-weight: 600;+ font-size: var(--text-base);+}++.preset-desc {+ font-size: var(--text-sm);+ line-height: var(--leading-sm);+ color: var(--text-dim);+}++.sb-chips {+ display: flex;+ flex-wrap: wrap;+ gap: 6px;+ padding: var(--space-1) 0 var(--space-2);+}++.sb-chip {+ height: 24px;+ padding: 0 var(--space-3);+ border: none;+ border-radius: 999px;+ background: var(--fill-1);+ color: var(--text-muted);+ font: inherit;+ font-size: var(--text-sm);+ font-weight: 500;+ cursor: pointer;+ transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);+}++@media (hover: hover) {+ .sb-chip:hover {+ background: var(--fill-2);+ color: var(--text);+ }+}++.sb-chip.on {+ background: var(--accent-soft);+ color: var(--accent-hi);+}++.sb-chip:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++.ghost-btn {+ height: var(--control-h);+ padding: 0 var(--space-3);+ border-radius: var(--radius-sm);+ border: none;+ background: transparent;+ color: var(--text);+ font-size: var(--text-base);+ font-weight: 500;+ cursor: pointer;+}++@media (hover: hover) {+ .ghost-btn:hover {+ background: var(--fill-2);+ }+}++.naming-block {+ padding: var(--space-3) 0 var(--space-2);+ display: flex;+ flex-direction: column;+ gap: var(--space-3);+}++.naming-row {+ display: flex;+ flex-direction: column;+ gap: var(--space-1);+}++.naming-label {+ font-size: var(--text-sm);+ color: var(--text-dim);+}++.naming-help {+ font-size: var(--text-xs);+ color: var(--text-dim);+ margin: var(--space-1) 0 0;+ line-height: 1.4;+}++.path-warning {+ display: flex;+ align-items: flex-start;+ gap: 6px;+ margin-top: 6px;+ color: var(--warning);+ font-size: var(--text-sm);+ line-height: 1.4;+}++.path-warning svg {+ flex-shrink: 0;+ margin-top: 1px;+}++.speed-limit {+ display: flex;+ align-items: center;+ gap: 6px;+}++/* ---------- Disclosure ---------- */++.settings-disclosure > summary {+ cursor: pointer;+ list-style: none;+ display: flex;+ flex-direction: column;+ gap: 2px;+ padding-top: var(--space-4);+ margin-top: var(--space-2);+}++.settings-disclosure > summary::-webkit-details-marker {+ display: none;+}++.settings-disclosure > summary::before {+ content: "";+ display: inline-block;+ width: 10px;+ height: 10px;+ margin-right: 6px;+ background: currentColor;+ clip-path: polygon(30% 10%, 75% 50%, 30% 90%, 22% 82%, 58% 50%, 22% 18%);+ transition: transform var(--duration-fast) var(--ease-out);+ color: var(--text-dim);+}++.settings-disclosure[open] > summary::before {+ transform: rotate(90deg);+}++.settings-disclosure-hint {+ margin: 0 0 var(--space-2) 1.1em;+}++.settings-disclosure-nested > summary {+ border-top: none;+ padding-top: var(--space-2);+ margin-top: var(--space-2);+ font-size: var(--text-base);+}++/* ---------- Drill-down list ---------- */++.settings-drill-list {+ display: flex;+ flex-direction: column;+ border-radius: var(--radius-lg);+ overflow: hidden;+ background: var(--surface);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+}++.settings-drill-item {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: var(--space-3);+ width: 100%;+ min-height: 52px;+ padding: var(--space-2) var(--space-3) var(--space-2) var(--space-3);+ border: none;+ background: transparent;+ text-align: left;+ cursor: pointer;+ color: var(--text);+ transition: background var(--duration-fast) var(--ease-out);+ position: relative;+}++.settings-drill-item + .settings-drill-item::before {+ content: "";+ position: absolute;+ top: 0;+ left: var(--space-3);+ right: 0;+ height: var(--hairline);+ background: var(--separator);+}++@media (hover: hover) {+ .settings-drill-item:hover {+ background: var(--fill-1);+ }+}++.settings-drill-item:active {+ background: var(--fill-2);+}++.settings-drill-item:focus-visible {+ outline: var(--focus-ring);+ outline-offset: -2px;+}++.settings-drill-item-icon {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ width: 28px;+ height: 28px;+ border-radius: 7px;+ background: var(--accent);+ color: var(--on-accent);+ flex-shrink: 0;+}++.settings-drill-item-text {+ display: flex;+ flex-direction: column;+ gap: 1px;+ min-width: 0;+ flex: 1;+}++.settings-drill-item-title {+ font-size: var(--text-base);+ font-weight: 500;+ color: var(--text);+}++.settings-drill-item-hint {+ font-size: var(--text-sm);+ font-weight: 400;+ color: var(--text-dim);+ line-height: 1.35;+}++.settings-drill-item-chevron {+ flex-shrink: 0;+ font-size: 16px;+ font-weight: 400;+ color: var(--text-faint);+ line-height: 1;+}++.settings-drill-back {+ display: flex;+ flex-direction: column;+ gap: var(--space-1);+ margin-bottom: var(--space-3);+}++.settings-drill-back-btn {+ display: inline-flex;+ align-items: center;+ gap: 2px;+ align-self: flex-start;+ height: 24px;+ padding: 0 var(--space-2) 0 var(--space-1);+ margin-left: calc(var(--space-1) * -1);+ border: none;+ background: transparent;+ color: var(--accent-hi);+ font-size: var(--text-base);+ font-weight: 500;+ cursor: pointer;+ border-radius: var(--radius-sm);+}++@media (hover: hover) {+ .settings-drill-back-btn:hover {+ background: var(--accent-soft);+ }+}++.settings-drill-back-btn:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++.settings-drill-back-chevron {+ font-size: 18px;+ line-height: 1;+}++.settings-drill-back-head .section-title {+ margin-bottom: 0;+ font-size: var(--text-xl);+ line-height: var(--leading-xl);+ font-weight: 700;+ letter-spacing: var(--track-tight);+}++.settings-drill-spacer {+ height: var(--space-3);+}++.settings-subsection-head {+ font-size: var(--text-sm);+ font-weight: 600;+ color: var(--text-dim);+ margin: var(--space-4) 0 var(--space-1) var(--space-2);+}++.settings-subsection-head:first-child {+ margin-top: 0;+}++/* ---------- Dependencies table ---------- */++.deps-table-wrap {+ border-radius: var(--radius-lg);+ background: var(--surface);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+}++/* No overflow:hidden here: it clipped the per-row "…" menu (issue #222). */+.deps-table thead th:first-child {+ border-top-left-radius: calc(var(--radius-lg) - 1px);+}++.deps-table thead th:last-child {+ border-top-right-radius: calc(var(--radius-lg) - 1px);+}++.deps-table {+ width: 100%;+ border-collapse: collapse;+ font-size: var(--text-base);+ table-layout: fixed;+}++.deps-table thead {+ background: transparent;+}++.deps-table th {+ padding: var(--space-2) var(--space-3);+ text-align: left;+ font-size: var(--text-xs);+ font-weight: 600;+ letter-spacing: 0;+ text-transform: none;+ color: var(--text-dim);+ border-bottom: var(--hairline) solid var(--separator);+}++.deps-table th:first-child,+.deps-table :global(.deps-cell-name) {+ width: 18%;+}++.deps-table th:nth-child(2),+.deps-table :global(.deps-cell-version) {+ width: 22%;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ color: var(--text-dim);+ font-variant-numeric: tabular-nums;+}++.deps-table th:nth-child(3),+.deps-table :global(.deps-cell-status) {+ width: 18%;+}++.deps-table th.deps-col-action,+.deps-table :global(.deps-cell-action) {+ width: 42%;+ text-align: right;+ white-space: nowrap;+}++.deps-table :global(.deps-table-row) {+ border-bottom: var(--hairline) solid var(--separator);+}++.deps-table :global(.deps-table-row:last-child) {+ border-bottom: none;+}++.deps-table :global(td) {+ padding: var(--space-2) var(--space-3);+ vertical-align: middle;+ min-height: var(--row-base);+}++.dep-ok {+ color: var(--success);+}++.dep-missing {+ color: var(--danger);+}++.dep-btn {+ height: 24px;+ padding: 0 var(--space-2);+ font-size: var(--text-sm);+ flex-shrink: 0;+}++.dep-spinner {+ width: 16px;+ height: 16px;+ border: 2px solid var(--fill-3);+ border-top-color: var(--text-muted);+ border-radius: 50%;+ animation: spin var(--duration-slow) linear infinite;+ flex-shrink: 0;+}++/* ---------- Update banner ---------- */++.update-banner {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: var(--space-3);+ padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);+ margin: var(--space-4) var(--space-5) 0;+ background: var(--accent);+ border-radius: var(--radius-lg);+}++.update-text {+ font-size: var(--text-base);+ font-weight: 500;+ color: var(--on-accent);+}++.update-btn {+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 6px;+ height: var(--control-h);+ padding: 0 var(--space-3);+ font-size: var(--text-base);+ font-weight: 600;+ background: color-mix(in srgb, var(--on-accent) 14%, transparent);+ color: var(--on-accent);+ border: none;+ border-radius: var(--radius-sm);+ cursor: pointer;+ flex-shrink: 0;+}++.update-btn:disabled {+ cursor: default;+ opacity: 0.7;+}++@media (hover: hover) {+ .update-btn:not(:disabled):hover {+ background: color-mix(in srgb, var(--on-accent) 22%, transparent);+ }+}++.update-btn:focus-visible {+ outline: 2px solid var(--on-accent);+ outline-offset: 2px;+}++.update-spinner {+ width: 14px;+ height: 14px;+ border: 2px solid color-mix(in srgb, var(--on-accent) 30%, transparent);+ border-top-color: var(--on-accent);+ border-radius: 50%;+ animation: spin var(--duration-slow) linear infinite;+}++/* ---------- Flags ---------- */++.flag-grid {+ display: flex;+ flex-wrap: wrap;+ gap: 6px;+ padding: var(--space-3) 0;+}++.flag-chip {+ display: inline-flex;+ align-items: center;+ gap: var(--space-1);+ height: 26px;+ padding: 0 var(--space-3);+ font-size: var(--text-sm);+ font-weight: 500;+ border-radius: var(--radius-full);+ background: var(--fill-1);+ color: var(--text-muted);+ cursor: pointer;+ border: none;+ transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);+ user-select: none;+}++@media (hover: hover) {+ .flag-chip:hover {+ background: var(--fill-2);+ color: var(--text);+ }+}++.flag-chip.active {+ background: var(--accent);+ color: var(--on-accent);+}++/* ---------- Category tabs (legacy, still used inside some panels) ---------- */++.category-tabs {+ display: inline-flex;+ flex-wrap: wrap;+ gap: 1px;+ padding: 2px;+ background: var(--fill-2);+ border-radius: var(--radius-md);+}++.cat-tab {+ height: 24px;+ padding: 0 var(--space-3);+ font-size: var(--text-sm);+ font-weight: 500;+ color: var(--text-muted);+ background: none;+ border: none;+ border-radius: 6px;+ cursor: pointer;+ white-space: nowrap;+}++.cat-tab.active {+ background: var(--surface-hi);+ color: var(--text);+ box-shadow: 0 1px 2px rgba(var(--shadow-ink), var(--elev-alpha-1)), inset 0 0 0 var(--hairline) var(--content-border);+}++@media (hover: hover) {+ .cat-tab:not(.active):hover {+ color: var(--text);+ }+}++.cat-tab:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++/* ---------- Theme picker ---------- */++.theme-grid {+ display: grid;+ grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));+ gap: var(--space-3);+ padding: var(--space-3) 0;+}++.more-themes {+ padding: 0 0 var(--space-2);+}++.more-themes-toggle {+ display: block;+ width: 100%;+ margin: 0 0 var(--space-2);+ padding: var(--space-2) 0;+ text-align: left;+ font-size: var(--text-base);+ font-weight: 500;+ color: var(--accent-hi);+ background: transparent;+ border: none;+ border-radius: var(--radius-sm);+ cursor: pointer;+}++@media (hover: hover) {+ .more-themes-toggle:hover {+ text-decoration: underline;+ text-underline-offset: 2px;+ }+}++.more-themes-toggle:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++.more-themes > summary {+ cursor: pointer;+ padding: var(--space-2) 0;+ font-size: var(--text-sm);+ font-weight: 500;+ color: var(--text-dim);+ user-select: none;+ list-style: revert;+}++.more-themes > summary:hover {+ color: var(--text);+}++.more-themes[open] > summary {+ margin-bottom: var(--space-1);+ color: var(--text);+}++.more-themes > .theme-grid {+ padding: 0;+}++.theme-card {+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: 6px;+ padding: 0;+ border: none;+ border-radius: var(--radius-md);+ background: transparent;+ cursor: pointer;+ transition: transform var(--duration-fast) var(--ease-out);+}++.theme-card:focus-visible {+ outline: var(--focus-ring);+ outline-offset: 3px;+}++.theme-card.active .theme-preview {+ box-shadow: 0 0 0 2px var(--pane-bg), 0 0 0 4px var(--accent);+}++.theme-card.active .theme-name {+ color: var(--text);+ font-weight: 600;+}++@media (hover: hover) {+ .theme-card:hover .theme-preview {+ transform: translateY(-1px);+ }+}++@media (prefers-reduced-motion: reduce) {+ .theme-card:hover .theme-preview {+ transform: none;+ }+}++.theme-preview {+ width: 100%;+ aspect-ratio: 16/10;+ border-radius: var(--radius-md);+ overflow: hidden;+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);+}++.preview-bg {+ width: 100%;+ height: 100%;+ display: flex;+ align-items: center;+ justify-content: center;+ position: relative;+}++.preview-text {+ font-size: 16px;+ font-weight: 600;+}++.preview-accent {+ position: absolute;+ bottom: 0;+ left: 0;+ right: 0;+ height: 4px;+}++.system-preview {+ display: flex;+ align-items: center;+ justify-content: center;+ background: var(--surface-hi);+}++.theme-name {+ font-size: var(--text-xs);+ color: var(--text-dim);+ text-align: center;+}++@media (prefers-reduced-motion: reduce) {+ .spinner,+ .update-spinner,+ .dep-spinner {+ animation: settings-soft-pulse calc(var(--duration-bounce) * 3) var(--ease-in-out) infinite;+ }+}++@keyframes settings-soft-pulse {+ 0%, 100% { opacity: 1; }+ 50% { opacity: 0.45; }+}++/*+ * LibreGet shell — window chrome in the macOS idiom.+ *+ * ┌──────────────┬────────────────────────────────────────────┐+ * │ ●●● │ Title [segmented] [⌕ search] │ ← titlebar/toolbar (glass)+ * │ sidebar │ ┌──────────────────────────────────────────┐│+ * │ (glass over │ │ content pane (opaque, rounded, inset) ││+ * │ window bg) │ │ ││+ * │ │ └──────────────────────────────────────────┘│+ * └──────────────┴────────────────────────────────────────────┘+ *+ * The sidebar and toolbar are chrome and sit on the window material; the+ * content pane is the one opaque, elevated surface. Everything inside the+ * pane uses the grouped-list primitives, never a second shadowed card.+ */++[data-shell="mac"] {+ --sidebar-width: 224px;+ --titlebar-height: 44px;+ --toolbar-height: 44px;+ --inspector-width: 320px;+ --pane-inset: 8px;+ --pane-radius: var(--radius-lg);+}++[data-platform="macos"] {+ --titlebar-height: 52px;+}++/* ---------- Titlebar / toolbar ---------- */++.mac-titlebar {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);+ align-items: center;+ gap: var(--space-3);+ height: var(--titlebar-height);+ margin-inline-end: var(--pane-inset);+ padding: 0 var(--space-4);+ background: transparent;+ flex-shrink: 0;+ user-select: none;+ /* drag is `data-tauri-drag-region` in markup; WKWebView ignores -webkit-app-region */+}++.mac-titlebar-leading {+ display: flex;+ align-items: center;+ gap: var(--space-2);+ min-width: 0;+}++.mac-titlebar-title {+ font-family: var(--font-display);+ font-size: var(--text-md);+ font-weight: 600;+ letter-spacing: var(--track-snug);+ color: var(--text);+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+}++.mac-titlebar-title--quiet {+ color: var(--text-dim);+ font-weight: 500;+}++.mac-titlebar-center {+ display: flex;+ align-items: center;+ justify-content: center;+ min-width: 0;+}++.mac-titlebar-center .segmented-btn {+ height: 28px;+ min-width: 28px;+}++.mac-titlebar-actions {+ display: flex;+ align-items: center;+ justify-content: flex-end;+ gap: var(--space-2);+ min-width: 0;+}++.mac-toolbar-group {+ display: flex;+ align-items: center;+ gap: 2px;+}++.mac-toolbar-btn {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 6px;+ height: 28px;+ min-width: 28px;+ padding: 0 var(--space-2);+ border: none;+ border-radius: var(--radius-sm);+ background: transparent;+ color: var(--text-muted);+ font-size: var(--text-sm);+ font-weight: 500;+ cursor: pointer;+ white-space: nowrap;+ transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);+}++@media (hover: hover) {+ .mac-toolbar-btn:hover:not(:disabled) {+ background: var(--fill-2);+ color: var(--text);+ }+}++.mac-toolbar-btn:active:not(:disabled) {+ background: var(--fill-3);+}++.mac-toolbar-btn.active,+.mac-toolbar-btn[aria-pressed="true"] {+ background: var(--accent-soft);+ color: var(--accent-hi);+}++.mac-toolbar-btn.prominent {+ background: var(--cta);+ color: var(--on-cta);+ padding: 0 var(--space-3);+}++@media (hover: hover) {+ .mac-toolbar-btn.prominent:hover:not(:disabled) {+ background: var(--cta-hover);+ color: var(--on-cta);+ }+}++.mac-toolbar-btn:disabled {+ opacity: 0.4;+ cursor: default;+}++.mac-toolbar-btn:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++.mac-toolbar-sep {+ width: var(--hairline);+ height: 16px;+ margin: 0 var(--space-1);+ background: var(--separator);+}++.mac-search-field {+ display: inline-flex;+ align-items: center;+ gap: 6px;+ height: 28px;+ min-width: 180px;+ padding: 0 6px 0 9px;+ background: var(--control-bg);+ color: var(--text-dim);+ border: none;+ border-radius: var(--radius-md);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ cursor: text;+ transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);+}++.mac-search-glyph {+ flex-shrink: 0;+ opacity: 0.8;+}++.mac-search-label {+ flex: 1;+ text-align: start;+ font-size: var(--text-base);+ font-weight: 400;+}++.mac-search-field .kbd {+ margin-inline-start: auto;+}++@media (hover: hover) {+ .mac-search-field:hover {+ color: var(--text-muted);+ background: var(--control-bg-hover);+ }+}++.mac-search-field:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++@media (max-width: 980px) {+ .mac-titlebar-center {+ display: none;+ }++ .mac-search-field {+ min-width: 28px;+ width: 28px;+ padding: 0;+ justify-content: center;+ }++ .mac-search-glyph {+ width: 12px;+ height: 12px;+ }++ .mac-search-label,+ .mac-search-field .kbd {+ display: none;+ }+}++/* Windows and Linux keep the native title bar: `titleBarStyle: Overlay` is+ macOS-only in tauri-runtime-wry, so the OS draws its own bar with the+ window controls *above* the webview. Nothing overlaps our toolbar there. */+[data-platform="other"] .mac-source-list-drag {+ height: var(--space-3);+}++/* ---------- Sidebar (source list) ---------- */++.mac-source-list {+ width: var(--sidebar-width);+ min-width: var(--sidebar-width);+ transition:+ width 200ms var(--ease-out),+ min-width 200ms var(--ease-out);+ display: flex;+ flex-direction: column;+ background: transparent;+ padding: 0 var(--space-2) var(--space-2);+ overflow-y: auto;+ overflow-x: hidden;+ flex-shrink: 0;+ position: relative;+ scrollbar-width: none;+}++.mac-source-list::-webkit-scrollbar {+ display: none;+}++.mac-source-list-drag {+ display: block;+ flex-shrink: 0;+ height: var(--titlebar-height);+ margin: 0 calc(var(--space-2) * -1) var(--space-1);+}++.mac-nav-section {+ margin-bottom: var(--space-4);+}++.mac-nav-section:last-child {+ margin-bottom: 0;+}++.mac-nav-section-header {+ display: flex;+ align-items: center;+ justify-content: space-between;+ padding: 0 var(--space-2) var(--space-1);+ font-size: var(--text-xs);+ font-weight: 600;+ letter-spacing: 0;+ text-transform: none;+ color: var(--text-dim);+ min-height: 20px;+}++.mac-nav-item {+ display: flex;+ align-items: center;+ gap: 10px;+ height: 36px;+ padding: 0 var(--space-2) 0 6px;+ border-radius: var(--radius-md);+ color: var(--text);+ font-size: var(--text-base);+ font-weight: 450;+ text-decoration: none;+ position: relative;+ transition: background var(--duration-fast) var(--ease-out);+ -webkit-tap-highlight-color: transparent;+}++@media (hover: hover) {+ .mac-nav-item:hover:not(.active) {+ background: var(--fill-1);+ }+}++.mac-nav-item:active:not(.active) {+ background: var(--fill-2);+}++.mac-nav-item.active {+ background: var(--sidebar-highlight);+ color: var(--text);+ font-weight: 600;+ box-shadow: inset 0 0 0 var(--hairline) color-mix(in srgb, var(--secondary) 6%, transparent);+}++.mac-nav-item:focus-visible {+ outline: var(--focus-ring);+ outline-offset: -2px;+}++.mac-nav-label {+ flex: 1;+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}++.mac-nav-badge {+ min-width: 18px;+ height: 18px;+ padding: 0 5px;+ font-size: var(--text-xs);+ font-weight: 600;+ line-height: 18px;+ text-align: center;+ color: var(--text-muted);+ background: var(--fill-2);+ border-radius: var(--radius-full);+ font-variant-numeric: tabular-nums;+}++.mac-nav-badge.live {+ color: var(--on-accent);+ background: var(--accent);+}++.mac-nav-badge.update-badge {+ font-size: 10px;+ font-weight: 700;+ letter-spacing: 0.04em;+ padding: 0 6px;+}++.mac-plugins-toggle {+ display: flex;+ align-items: center;+ justify-content: center;+ width: 20px;+ height: 20px;+ border: none;+ background: transparent;+ color: var(--text-dim);+ border-radius: var(--radius-xs);+ cursor: pointer;+ padding: 0;+ opacity: 0;+ transition: opacity var(--duration-fast) var(--ease-out);+}++.mac-nav-section:hover .mac-plugins-toggle,+.mac-plugins-toggle:focus-visible,+.mac-plugins-toggle[aria-expanded="false"] {+ opacity: 1;+}++@media (hover: hover) {+ .mac-plugins-toggle:hover {+ background: var(--fill-2);+ color: var(--text);+ }+}++.mac-source-list-footer {+ margin-top: auto;+ padding-top: var(--space-3);+}++[data-shell="mac"][data-sidebar="collapsed"],+[data-sidebar="collapsed"] {+ --sidebar-width: 64px;+}++[data-sidebar="collapsed"] .mac-nav-label,+[data-sidebar="collapsed"] .mac-nav-badge,+[data-sidebar="collapsed"] .mac-plugins-toggle {+ display: none;+}++[data-sidebar="collapsed"] .mac-nav-section-header {+ font-size: 0;+ min-height: 0;+ height: 1px;+ width: 24px;+ margin: 0 auto var(--space-2);+ padding: 0;+ background: var(--separator, var(--content-border));+}++[data-sidebar="collapsed"] .mac-nav-section-header > * {+ display: none;+}++[data-sidebar="collapsed"] .mac-nav-item {+ justify-content: center;+ padding: 0;+ height: 44px;+}++[data-sidebar="collapsed"] .mac-nav-item:has(.mac-nav-badge.live)::after {+ content: "";+ position: absolute;+ top: 7px;+ right: 10px;+ width: 8px;+ height: 8px;+ border-radius: 50%;+ background: var(--accent);+ box-shadow: 0 0 0 2px var(--sidebar-bg, var(--bg));+}++/* Narrow windows: icon-only rail */+@media (max-width: 860px) {+ [data-shell="mac"] {+ --sidebar-width: 64px;+ }++ .mac-nav-label,+ .mac-nav-section-header,+ .mac-nav-badge,+ .mac-plugins-toggle {+ display: none;+ }++ .mac-nav-item {+ justify-content: center;+ padding: 0;+ height: 36px;+ }++ .mac-nav-item :global(.nav-tile) {+ --tile-size: 26px;+ }++ .mac-nav-item :global(.nav-penguin) {+ --icon-size: 26px;+ }+}++@media (prefers-reduced-motion: reduce) {+ .mac-source-list {+ transition: none;+ }+}++/* ---------- Content pane ---------- */++.mac-pane {+ flex: 1;+ min-height: 0;+ min-width: 0;+ display: flex;+ flex-direction: column;+ background: var(--pane-bg);+ border-radius: var(--pane-radius);+ box-shadow:+ inset 0 0 0 var(--hairline) var(--content-border),+ inset 0 1px 0 color-mix(in srgb, var(--secondary) 5%, transparent),+ 0 1px 2px rgba(var(--shadow-ink), var(--elev-alpha-1));+ margin-block: 0 var(--pane-inset);+ margin-inline: 0 var(--pane-inset);+ overflow: hidden;+ position: relative;+ isolation: isolate;+}++/* Plugin surfaces expect to be flex children of a column that fills the pane+ (`flex: 1; min-height: 0`), so this wrapper is a flex column, not a block. */+.mac-pane-scroll {+ flex: 1;+ min-height: 0;+ display: flex;+ flex-direction: column;+ overflow-y: auto;+ overscroll-behavior: contain;+ transform: translateZ(0);+ will-change: scroll-position;+}++.mac-content {+ flex: 1;+ overflow-y: auto;+ padding: var(--space-5);+ min-width: 0;+}++.mac-content--home {+ padding: var(--space-3);+ display: flex;+ flex-direction: column;+ min-height: 0;+}++.mac-content--pane {+ padding: 0;+ display: flex;+ flex-direction: column;+ min-height: 0;+ overflow: hidden;+}++/* A page inside the pane: 20pt margins, readable measure by default */+.page {+ padding: var(--space-5) var(--space-6) var(--space-7);+ max-width: 960px;+ width: 100%;+ margin: 0 auto;+}++.page-wide {+ max-width: none;+}++.page-head {+ display: flex;+ align-items: flex-end;+ justify-content: space-between;+ gap: var(--space-4);+ margin-bottom: var(--space-5);+}++.page-head .page-title {+ margin: 0;+}++.page-lede {+ font-size: var(--text-base);+ line-height: var(--leading-base);+ color: var(--text-dim);+ max-width: 60ch;+ margin-top: var(--space-1);+}++/* ---------- Inspector (trailing pane) ---------- */++.mac-inspector {+ width: var(--inspector-width);+ min-width: var(--inspector-width);+ background: var(--surface);+ overflow-y: auto;+ padding: var(--space-4);+ flex-shrink: 0;+ border-left: var(--hairline) solid var(--separator);+}++/* ---------- Command palette (Spotlight-style) ---------- */++.mac-command-backdrop {+ position: fixed;+ inset: 0;+ background: color-mix(in srgb, var(--bg) 24%, transparent);+ z-index: 200;+ display: flex;+ align-items: flex-start;+ justify-content: center;+ padding-top: 16vh;+ animation: fade-in var(--duration-fast) var(--ease-out);+}++.mac-command-palette {+ width: min(600px, calc(100vw - 48px));+ background: var(--material-thick);+ backdrop-filter: var(--material-blur);+ -webkit-backdrop-filter: var(--material-blur);+ border-radius: var(--radius-xl);+ box-shadow: var(--elev-3);+ overflow: hidden;+ animation: pop-in var(--duration-base) var(--ease-spring);+ transform-origin: top center;+}++.mac-command-input-row {+ display: flex;+ align-items: center;+ gap: var(--space-3);+ height: 52px;+ padding: 0 var(--space-4);+ border-bottom: var(--hairline) solid var(--separator);+}++.mac-command-input-row > svg {+ color: var(--text-dim);+ flex-shrink: 0;+}++.mac-command-input {+ flex: 1;+ min-width: 0;+ border: none;+ background: transparent;+ font-size: var(--text-lg);+ font-weight: 400;+ color: var(--text);+ outline: none;+}++.mac-command-input::placeholder {+ color: var(--text-dim);+}++.mac-command-input::-webkit-search-cancel-button {+ display: none;+}++.mac-command-list {+ max-height: 360px;+ overflow-y: auto;+ padding: var(--space-2);+}++.mac-command-group {+ padding: var(--space-2) var(--space-2) var(--space-1);+ font-size: var(--text-xs);+ font-weight: 600;+ color: var(--text-dim);+}++.mac-command-item {+ display: flex;+ align-items: center;+ gap: var(--space-3);+ width: 100%;+ height: 36px;+ padding: 0 var(--space-3);+ border: none;+ background: transparent;+ border-radius: var(--radius-md);+ color: var(--text);+ font-size: var(--text-base);+ text-align: left;+ cursor: pointer;+}++.mac-command-item-icon {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ width: 22px;+ height: 22px;+ border-radius: 6px;+ background: var(--fill-2);+ color: var(--text-muted);+ flex-shrink: 0;+}++.mac-command-item-label {+ flex: 1;+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}++.mac-command-item-group {+ font-size: var(--text-xs);+ color: var(--text-dim);+}++.mac-command-item.selected {+ background: var(--accent);+ color: var(--on-accent);+}++.mac-command-item.selected .mac-command-item-group,+.mac-command-item.selected .mac-command-item-icon {+ color: inherit;+ background: color-mix(in srgb, var(--on-accent) 12%, transparent);+}++.mac-command-empty {+ padding: var(--space-6) var(--space-4);+ text-align: center;+ color: var(--text-dim);+ font-size: var(--text-base);+}++.mac-command-footer {+ display: flex;+ gap: var(--space-4);+ padding: var(--space-2) var(--space-4);+ font-size: var(--text-xs);+ color: var(--text-dim);+ border-top: var(--hairline) solid var(--separator);+}++.mac-command-footer span {+ display: inline-flex;+ align-items: center;+ gap: 4px;+}++@keyframes fade-in {+ from { opacity: 0; }+ to { opacity: 1; }+}++@keyframes pop-in {+ from { opacity: 0; transform: scale(0.96) translateY(-6px); }+ to { opacity: 1; transform: scale(1) translateY(0); }+}++/* ---------- Settings shell (System Settings) ---------- */++.settings-mac {+ display: flex;+ flex-direction: column;+ flex: 1;+ min-height: 0;+ gap: 0;+}++.settings-mac-body {+ display: flex;+ flex: 1;+ min-height: 0;+ overflow: hidden;+}++.settings-mac-sidebar {+ width: 208px;+ flex-shrink: 0;+ padding: var(--space-3) var(--space-2);+ background: var(--surface-mut);+ border-right: var(--hairline) solid var(--separator);+ overflow-y: auto;+ display: flex;+ flex-direction: column;+ gap: var(--space-1);+}++.settings-mac-cat {+ display: flex;+ align-items: center;+ gap: 9px;+ width: 100%;+ text-align: left;+ height: 30px;+ padding: 0 var(--space-2);+ border: none;+ background: transparent;+ border-radius: var(--radius-sm);+ font-size: var(--text-base);+ color: var(--text);+ cursor: pointer;+ transition: background var(--duration-fast) var(--ease-out);+}++@media (hover: hover) {+ .settings-mac-cat:hover:not(.active) {+ background: var(--fill-1);+ }+}++.settings-mac-cat-icon {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ width: 26px;+ height: 26px;+ border-radius: 6px;+ background: transparent;+ color: var(--text-muted);+ flex-shrink: 0;+}++.settings-mac-cat-icon svg {+ width: 13px;+ height: 13px;+}++.settings-cat-icon-img {+ width: 24px;+ height: 24px;+ object-fit: contain;+ display: block;+ border-radius: 4px;+}++.settings-mac-cat-label {+ flex: 1;+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}++.settings-mac-cat.search-match {+ color: var(--text);+}++.settings-cat-match-count {+ flex-shrink: 0;+ min-width: 18px;+ height: 18px;+ padding: 0 5px;+ font-size: var(--text-xs);+ font-weight: 600;+ line-height: 18px;+ text-align: center;+ border-radius: 999px;+ background: var(--accent-soft);+ color: var(--accent-hi);+}++.settings-mac-cat.active {+ background: var(--accent);+ color: var(--on-accent);+ font-weight: 500;+}++.settings-mac-cat.active .settings-mac-cat-icon {+ background: transparent;+ color: inherit;+}++.settings-mac-cat:focus-visible {+ outline: var(--focus-ring);+ outline-offset: -2px;+}++.settings-mac-nav-group {+ margin-bottom: var(--space-3);+}++.settings-mac-nav-group:last-child {+ margin-bottom: 0;+}++.settings-mac-nav-group .mac-nav-section-header {+ padding-left: var(--space-2);+ padding-right: var(--space-2);+}++.settings-mac-content {+ flex: 1;+ min-width: 0;+ padding: var(--space-5) var(--space-6) var(--space-7);+ overflow-y: auto;+}++.settings-mac-content > * {+ max-width: 720px;+ margin-left: auto;+ margin-right: auto;+}++.settings-hero {+ display: flex;+ align-items: center;+ gap: var(--space-4);+ padding-bottom: var(--space-4);+ margin-bottom: var(--space-5);+ border-bottom: var(--hairline) solid var(--separator);+}++.settings-app-icon {+ width: 52px;+ height: 52px;+ border-radius: 12px;+ object-fit: contain;+ flex-shrink: 0;+}++.settings-identity {+ display: flex;+ flex-direction: column;+ gap: 2px;+ min-width: 0;+}++.settings-identity h1 {+ font-family: var(--font-display);+ font-size: var(--text-xl);+ line-height: var(--leading-xl);+ font-weight: 700;+ letter-spacing: var(--track-tight);+ margin: 0;+ color: var(--text);+}++.settings-subtitle {+ font-size: var(--text-sm);+ line-height: var(--leading-sm);+ color: var(--text-muted);+ margin: 0;+}+++/* ---------- Downloads shell ---------- */++.downloads-mac.downloads-page {+ max-width: none;+ margin: 0;+ padding: var(--space-4) var(--space-5) var(--space-6);+ gap: var(--space-3);+ flex: 1;+ min-height: 0;+ overflow-y: auto;+}++.downloads-mac .downloads-header {+ gap: var(--space-3);+}++.downloads-mac .downloads-stats {+ font-size: var(--text-sm);+ color: var(--text-dim);+ font-variant-numeric: tabular-nums;+}++.downloads-mac .filter-pills {+ width: fit-content;+ max-width: 100%;+}++.downloads-mac-empty {+ flex: 1;+ min-height: 0;+ padding: var(--space-6) var(--space-4);+ gap: var(--space-4);+}++.downloads-mac .downloads-empty {+ min-height: 0;+ flex: 1;+ padding: var(--space-6) 0;+}++.downloads-table-wrap {+ border-radius: var(--radius-lg);+ overflow: hidden;+ background: var(--surface);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+}++.downloads-table {+ width: 100%;+ border-collapse: collapse;+ font-size: var(--text-sm);+}++.downloads-table th {+ text-align: left;+ padding: var(--space-2) var(--space-3);+ font-weight: 600;+ color: var(--text-dim);+ font-size: var(--text-xs);+ border-bottom: var(--hairline) solid var(--separator);+}++.downloads-table td {+ padding: var(--space-2) var(--space-3);+ color: var(--text);+ vertical-align: middle;+ border-bottom: var(--hairline) solid var(--separator);+}++.downloads-table tr:last-child td {+ border-bottom: none;+}++@media (hover: hover) {+ .downloads-table tbody tr:hover {+ background: var(--fill-1);+ }+}++/* ---------- Home ---------- */++.home-mac {+ display: flex;+ flex-direction: column;+ gap: var(--space-3);+ width: 100%;+ flex: 1;+ min-height: 0;+ padding: var(--space-3) var(--space-5) var(--space-3);+}++.home-mac--stage {+ padding: 0;+ gap: 0;+}++.home-mac {+ position: relative;+ isolation: isolate;+ display: flex;+ flex-direction: column;+ flex: 1;+ min-height: 0;+ width: 100%;+}++.home-backdrop {+ position: absolute;+ inset: 0;+ z-index: -1;+ pointer-events: none;+ overflow: hidden;+}++.home-backdrop::before {+ content: "";+ position: absolute;+ left: 50%;+ top: clamp(28px, 17vh, 190px);+ width: min(820px, 110%);+ aspect-ratio: 1.5;+ transform: translate(-50%, -38%);+ border-radius: 50%;+ background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 17%, transparent), transparent 72%);+}++.home-backdrop::after {+ content: "";+ position: absolute;+ inset: 0;+ background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1.2px);+ background-size: 22px 22px;+ -webkit-mask-image: radial-gradient(ellipse 55% 42% at 50% 30%, #000 20%, transparent 75%);+ mask-image: radial-gradient(ellipse 55% 42% at 50% 30%, #000 20%, transparent 75%);+}++.home-stage {+ flex: 1;+ min-height: 0;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: flex-start;+ position: relative;+ padding: clamp(28px, 17vh, 190px) 20px 48px;+ overflow-x: hidden;+ overflow-y: auto;+ isolation: isolate;+}++.home-stage-inner {+ width: 100%;+ max-width: 620px;+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: var(--space-4);+}++.home-stage-hero {+ position: relative;+ isolation: isolate;+ width: 100%;+ display: flex;+ justify-content: center;+ transition: filter var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out);+}++.home-stage-hero--detecting {+ filter: blur(6px);+ opacity: 0.78;+}++/* one warm light behind the mascot — handled by home-backdrop to match OmniGet */+.home-stage-hero::before {+ display: none;+}++.home-secondary {+ display: flex;+ flex-wrap: wrap;+ justify-content: center;+ gap: var(--space-1) var(--space-2);+}++.home-secondary-link {+ display: inline-flex;+ align-items: center;+ gap: 5px;+ height: 26px;+ padding: 0 10px;+ border: none;+ background: transparent;+ color: var(--text-muted);+ font-size: var(--text-sm);+ font-weight: 500;+ border-radius: var(--radius-full);+ cursor: pointer;+ transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);+}++.home-secondary-link > svg {+ color: var(--text-dim);+ flex-shrink: 0;+}++@media (hover: hover) {+ .home-secondary-link:hover {+ color: var(--text);+ background: var(--fill-1);+ }+}++.home-secondary-link:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++.home-mac-workspace {+ display: flex;+ flex-direction: column;+ align-items: center;+ flex: 1;+ gap: 0;+ min-width: 0;+ min-height: 0;+ overflow-y: auto;+ background: transparent;+ padding: var(--space-4) var(--space-5) var(--space-3);+}++.home-mac-hero {+ flex-shrink: 0;+ width: 100%;+ max-width: 620px;+ padding: 0 0 var(--space-3);+ display: flex;+ align-items: flex-end;+ justify-content: flex-start;+ background: transparent;+ overflow: visible;+}++.home-mac-main {+ flex-shrink: 0;+ width: 100%;+ min-width: 0;+ max-width: 620px;+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: var(--space-3);+}++.home-secondary--start {+ justify-content: flex-start;+ margin-bottom: var(--space-1);+}++.stats-line {+ align-self: center;+ font-size: var(--text-sm);+ font-variant-numeric: tabular-nums;+ color: var(--text-dim);+ text-decoration: none;+ padding: 2px 10px;+ border-radius: var(--radius-full);+ transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);+}++.stats-line:hover {+ color: var(--text-muted);+ background: var(--fill-1);+}++++/* Notes surface (TipTap editor) typography. Consumes the global tokens; lives apart from app.css so the token file stays readable. */+[data-surface="notes"] {+ --font-display: var(--font-body);+ --leading-base: 1.65;+}+[data-surface="notes"] .tiptap {+ font-family: var(--font-body);+ font-size: var(--text-base);+ line-height: var(--leading-base);+ color: var(--text);+}+[data-surface="notes"] .tiptap > * + * {+ margin-top: var(--space-2);+}+[data-surface="notes"] .tiptap h1 {+ font-family: var(--font-body);+ font-size: var(--text-2xl);+ line-height: var(--leading-2xl);+ font-weight: 700;+ letter-spacing: -0.01em;+ margin-top: var(--space-5);+}+[data-surface="notes"] .tiptap h2 {+ font-family: var(--font-body);+ font-size: var(--text-xl);+ line-height: var(--leading-xl);+ font-weight: 700;+ letter-spacing: -0.01em;+ margin-top: var(--space-4);+}+[data-surface="notes"] .tiptap h3 {+ font-family: var(--font-body);+ font-size: var(--text-lg);+ line-height: var(--leading-lg);+ font-weight: 600;+ margin-top: var(--space-3);+}+[data-surface="notes"] .tiptap p {+ margin: 0;+}+[data-surface="notes"] .tiptap ul,+[data-surface="notes"] .tiptap ol {+ padding-left: var(--space-5);+ margin: 0;+}+[data-surface="notes"] .tiptap blockquote {+ border-left: 3px solid var(--accent);+ padding-left: var(--space-3);+ color: var(--secondary);+ margin: 0;+}+[data-surface="notes"] .tiptap pre {+ background: color-mix(in oklab, var(--input-border) 30%, transparent);+ border-radius: var(--border-radius);+ padding: var(--space-3);+ font-family: var(--font-mono);+ font-size: var(--text-sm);+ overflow-x: auto;+ margin: 0;+}+[data-surface="notes"] .tiptap code {+ background: color-mix(in oklab, var(--accent) 8%, transparent);+ padding: 1px calc(var(--space-1) * 1.25);+ border-radius: 4px;+ font-family: var(--font-mono);+ font-size: 0.95em;+}+[data-surface="notes"] .tiptap pre code {+ background: transparent;+ padding: 0;+ font-size: inherit;+}+[data-surface="notes"] .tiptap hr {+ border: 0;+ border-top: 1px solid var(--input-border);+ margin: var(--space-4) 0;+}+[data-surface="notes"] .tiptap ul[data-type="taskList"] {+ list-style: none;+ padding-left: 0;+}+[data-surface="notes"] .tiptap ul[data-type="taskList"] li {+ display: flex;+ gap: var(--space-2);+ align-items: baseline;+}+[data-surface="notes"] .tiptap ul[data-type="taskList"] li > label {+ flex: 0 0 auto;+}+[data-surface="notes"] .tiptap ul[data-type="taskList"] li > div {+ flex: 1 1 auto;+}+[data-surface="notes"] .tiptap:focus-visible {+ outline: none;+}+[data-surface="notes"] .tiptap p.is-editor-empty:first-child::before {+ content: attr(data-placeholder);+ color: var(--tertiary);+ pointer-events: none;+ float: left;+ height: 0;+}+[data-surface="notes"] .tiptap h4 {+ font-family: var(--font-body);+ font-size: var(--text-md);+ font-weight: 600;+ margin-top: var(--space-3);+}+[data-surface="notes"] .tiptap h5 {+ font-family: var(--font-body);+ font-size: var(--text-base);+ font-weight: 600;+ margin-top: var(--space-2);+}+[data-surface="notes"] .tiptap h6 {+ font-family: var(--font-body);+ font-size: var(--text-sm);+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.04em;+ color: var(--secondary);+ margin-top: var(--space-2);+}+[data-surface="notes"] .tiptap img {+ max-width: 100%;+ height: auto;+ border-radius: var(--border-radius);+ display: block;+}+[data-surface="notes"] .tiptap .tiptap-table {+ border-collapse: collapse;+ table-layout: fixed;+ width: 100%;+ overflow: hidden;+ margin: 0;+}+[data-surface="notes"] .tiptap .tiptap-table th,+[data-surface="notes"] .tiptap .tiptap-table td {+ border: 1px solid var(--input-border);+ padding: var(--space-2);+ vertical-align: top;+ position: relative;+ min-width: 1em;+}+[data-surface="notes"] .tiptap .tiptap-table th {+ background: color-mix(in oklab, var(--input-border) 30%, transparent);+ font-weight: 600;+ text-align: left;+}+[data-surface="notes"] .tiptap .tiptap-callout {+ display: flex;+ gap: var(--space-2);+ padding: var(--space-3);+ border-radius: var(--border-radius);+ border-left: 3px solid;+ background: color-mix(in oklab, var(--accent) 6%, transparent);+ margin: 0;+}+[data-surface="notes"] .tiptap .tiptap-callout[data-callout-kind="note"] {+ border-left-color: var(--accent);+}+[data-surface="notes"] .tiptap .tiptap-callout[data-callout-kind="tip"] {+ border-left-color: var(--success, #2ecc71);+ background: color-mix(in oklab, var(--success, #2ecc71) 8%, transparent);+}+[data-surface="notes"] .tiptap .tiptap-callout[data-callout-kind="important"] {+ border-left-color: var(--accent);+ background: color-mix(in oklab, var(--accent) 12%, transparent);+}+[data-surface="notes"] .tiptap .tiptap-callout[data-callout-kind="warning"] {+ border-left-color: var(--warning, #e67e22);+ background: color-mix(in oklab, var(--warning, #e67e22) 8%, transparent);+}+[data-surface="notes"] .tiptap .tiptap-callout[data-callout-kind="caution"] {+ border-left-color: var(--error, #e74c3c);+ background: color-mix(in oklab, var(--error, #e74c3c) 8%, transparent);+}+[data-surface="notes"] .tiptap .tiptap-callout-icon {+ flex: 0 0 auto;+ font-size: var(--text-lg);+ user-select: none;+}+[data-surface="notes"] .tiptap .tiptap-callout-body {+ flex: 1 1 auto;+ display: flex;+ flex-direction: column;+ gap: var(--space-2);+}+[data-surface="notes"] .tiptap .tiptap-callout-body > * + * {+ margin-top: var(--space-2);+}+[data-surface="notes"] .tiptap .Tiptap-mathematics-render {+ display: inline-block;+ padding: 0 var(--space-1);+}+[data-surface="notes"] .tiptap .Tiptap-mathematics-editor {+ font-family: var(--font-mono);+ font-size: var(--text-sm);+ background: color-mix(in oklab, var(--input-border) 30%, transparent);+ padding: 1px var(--space-1);+ border-radius: 3px;+}+[data-surface="notes"] .tiptap .tiptap-page-mention {+ display: inline-block;+ padding: 0 var(--space-1);+ background: color-mix(in oklab, var(--accent) 14%, transparent);+ color: var(--accent);+ border-radius: 4px;+ font-size: 0.95em;+ cursor: pointer;+ transition: background var(--duration-fast) var(--ease-out);+}+[data-surface="notes"] .tiptap .tiptap-page-mention:hover {+ background: color-mix(in oklab, var(--accent) 24%, transparent);+}+[data-surface="notes"] .tiptap .tiptap-page-mention::before {+ content: "[[";+ opacity: 0.4;+ margin-right: calc(var(--space-1) / 2);+}+[data-surface="notes"] .tiptap .tiptap-page-mention::after {+ content: "]]";+ opacity: 0.4;+ margin-left: calc(var(--space-1) / 2);+}+[data-surface="notes"] .tiptap .tiptap-tag-mention {+ display: inline-block;+ padding: 0 var(--space-1);+ background: color-mix(in oklab, var(--secondary) 14%, transparent);+ color: var(--secondary);+ border-radius: 999px;+ font-size: 0.9em;+ font-weight: 500;+ cursor: pointer;+}+[data-surface="notes"] .tiptap .tiptap-tag-mention::before {+ content: "#";+ opacity: 0.6;+ margin-right: 1px;+}+[data-surface="notes"] .tiptap .tiptap-query-block {+ margin: var(--space-2) 0;+ user-select: none;+}+[data-surface="notes"] .tiptap .tiptap-query-block.ProseMirror-selectednode {+ outline: 2px solid var(--accent);+ outline-offset: 2px;+ border-radius: var(--border-radius);+}+[data-surface="notes"] .tiptap .tiptap-embed-block {+ margin: var(--space-2) 0;+ user-select: none;+}+[data-surface="notes"] .tiptap .tiptap-embed-block.ProseMirror-selectednode {+ outline: 2px solid var(--accent);+ outline-offset: 2px;+ border-radius: var(--border-radius);+}++++/* Lao script only (unicode-range), so Latin text keeps the chosen UI font. */+@font-face {+ font-family: 'LibreGet Lao';+ font-style: normal;+ font-display: swap;+ font-weight: 100 900;+ src: url('/fonts/noto-serif-lao-lao-wght-normal.woff2') format('woff2-variations');+ unicode-range: U+0E81-0EDF, U+200C-200D, U+25CC;+}++/*+ * LibreGet design tokens — Apple-first.+ *+ * Three layers:+ * 1. Global scale (spacing, type, radius, rows, motion). Never changes per theme.+ * 2. Per-theme SOURCE tokens (~24 values). Each [data-theme] block only sets these.+ * 3. Semantic + legacy aliases derived from the sources with color-mix, defined once+ * on `:root, [data-theme]` so every theme (and any future one) gets the full set.+ *+ * Type follows the macOS text styles (SF Pro): 11 caption, 12 callout, 13 body,+ * 15 title3, 17 title2, 22 title1, 26 large title. Controls are 28pt, list rows+ * 28–40pt, sidebar rows 30pt. Radii are concentric: 12 (panes) → 8 (groups) → 6 (controls).+ */++:root {+ --space-0: 0;+ --space-1: 4px;+ --space-2: 8px;+ --space-3: 12px;+ --space-4: 16px;+ --space-5: 20px;+ --space-6: 28px;+ --space-7: 40px;+ --space-8: 56px;+ --space-9: 80px;++ --text-caption: 10px; --leading-caption: 1.3;+ --text-xs: 11px; --leading-xs: 1.4;+ --text-sm: 12px; --leading-sm: 1.45;+ --text-base: 13px; --leading-base: 1.5;+ --text-md: 15px; --leading-md: 1.4;+ --text-lg: 17px; --leading-lg: 1.35;+ --text-xl: 22px; --leading-xl: 1.25;+ --text-2xl: 26px; --leading-2xl: 1.2;+ --text-3xl: 32px; --leading-3xl: 1.12;+ --text-display: 40px; --leading-display: 1.05;++ --track-tight: -0.022em;+ --track-snug: -0.01em;+ --track-caps: 0.04em;++ --radius-xs: 4px;+ --radius-sm: 6px;+ --radius-md: 8px;+ --radius-lg: 12px;+ --radius-xl: 16px;+ --radius-2xl: 22px;+ --radius-full: 9999px;++ --control-h: 28px;+ --control-h-lg: 36px;+ --row-compact: 28px;+ --row-base: 40px;+ --hairline: 1px;++ --duration-fast: 120ms;+ --duration-base: 200ms;+ --duration-slow: 320ms;+ --duration-bounce: 440ms;+ --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);+ --ease-spring: cubic-bezier(0.32, 1.4, 0.5, 1);+ --ease-in-out: cubic-bezier(0.45, 0, 0.25, 1);++ --font-display: 'LibreGet Lao', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro', system-ui, 'Segoe UI Variable Display', 'Segoe UI', sans-serif;+ --font-body: 'LibreGet Lao', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro', system-ui, 'Segoe UI Variable Text', 'Segoe UI', sans-serif;+ --font-mono: ui-monospace, 'SF Mono', Menlo, 'Cascadia Mono', Consolas, 'DejaVu Sans Mono', monospace;+ --font-system: var(--font-body);++ /* legacy layout aliases */+ --padding: var(--space-3);+ --border-radius: var(--radius-sm);+ --bottom-nav-height: 44px;+ --mobile-nav-clearance: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + var(--padding));+ --safe-area-top: env(safe-area-inset-top, 0px);+ --safe-area-right: env(safe-area-inset-right, 0px);+ --safe-area-bottom: env(safe-area-inset-bottom, 0px);+ --safe-area-left: env(safe-area-inset-left, 0px);++ font-family: var(--font-body);+ font-size: var(--text-base);+ line-height: var(--leading-base);+ font-weight: 400;+ font-synthesis: none;+ text-rendering: optimizeLegibility;+ -webkit-font-smoothing: antialiased;+ -moz-osx-font-smoothing: grayscale;+}++[data-display],+.display {+ font-family: var(--font-display);+ letter-spacing: var(--track-snug);+}++/* ------------------------------------------------------------------ */+/* Theme sources. `dark` doubles as the fallback on :root. */+/* ------------------------------------------------------------------ */++:root, [data-theme="dark"] {+ color-scheme: dark;+ --scheme-overlay: white;+ --primary: #1C1C1E;+ --pane: #232325;+ --surface-src: #2A2A2D;+ --surface-hi-src: #38383B;+ --secondary: #F5F5F7;+ --tertiary: #98989D;+ --sidebar-bg: #212124;+ --sidebar-highlight: rgba(255, 255, 255, 0.10);+ --content-border: rgba(255, 255, 255, 0.08);+ --input-border: rgba(255, 255, 255, 0.14);+ --popup-bg: #2C2C2E;+ --dialog-backdrop: rgba(0, 0, 0, 0.5);++ --accent: #FF9F0A;+ --accent-text: #FFB340;+ --on-accent: #1E1200;+ --cta: #FF9F0A;+ --cta-hover: #FFAD2E;+ --cta-press: #F09000;+ --on-cta: #1E1200;++ --blue: #0A84FF;+ --success: #30D158;+ --error: #FF453A;+ --warning: #FFD60A;+ --on-warning: #2A2000;+ --purple: #BF5AF2;+ --teal: #40C8E0;++ --focus-ring: solid 2px color-mix(in srgb, var(--accent) 80%, white);+ --focus-ring-offset: 2px;+ --shadow-ink: 0, 0, 0;+ --elev-alpha-1: 0.35;+ --elev-alpha-2: 0.45;+ --elev-alpha-3: 0.6;+}++[data-theme="light"] {+ color-scheme: light;+ --scheme-overlay: black;+ --primary: #F3F1EC;+ --pane: #FBFAF7;+ --surface-src: #FFFFFF;+ --surface-hi-src: #F5F3EE;+ --secondary: #1D1D1F;+ --tertiary: #6E6A64;+ --sidebar-bg: #ECE9E2;+ --sidebar-highlight: rgba(0, 0, 0, 0.08);+ --content-border: rgba(0, 0, 0, 0.08);+ --input-border: rgba(0, 0, 0, 0.14);+ --popup-bg: #FFFFFF;+ --dialog-backdrop: rgba(30, 28, 25, 0.32);++ --accent: #FF9500;+ --accent-text: #B85C00;+ --on-accent: #1E1200;+ --cta: #FF9500;+ --cta-hover: #FFA424;+ --cta-press: #F08800;+ --on-cta: #1E1200;++ --blue: #007AFF;+ --success: #248A3D;+ --error: #D70015;+ --warning: #B25000;+ --on-warning: #ffffff;+ --purple: #AF52DE;+ --teal: #0891B2;++ --focus-ring: solid 2px #E07B00;+ --focus-ring-offset: 2px;+ --shadow-ink: 20, 16, 8;+ --elev-alpha-1: 0.07;+ --elev-alpha-2: 0.11;+ --elev-alpha-3: 0.2;+}++[data-theme="catppuccin-mocha"] {+ color-scheme: dark; --scheme-overlay: white;+ --primary: #1e1e2e; --pane: #24243a; --surface-src: #313244; --surface-hi-src: #45475a;+ --secondary: #cdd6f4; --tertiary: #a6adc8;+ --sidebar-bg: #181825; --sidebar-highlight: rgba(205, 214, 244, 0.12);+ --content-border: rgba(205, 214, 244, 0.08); --input-border: rgba(205, 214, 244, 0.16);+ --popup-bg: #313244; --dialog-backdrop: rgba(17, 17, 27, 0.7);+ --accent: #89b4fa; --accent-text: #89b4fa; --on-accent: #1e1e2e;+ --cta: #89b4fa; --cta-hover: #74c7ec; --cta-press: #89dceb; --on-cta: #1e1e2e;+ --blue: #89b4fa; --success: #a6e3a1; --error: #f38ba8; --warning: #f9e2af; --on-warning: #1e1e2e;+ --purple: #cba6f7; --teal: #94e2d5;+ --focus-ring: solid 2px var(--accent); --focus-ring-offset: 2px;+ --shadow-ink: 0, 0, 0; --elev-alpha-1: 0.35; --elev-alpha-2: 0.45; --elev-alpha-3: 0.6;+}++[data-theme="catppuccin-macchiato"] {+ color-scheme: dark; --scheme-overlay: white;+ --primary: #24273a; --pane: #2a2d44; --surface-src: #363a4f; --surface-hi-src: #494d64;+ --secondary: #cad3f5; --tertiary: #a5adcb;+ --sidebar-bg: #1e2030; --sidebar-highlight: rgba(202, 211, 245, 0.12);+ --content-border: rgba(202, 211, 245, 0.08); --input-border: rgba(202, 211, 245, 0.16);+ --popup-bg: #363a4f; --dialog-backdrop: rgba(24, 25, 38, 0.7);+ --accent: #8aadf4; --accent-text: #8aadf4; --on-accent: #24273a;+ --cta: #8aadf4; --cta-hover: #7dc4e4; --cta-press: #91d7e3; --on-cta: #24273a;+ --blue: #8aadf4; --success: #a6da95; --error: #ed8796; --warning: #eed49f; --on-warning: #24273a;+ --purple: #c6a0f6; --teal: #8bd5ca;+ --focus-ring: solid 2px var(--accent); --focus-ring-offset: 2px;+ --shadow-ink: 0, 0, 0; --elev-alpha-1: 0.35; --elev-alpha-2: 0.45; --elev-alpha-3: 0.6;+}++[data-theme="catppuccin-frappe"] {+ color-scheme: dark; --scheme-overlay: white;+ --primary: #303446; --pane: #373b50; --surface-src: #414559; --surface-hi-src: #51576d;+ --secondary: #c6d0f5; --tertiary: #b5bfe2;+ --sidebar-bg: #292c3c; --sidebar-highlight: rgba(198, 208, 245, 0.12);+ --content-border: rgba(198, 208, 245, 0.08); --input-border: rgba(198, 208, 245, 0.16);+ --popup-bg: #414559; --dialog-backdrop: rgba(35, 38, 52, 0.7);+ --accent: #8caaee; --accent-text: #8caaee; --on-accent: #303446;+ --cta: #8caaee; --cta-hover: #85c1dc; --cta-press: #99d1db; --on-cta: #303446;+ --blue: #8caaee; --success: #a6d189; --error: #e78284; --warning: #e5c890; --on-warning: #303446;+ --purple: #ca9ee6; --teal: #81c8be;+ --focus-ring: solid 2px var(--accent); --focus-ring-offset: 2px;+ --shadow-ink: 0, 0, 0; --elev-alpha-1: 0.35; --elev-alpha-2: 0.45; --elev-alpha-3: 0.6;+}++[data-theme="catppuccin-latte"] {+ color-scheme: light; --scheme-overlay: black;+ --primary: #e6e9ef; --pane: #eff1f5; --surface-src: #ffffff; --surface-hi-src: #eff1f5;+ --secondary: #4c4f69; --tertiary: #6c6f85;+ --sidebar-bg: #dce0e8; --sidebar-highlight: rgba(76, 79, 105, 0.12);+ --content-border: rgba(76, 79, 105, 0.10); --input-border: rgba(76, 79, 105, 0.2);+ --popup-bg: #ffffff; --dialog-backdrop: rgba(76, 79, 105, 0.3);+ --accent: #1e66f5; --accent-text: #1e66f5; --on-accent: #ffffff;+ --cta: #1e66f5; --cta-hover: #3b7cf7; --cta-press: #0f55e0; --on-cta: #ffffff;+ --blue: #1e66f5; --success: #40a02b; --error: #d20f39; --warning: #df8e1d; --on-warning: #ffffff;+ --purple: #8839ef; --teal: #179299;+ --focus-ring: solid 2px var(--accent); --focus-ring-offset: 2px;+ --shadow-ink: 40, 44, 70; --elev-alpha-1: 0.08; --elev-alpha-2: 0.12; --elev-alpha-3: 0.22;+}++[data-theme="one-dark-pro"] {+ color-scheme: dark; --scheme-overlay: white;+ --primary: #21252b; --pane: #282c34; --surface-src: #2f343e; --surface-hi-src: #3e4452;+ --secondary: #d7dce5; --tertiary: #9aa3b2;+ --sidebar-bg: #1d2025; --sidebar-highlight: rgba(171, 178, 191, 0.12);+ --content-border: rgba(171, 178, 191, 0.08); --input-border: rgba(171, 178, 191, 0.16);+ --popup-bg: #2f343e; --dialog-backdrop: rgba(0, 0, 0, 0.6);+ --accent: #61afef; --accent-text: #61afef; --on-accent: #1b1f26;+ --cta: #61afef; --cta-hover: #7abdf3; --cta-press: #4d9de0; --on-cta: #1b1f26;+ --blue: #61afef; --success: #98c379; --error: #e06c75; --warning: #e5c07b; --on-warning: #1b1f26;+ --purple: #c678dd; --teal: #56b6c2;+ --focus-ring: solid 2px var(--accent); --focus-ring-offset: 2px;+ --shadow-ink: 0, 0, 0; --elev-alpha-1: 0.35; --elev-alpha-2: 0.45; --elev-alpha-3: 0.6;+}++[data-theme="dracula"] {+ color-scheme: dark; --scheme-overlay: white;+ --primary: #1e1d29; --pane: #22212c; --surface-src: #2b2a3a; --surface-hi-src: #3a3950;+ --secondary: #f8f8f2; --tertiary: #b6b1cc;+ --sidebar-bg: #171622; --sidebar-highlight: rgba(248, 248, 242, 0.12);+ --content-border: rgba(149, 128, 255, 0.14); --input-border: rgba(248, 248, 242, 0.16);+ --popup-bg: #2b2a3a; --dialog-backdrop: rgba(11, 10, 16, 0.75);+ --accent: #9580ff; --accent-text: #aa99ff; --on-accent: #ffffff;+ --cta: #9580ff; --cta-hover: #aa99ff; --cta-press: #7a6be6; --on-cta: #ffffff;+ --blue: #80c8ff; --success: #8aff80; --error: #ff9580; --warning: #ffca80; --on-warning: #1e1d29;+ --purple: #ff80bf; --teal: #80ffea;+ --focus-ring: solid 2px var(--accent); --focus-ring-offset: 2px;+ --shadow-ink: 0, 0, 0; --elev-alpha-1: 0.4; --elev-alpha-2: 0.5; --elev-alpha-3: 0.65;+}++[data-theme="nyxvamp-veil"] {+ color-scheme: dark; --scheme-overlay: white;+ --primary: #1a1a2a; --pane: #1e1e2e; --surface-src: #2b2b3d; --surface-hi-src: #3a3a4f;+ --secondary: #d9e0ee; --tertiary: #9594ab;+ --sidebar-bg: #161624; --sidebar-highlight: rgba(217, 224, 238, 0.10);+ --content-border: rgba(217, 224, 238, 0.07); --input-border: rgba(217, 224, 238, 0.16);+ --popup-bg: #2b2b3d; --dialog-backdrop: rgba(10, 10, 20, 0.7);+ --accent: #f5c2e7; --accent-text: #f5c2e7; --on-accent: #1e1e2e;+ --cta: #f5c2e7; --cta-hover: #f8d7ed; --cta-press: #e8a8d4; --on-cta: #1e1e2e;+ --blue: #96cdfb; --success: #abe9b3; --error: #e78284; --warning: #f8bd96; --on-warning: #1e1e2e;+ --purple: #c9a8f5; --teal: #89dceb;+ --focus-ring: solid 2px var(--accent); --focus-ring-offset: 2px;+ --shadow-ink: 0, 0, 0; --elev-alpha-1: 0.4; --elev-alpha-2: 0.5; --elev-alpha-3: 0.65;+}++[data-theme="nyxvamp-obsidian"] {+ color-scheme: dark; --scheme-overlay: white;+ --primary: #000a0f; --pane: #0b1117; --surface-src: #161c22; --surface-hi-src: #222a31;+ --secondary: #c8c8d6; --tertiary: #87859b;+ --sidebar-bg: #04080c; --sidebar-highlight: rgba(192, 192, 206, 0.10);+ --content-border: rgba(192, 192, 206, 0.07); --input-border: rgba(192, 192, 206, 0.16);+ --popup-bg: #161c22; --dialog-backdrop: rgba(0, 0, 0, 0.85);+ --accent: #f5c2e7; --accent-text: #f5c2e7; --on-accent: #000a0f;+ --cta: #f5c2e7; --cta-hover: #f8d7ed; --cta-press: #e0a8d0; --on-cta: #000a0f;+ --blue: #7fafd7; --success: #8fbf8f; --error: #d78284; --warning: #d8a080; --on-warning: #000a0f;+ --purple: #b79cd8; --teal: #7cc4cf;+ --focus-ring: solid 2px var(--accent); --focus-ring-offset: 2px;+ --shadow-ink: 0, 0, 0; --elev-alpha-1: 0.5; --elev-alpha-2: 0.6; --elev-alpha-3: 0.75;+}++[data-theme="nyxvamp-radiance"] {+ color-scheme: light; --scheme-overlay: black;+ --primary: #ecebf7; --pane: #f7f7ff; --surface-src: #ffffff; --surface-hi-src: #f1eefc;+ --secondary: #1e1e2e; --tertiary: #5a5570;+ --sidebar-bg: #e3e1f2; --sidebar-highlight: rgba(30, 30, 46, 0.10);+ --content-border: rgba(30, 30, 46, 0.08); --input-border: rgba(30, 30, 46, 0.18);+ --popup-bg: #ffffff; --dialog-backdrop: rgba(90, 85, 112, 0.3);+ --accent: #9655ff; --accent-text: #6b3fc9; --on-accent: #ffffff;+ --cta: #9655ff; --cta-hover: #a56fff; --cta-press: #7f43e6; --on-cta: #ffffff;+ --blue: #5b6cff; --success: #1f7a5a; --error: #9f1239; --warning: #a35a00; --on-warning: #ffffff;+ --purple: #9655ff; --teal: #0e7490;+ --focus-ring: solid 2px var(--accent); --focus-ring-offset: 2px;+ --shadow-ink: 50, 40, 90; --elev-alpha-1: 0.08; --elev-alpha-2: 0.12; --elev-alpha-3: 0.22;+}++[data-theme="eink-day"] {+ color-scheme: light; --scheme-overlay: black;+ --primary: #ebe7dc; --pane: #f5f2ea; --surface-src: #fbf9f4; --surface-hi-src: #ebe5d7;+ --secondary: #1d1d1b; --tertiary: #5c5a56;+ --sidebar-bg: #e3ddcf; --sidebar-highlight: rgba(29, 29, 27, 0.10);+ --content-border: rgba(29, 29, 27, 0.14); --input-border: rgba(29, 29, 27, 0.26);+ --popup-bg: #f5f2ea; --dialog-backdrop: rgba(29, 29, 27, 0.35);+ --accent: #2b2b28; --accent-text: #2b2b28; --on-accent: #f5f2ea;+ --cta: #2b2b28; --cta-hover: #1d1d1b; --cta-press: #141412; --on-cta: #f5f2ea;+ --blue: #2b2b28; --success: #3d6e3d; --error: #8a2a2a; --warning: #8a5a1d; --on-warning: #f5f2ea;+ --purple: #4a3d5c; --teal: #2f5a5a;+ --focus-ring: solid 2px var(--accent); --focus-ring-offset: 2px;+ --shadow-ink: 29, 29, 27; --elev-alpha-1: 0.06; --elev-alpha-2: 0.1; --elev-alpha-3: 0.18;+}++[data-theme="eink-sepia"] {+ color-scheme: light; --scheme-overlay: black;+ --primary: #e6dcc3; --pane: #f0e6d2; --surface-src: #f7efe0; --surface-hi-src: #e6dcc3;+ --secondary: #3f2e20; --tertiary: #6e5440;+ --sidebar-bg: #dccca8; --sidebar-highlight: rgba(63, 46, 32, 0.10);+ --content-border: rgba(63, 46, 32, 0.14); --input-border: rgba(63, 46, 32, 0.26);+ --popup-bg: #f0e6d2; --dialog-backdrop: rgba(63, 46, 32, 0.35);+ --accent: #7a4a22; --accent-text: #7a4a22; --on-accent: #f0e6d2;+ --cta: #7a4a22; --cta-hover: #5b3418; --cta-press: #452710; --on-cta: #f0e6d2;+ --blue: #7a4a22; --success: #3d6e3d; --error: #8a2a2a; --warning: #8a5a1d; --on-warning: #f0e6d2;+ --purple: #5c3f4a; --teal: #3f5a4a;+ --focus-ring: solid 2px var(--accent); --focus-ring-offset: 2px;+ --shadow-ink: 63, 46, 32; --elev-alpha-1: 0.06; --elev-alpha-2: 0.1; --elev-alpha-3: 0.18;+}++[data-theme="eink-night"] {+ color-scheme: dark; --scheme-overlay: white;+ --primary: #060606; --pane: #0d0d0d; --surface-src: #161616; --surface-hi-src: #222222;+ --secondary: #d4d4d0; --tertiary: #8e8e88;+ --sidebar-bg: #0a0a0a; --sidebar-highlight: rgba(212, 212, 208, 0.10);+ --content-border: rgba(212, 212, 208, 0.10); --input-border: rgba(212, 212, 208, 0.2);+ --popup-bg: #161616; --dialog-backdrop: rgba(0, 0, 0, 0.6);+ --accent: #b0b0ab; --accent-text: #d4d4d0; --on-accent: #0a0a0a;+ --cta: #d4d4d0; --cta-hover: #c0c0bc; --cta-press: #a8a8a4; --on-cta: #0a0a0a;+ --blue: #b0b0ab; --success: #7eaa7e; --error: #c96060; --warning: #d0a060; --on-warning: #0a0a0a;+ --purple: #a898b8; --teal: #88b0b0;+ --focus-ring: solid 2px var(--accent); --focus-ring-offset: 2px;+ --shadow-ink: 0, 0, 0; --elev-alpha-1: 0.5; --elev-alpha-2: 0.6; --elev-alpha-3: 0.75;+}++/* ------------------------------------------------------------------ */+/* Semantic layer + legacy aliases (derived once, for every theme). */+/* ------------------------------------------------------------------ */++:root, [data-theme] {+ color: var(--secondary);+ background-color: var(--primary);++ /* surfaces */+ --bg: var(--primary);+ --bg-overlay: var(--scheme-overlay);+ --surface: var(--surface-src);+ --surface-hi: var(--surface-hi-src);+ --surface-mut: color-mix(in srgb, var(--surface-src) 60%, var(--pane));+ --pane-bg: var(--pane);++ /* text */+ --text: var(--secondary);+ --text-muted: color-mix(in srgb, var(--secondary) 62%, var(--tertiary));+ --text-dim: var(--tertiary);+ --text-faint: color-mix(in srgb, var(--tertiary) 55%, transparent);++ /* lines */+ --border: var(--content-border);+ --border-hi: color-mix(in srgb, var(--secondary) 16%, transparent);+ --separator: var(--content-border);++ /* fills (Apple systemFill ladder, quaternary → primary) */+ --fill-1: color-mix(in srgb, var(--secondary) 7%, transparent);+ --fill-2: color-mix(in srgb, var(--secondary) 11%, transparent);+ --fill-3: color-mix(in srgb, var(--secondary) 16%, transparent);+ --fill-4: color-mix(in srgb, var(--secondary) 24%, transparent);++ /* accent family */+ --accent-hi: var(--accent-text);+ --accent-lo: color-mix(in srgb, var(--accent) 86%, black);+ --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);+ --accent-glow: color-mix(in srgb, var(--accent) 28%, transparent);+ --selection: color-mix(in srgb, var(--accent) 22%, transparent);++ /* status */+ --info: var(--blue);+ --danger: var(--error);+ --on-status: #ffffff;+ --red: var(--error);+ --green: var(--success);+ --orange: var(--accent);+ --gray: var(--tertiary);+ --on-primary: var(--secondary);+ --on-success: #0F1A12;+ --on-error: #ffffff;++ /* controls (legacy names still consumed widely) */+ --button: var(--surface-src);+ --button-hover: var(--surface-hi-src);+ --button-press: color-mix(in srgb, var(--surface-hi-src) 80%, var(--secondary));+ --button-text: var(--secondary);+ --button-stroke: var(--content-border);+ --button-box-shadow: none;+ --button-elevated: var(--surface-hi-src);+ --button-elevated-hover: color-mix(in srgb, var(--surface-hi-src) 88%, var(--secondary));+ --button-elevated-press: color-mix(in srgb, var(--surface-hi-src) 78%, var(--secondary));+ --on-button: var(--secondary);+ --on-button-elevated: var(--secondary);+ --control-bg: color-mix(in srgb, var(--secondary) 6%, var(--pane));+ --control-bg-hover: color-mix(in srgb, var(--secondary) 9%, var(--pane));+ --input-bg: var(--control-bg);++ /* materials — glass only where it separates chrome from content */+ --material: color-mix(in srgb, var(--sidebar-bg) 74%, transparent);+ --material-thick: color-mix(in srgb, var(--popup-bg) 88%, transparent);+ --material-blur: blur(28px) saturate(1.6);++ /* elevation — only for things that float (popovers, sheets, palette) */+ --elev-0: none;+ --elev-1:+ 0 0 0 var(--hairline) var(--content-border),+ 0 1px 2px rgba(var(--shadow-ink), var(--elev-alpha-1));+ --elev-2:+ 0 0 0 var(--hairline) var(--content-border),+ 0 6px 18px rgba(var(--shadow-ink), var(--elev-alpha-2)),+ 0 1px 2px rgba(var(--shadow-ink), var(--elev-alpha-1));+ --elev-3:+ 0 0 0 var(--hairline) var(--content-border),+ 0 28px 60px rgba(var(--shadow-ink), var(--elev-alpha-3)),+ 0 6px 16px rgba(var(--shadow-ink), var(--elev-alpha-2));+ --elev-glow:+ 0 0 0 1px var(--accent),+ 0 4px 16px var(--accent-glow);+}++/* Non-macOS webviews render blur slowly and without vibrancy; use opaque chrome. */+[data-platform="other"] {+ --material: var(--sidebar-bg);+ --material-thick: var(--popup-bg);+ --material-blur: none;+}++/* ------------------------------------------------------------------ */+/* Base elements */+/* ------------------------------------------------------------------ */++*,+*::before,+*::after {+ margin: 0;+ padding: 0;+ box-sizing: border-box;+ user-select: auto;+}++* {+ scrollbar-width: thin;+ scrollbar-color: color-mix(in srgb, var(--secondary) 28%, transparent) transparent;+}++::-webkit-scrollbar {+ width: 10px;+ height: 10px;+}++::-webkit-scrollbar-track {+ background: transparent;+}++::-webkit-scrollbar-thumb {+ background: color-mix(in srgb, var(--secondary) 24%, transparent);+ border: 3px solid transparent;+ background-clip: padding-box;+ border-radius: var(--radius-full);+}++::-webkit-scrollbar-thumb:hover {+ background: color-mix(in srgb, var(--secondary) 40%, transparent);+ background-clip: padding-box;+}++::-webkit-scrollbar-corner {+ background: transparent;+}++.button, img, svg, [data-no-select] {+ user-select: none;+}++::selection {+ background: var(--selection);+ color: var(--text);+}++html, body {+ height: 100%;+}++body {+ min-height: 100vh;+ overflow: hidden;+ background-color: var(--primary);+ background-image: linear-gradient(180deg, color-mix(in srgb, var(--primary) 92%, var(--secondary)) 0%, var(--primary) 220px);+ color: var(--text);+ overscroll-behavior: none;+}++dialog {+ margin: auto;+}++h1, h2, h3, h4, h5, h6 {+ font-family: var(--font-display);+ font-weight: 600;+ margin-block: 0;+ letter-spacing: var(--track-snug);+ color: var(--text);+}++h1 { font-size: var(--text-xl); line-height: var(--leading-xl); letter-spacing: var(--track-tight); }+h2 { font-size: var(--text-lg); line-height: var(--leading-lg); }+h3 { font-size: var(--text-md); line-height: var(--leading-md); }+h4 { font-size: var(--text-base); line-height: var(--leading-base); }+h5 { font-size: var(--text-sm); line-height: var(--leading-sm); }+h6 { font-size: var(--text-xs); line-height: var(--leading-xs); }++p {+ color: inherit;+}++a {+ color: inherit;+ text-decoration: none;+}++a.link,+.link {+ color: var(--accent-hi);+ cursor: pointer;+}++@media (hover: hover) {+ a.link:hover,+ .link:hover {+ text-decoration: underline;+ text-underline-offset: 2px;+ }+}++button {+ font-family: inherit;+ font-size: inherit;+ cursor: pointer;+ border: none;+ background: none;+ color: inherit;+ -webkit-tap-highlight-color: transparent;+}++button:disabled {+ cursor: default;+}++input, textarea {+ font-family: inherit;+ font-size: inherit;+ border: none;+ outline: none;+ background: none;+ color: inherit;+ user-select: text;+}++input::placeholder,+textarea::placeholder {+ color: var(--text-dim);+}++/* Native pop-up button look for every <select> that has no class of its own. */+select {+ font-family: inherit;+ font-size: var(--text-base);+ color: var(--text);+ background-color: var(--control-bg);+ border: none;+ border-radius: var(--radius-sm);+ height: var(--control-h);+ padding: 0 26px 0 var(--space-3);+ appearance: none;+ -webkit-appearance: none;+ background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M3.5 4.75 6 2.25l2.5 2.5M3.5 7.25 6 9.75l2.5-2.5'/></svg>");+ background-repeat: no-repeat;+ background-position: right 8px center;+ background-size: 12px 12px;+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ cursor: pointer;+}++select:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++select:disabled {+ opacity: 0.5;+ cursor: default;+}++option {+ color: var(--secondary);+ background-color: var(--popup-bg);+}++img, svg {+ pointer-events: none;+}++hr {+ border: none;+ height: var(--hairline);+ background: var(--separator);+}++code, kbd, pre, samp {+ font-family: var(--font-mono);+ font-size: 0.92em;+}++strong, b {+ font-weight: 600;+}++/* ---------- Typography helpers ---------- */++.page-title {+ font-family: var(--font-display);+ font-size: var(--text-2xl);+ line-height: var(--leading-2xl);+ font-weight: 700;+ letter-spacing: var(--track-tight);+ color: var(--text);+ margin: 0 0 var(--space-4) 0;+}++.section-title {+ font-family: var(--font-display);+ font-size: var(--text-lg);+ line-height: var(--leading-lg);+ font-weight: 600;+ letter-spacing: var(--track-snug);+ color: var(--text);+ text-transform: none;+ margin: 0 0 var(--space-3) 0;+}++.eyebrow {+ font-family: var(--font-body);+ font-size: var(--text-xs);+ font-weight: 600;+ text-transform: none;+ letter-spacing: 0;+ color: var(--text-dim);+ margin-bottom: var(--space-2);+}++.numeric,+.tabular {+ font-variant-numeric: tabular-nums;+}++/* ---------- Legacy .button (still used in a few places) ---------- */++.button {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: var(--space-2);+ min-height: var(--control-h);+ padding: 0 var(--space-3);+ font-size: var(--text-base);+ font-weight: 500;+ border-radius: var(--radius-sm);+ background: var(--button);+ color: var(--button-text);+ box-shadow: inset 0 0 0 var(--hairline) var(--button-stroke);+ border: none;+ cursor: pointer;+ transition: background var(--duration-fast) var(--ease-out);+}++@media (hover: hover) {+ .button:hover {+ background: var(--button-hover);+ }+}++.button:active {+ background: var(--button-press);+}++.button:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+}++.button.elevated {+ background: var(--button-elevated);+}++@media (hover: hover) {+ .button.elevated:hover {+ background: var(--button-elevated-hover);+ }+}++.button.elevated:active {+ background: var(--button-elevated-press);+}++.button.active {+ background: var(--accent);+ color: var(--on-accent);+ box-shadow: none;+}++.button:disabled {+ cursor: default;+ opacity: 0.5;+}++/* Hide WebView2 / Edge / Chromium native video controls (we use custom UI in PlayerShell). */+video::-webkit-media-controls,+video::-webkit-media-controls-enclosure,+video::-webkit-media-controls-overlay-enclosure,+video::-webkit-media-controls-panel,+video::-webkit-media-controls-loading-panel,+video::-webkit-media-controls-overlay-play-button,+video::-webkit-media-controls-overlay-cast-button,+video::-webkit-media-controls-play-button,+video::-webkit-media-controls-pause-button,+video::-webkit-media-controls-start-playback-button,+video::-webkit-media-controls-fullscreen-button,+video::-webkit-media-controls-picture-in-picture-button,+video::-webkit-media-controls-volume-slider,+video::-webkit-media-controls-mute-button,+video::-webkit-media-controls-timeline,+video::-webkit-media-controls-current-time-display,+video::-webkit-media-controls-time-remaining-display,+video::-internal-media-controls-overlay-cast-button,+video::-internal-media-controls-button-panel-spacer {+ display: none !important;+ visibility: hidden !important;+ opacity: 0 !important;+ width: 0 !important;+ height: 0 !important;+ -webkit-appearance: none !important;+ appearance: none !important;+ pointer-events: none !important;+}++video {+ -webkit-tap-highlight-color: transparent;+ outline: none;+}++/* ------------------------------------------------------------------ */+/* Accessibility preferences (Settings → Appearance mirrors the OS) */+/* ------------------------------------------------------------------ */++[data-reduce-motion="true"] {+ --duration-fast: 0.01ms;+ --duration-base: 0.01ms;+ --duration-slow: 0.01ms;+ --duration-bounce: 0.01ms;+ --ease-spring: var(--ease-out);+}++[data-reduce-motion="true"] *,+[data-reduce-motion="true"] *::before,+[data-reduce-motion="true"] *::after {+ animation-duration: 0.01ms !important;+ animation-iteration-count: 1 !important;+ transition-duration: 0.01ms !important;+}++[data-reduce-motion="true"] .spinner,+[data-reduce-motion="true"] .update-spinner,+[data-reduce-motion="true"] .dep-spinner,+[data-reduce-motion="true"] .feedback-spinner {+ animation: reduce-motion-pulse 1.5s ease-in-out infinite !important;+}++@keyframes reduce-motion-pulse {+ 0%, 100% { opacity: 1; }+ 50% { opacity: 0.45; }+}++[data-reduce-transparency="true"] {+ --material: var(--sidebar-bg);+ --material-thick: var(--popup-bg);+ --material-blur: none;+}++@media (prefers-contrast: more) {+ :root, [data-theme] {+ --content-border: color-mix(in srgb, var(--secondary) 28%, transparent);+ --input-border: color-mix(in srgb, var(--secondary) 45%, transparent);+ --text-dim: color-mix(in srgb, var(--tertiary) 70%, var(--secondary));+ }+}++/* A window nobody is looking at should not be asking the GPU for anything.+ While the app is unfocused every decorative animation stops; the layout and+ the colours stay exactly as they are, so nothing moves when focus returns. */+[data-window-blurred] *,+[data-window-blurred] *::before,+[data-window-blurred] *::after {+ animation-play-state: paused !important;+}+++ .shell {+ display: flex;+ width: 100vw;+ height: 100vh;+ overflow: hidden;+ background: var(--bg);+ color: var(--text);+ }++ .shell-body {+ flex: 1;+ display: flex;+ flex-direction: column;+ min-width: 0;+ height: 100vh;+ overflow: hidden;+ }++ .content {+ flex: 1;+ min-height: 0;+ display: flex;+ flex-direction: column;+ }++ .core-shell {+ flex: 1;+ display: flex;+ flex-direction: column;+ min-height: 0;+ width: 100%;+ margin: 0;+ overflow-y: auto;+ overscroll-behavior-y: contain;+ transform: translateZ(0);+ will-change: scroll-position;+ }++ .core-shell--flush {+ padding: 0;+ overflow: hidden;+ }++ .global-update-banner {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: var(--space-3);+ margin-block: 0 var(--space-2);+ margin-inline: 0 var(--pane-inset);+ padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);+ background: var(--accent);+ color: var(--on-accent);+ border-radius: var(--radius-lg);+ font-size: var(--text-base);+ }++ .global-update-text {+ flex: 1;+ font-weight: 500;+ }++ .global-update-actions {+ display: flex;+ align-items: center;+ gap: var(--space-2);+ }++ .global-update-btn {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 6px;+ height: 24px;+ font-size: var(--text-sm);+ padding: 0 var(--space-3);+ border-radius: var(--radius-sm);+ background: color-mix(in srgb, var(--on-accent) 18%, transparent);+ color: var(--on-accent);+ border: none;+ font-weight: 600;+ cursor: pointer;+ }++ .global-update-btn:disabled {+ cursor: default;+ opacity: 0.7;+ }++ @media (hover: hover) {+ .global-update-btn:not(:disabled):hover {+ background: color-mix(in srgb, var(--on-accent) 26%, transparent);+ }+ }++ .global-update-btn:focus-visible {+ outline: 2px solid var(--on-accent);+ outline-offset: 2px;+ }++ .global-update-close {+ display: flex;+ align-items: center;+ justify-content: center;+ width: 24px;+ height: 24px;+ background: none;+ border: none;+ border-radius: var(--radius-sm);+ color: color-mix(in srgb, var(--on-accent) 80%, transparent);+ cursor: pointer;+ padding: 0;+ }++ @media (hover: hover) {+ .global-update-close:hover {+ background: color-mix(in srgb, var(--on-accent) 18%, transparent);+ color: var(--on-accent);+ }+ }++ .global-update-spinner {+ width: 12px;+ height: 12px;+ border: 2px solid color-mix(in srgb, var(--on-accent) 30%, transparent);+ border-top-color: var(--on-accent);+ border-radius: var(--radius-full);+ animation: spin var(--duration-slow) linear infinite;+ flex-shrink: 0;+ }++ .ytdlp-banner {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: var(--space-3);+ margin-block: 0 var(--space-2);+ margin-inline: 0 var(--pane-inset);+ padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);+ background: color-mix(in srgb, var(--warning) 16%, var(--pane-bg));+ color: var(--text);+ border-radius: var(--radius-lg);+ box-shadow: inset 0 0 0 var(--hairline) color-mix(in srgb, var(--warning) 40%, transparent);+ font-size: var(--text-base);+ }++ .ytdlp-banner-text {+ flex: 1;+ font-weight: 500;+ }++ .ytdlp-banner-actions {+ display: flex;+ align-items: center;+ gap: var(--space-2);+ }++ .ytdlp-banner-link {+ display: inline-flex;+ align-items: center;+ height: 24px;+ font-size: var(--text-sm);+ padding: 0 var(--space-3);+ border-radius: var(--radius-sm);+ background: var(--cta);+ color: var(--on-cta);+ text-decoration: none;+ font-weight: 600;+ box-shadow: none;+ }++ @media (hover: hover) {+ .ytdlp-banner-link:hover {+ background: var(--cta-hover);+ }+ }++ .ytdlp-banner-link:active {+ background: var(--cta-press);+ }++ .ytdlp-banner-link:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+ }++ .ytdlp-banner-close {+ display: flex;+ align-items: center;+ justify-content: center;+ width: 24px;+ height: 24px;+ background: none;+ border: none;+ border-radius: var(--radius-sm);+ color: var(--text-muted);+ cursor: pointer;+ padding: 0;+ }++ @media (hover: hover) {+ .ytdlp-banner-close:hover {+ background: var(--fill-2);+ color: var(--text);+ }+ }++ /* Desktop Window Wrapper */+ html, body {+ margin: 0;+ padding: 0;+ width: 100vw;+ height: 100vh;+ overflow: hidden;+ background: #111112;+ font-family: var(--font-body);+ }+ .app-window-container {+ width: 100vw;+ height: 100vh;+ display: flex;+ flex-direction: column;+ }++++ /* ==========================================================================+ AUTHENTIC LIBREGET COMPONENTS (HOME URL BAR, INSPECTOR, PREVIEW, DOWNLOADS)+ ========================================================================== */++ /* HomeUrlBar */+ .url-bar {+ position: relative;+ display: flex;+ align-items: center;+ gap: 8px;+ width: 100%;+ height: 58px;+ padding: 0 10px 0 18px;+ border-radius: 20px;+ background: var(--surface);+ box-shadow:+ inset 0 0 0 var(--hairline) var(--border-hi, var(--content-border)),+ 0 12px 32px rgba(var(--shadow-ink, 0, 0, 0), var(--elev-alpha-1, 0.2)),+ 0 2px 6px rgba(var(--shadow-ink, 0, 0, 0), calc(var(--elev-alpha-1, 0.2) * 0.6));+ transition: box-shadow var(--duration-base) var(--ease-out);+ }++ .url-bar:focus-within {+ box-shadow:+ inset 0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent),+ 0 0 0 5px var(--accent-soft),+ 0 12px 32px rgba(var(--shadow-ink, 0, 0, 0), var(--elev-alpha-1, 0.2));+ }++ .url-input {+ flex: 1;+ min-width: 0;+ height: 100%;+ border: none;+ background: transparent;+ color: var(--text);+ font: inherit;+ font-size: 16px;+ letter-spacing: -0.01em;+ outline: none;+ }++ .url-input::placeholder {+ color: var(--text-dim);+ }++ .clear-btn {+ display: grid;+ place-items: center;+ width: 28px;+ height: 28px;+ border: none;+ border-radius: 50%;+ background: transparent;+ color: var(--text-faint);+ cursor: pointer;+ }++ .clear-btn:hover {+ color: var(--text-muted);+ }++ .go-btn {+ display: grid;+ place-items: center;+ width: 40px;+ height: 40px;+ flex-shrink: 0;+ border: none;+ border-radius: 50%;+ background: var(--cta);+ color: var(--on-cta);+ cursor: pointer;+ box-shadow: 0 4px 14px var(--accent-glow, rgba(255, 159, 10, 0.4));+ transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);+ }++ .go-btn:hover {+ background: var(--cta-hover);+ }++ .go-btn:active {+ background: var(--cta-press);+ transform: scale(0.95);+ }++ .paste-btn {+ display: inline-flex;+ align-items: center;+ gap: 8px;+ height: 36px;+ padding: 0 8px 0 14px;+ flex-shrink: 0;+ border: none;+ border-radius: 999px;+ background: var(--fill-1);+ color: var(--text);+ font: inherit;+ font-size: var(--text-sm);+ font-weight: 600;+ cursor: pointer;+ transition: background var(--duration-fast) var(--ease-out);+ }++ .paste-btn:hover {+ background: var(--fill-2);+ }++ .paste-btn kbd {+ font: inherit;+ font-size: 11px;+ font-weight: 600;+ padding: 2px 6px;+ border-radius: 6px;+ background: var(--surface);+ color: var(--text-dim);+ box-shadow: inset 0 0 0 var(--hairline) var(--border, rgba(255,255,255,0.1));+ }++ .more-trigger {+ display: grid;+ place-items: center;+ width: 36px;+ height: 36px;+ border: none;+ border-radius: 50%;+ background: transparent;+ color: var(--text-muted);+ cursor: pointer;+ transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);+ }++ .more-trigger:hover {+ background: var(--fill-2);+ color: var(--text);+ }++ /* Feedback & Notices */+ .feedback {+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 6px;+ min-height: 20px;+ padding: 0 var(--space-1);+ color: var(--text-muted);+ width: 100%;+ }++ .feedback-text {+ font-size: var(--text-sm);+ font-weight: 500;+ }++ .feedback-enter {+ animation: feedbackEnter var(--duration-base) var(--ease-out);+ }++ @keyframes feedbackEnter {+ from { opacity: 0; transform: translateY(-3px); }+ to { opacity: 1; transform: translateY(0); }+ }++ .added-notice {+ gap: var(--space-2);+ font-size: var(--text-sm);+ padding: var(--space-2) var(--space-3);+ background: var(--surface-mut);+ border-radius: var(--radius-md);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ }++ .added-notice-title {+ font-weight: 600;+ color: var(--text);+ }++ .added-notice-link {+ background: none;+ border: none;+ padding: 0;+ font: inherit;+ font-size: var(--text-sm);+ font-weight: 600;+ color: var(--accent-hi);+ cursor: pointer;+ }++ .added-notice-link:hover {+ text-decoration: underline;+ text-underline-offset: 2px;+ }++ /* HomeInspector & MediaPreview */+ .home-panel {+ width: 100%;+ background: var(--surface);+ border-radius: var(--radius-lg);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ padding: var(--space-4);+ animation: panel-in var(--duration-slow) var(--ease-spring);+ transform-origin: top center;+ }++ .home-panel-body {+ display: flex;+ flex-direction: column;+ gap: var(--space-3);+ }++ @keyframes panel-in {+ from { opacity: 0; transform: translateY(-6px) scale(0.99); }+ to { opacity: 1; transform: translateY(0) scale(1); }+ }++ .preview-container {+ display: flex;+ gap: var(--space-3);+ align-items: center;+ padding: 0;+ width: 100%;+ }++ .preview-thumbnail-wrapper {+ position: relative;+ flex-shrink: 0;+ border-radius: var(--radius-md);+ overflow: hidden;+ width: 64px;+ height: 64px;+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ background: var(--fill-2);+ }++ .preview-thumbnail {+ width: 100%;+ height: 100%;+ object-fit: cover;+ display: block;+ }++ .preview-info {+ flex: 1;+ min-width: 0;+ display: flex;+ flex-direction: column;+ gap: 3px;+ }++ .preview-title {+ font-size: var(--text-md);+ font-weight: 600;+ color: var(--text);+ margin: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }++ .preview-author {+ font-size: var(--text-sm);+ color: var(--text-dim);+ margin: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }++ /* Primary Action Button */+ .download-primary-btn {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: var(--space-2);+ background: var(--cta);+ color: var(--on-cta);+ font-size: var(--text-md);+ font-weight: 600;+ letter-spacing: var(--track-snug);+ height: 42px;+ padding: 0 var(--space-4);+ border-radius: var(--radius-md);+ border: none;+ cursor: pointer;+ width: 100%;+ box-shadow: inset 0 0 0 var(--hairline) color-mix(in srgb, var(--on-cta) 12%, transparent);+ transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);+ }++ .download-primary-btn:hover:not(:disabled) {+ background: var(--cta-hover);+ }++ .download-primary-btn:active:not(:disabled) {+ background: var(--cta-press);+ transform: scale(0.99);+ }++ /* Downloads List & Item */+ .download-list {+ display: flex;+ flex-direction: column;+ gap: var(--space-3);+ width: 100%;+ }++ .download-item {+ display: block;+ padding: var(--space-3);+ background: var(--surface);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ border-radius: var(--radius-lg);+ transition: background var(--duration-fast) var(--ease-out);+ }++ .download-item:hover {+ background: var(--surface-hi, var(--surface));+ }++ .item-row {+ display: flex;+ align-items: flex-start;+ gap: var(--space-3);+ min-width: 0;+ }++ .item-poster {+ width: 64px;+ height: 64px;+ border-radius: var(--radius-md);+ object-fit: cover;+ flex-shrink: 0;+ background: var(--fill-2);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ }++ .item-body {+ flex: 1;+ min-width: 0;+ display: flex;+ flex-direction: column;+ gap: 6px;+ }++ .item-header {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: var(--space-3);+ min-height: 26px;+ }++ .item-header-left {+ display: flex;+ align-items: center;+ gap: var(--space-2);+ min-width: 0;+ flex: 1;+ }++ .item-name {+ font-size: var(--text-base);+ font-weight: 600;+ color: var(--text);+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }++ .item-header-actions {+ display: flex;+ align-items: center;+ gap: 4px;+ flex-shrink: 0;+ }++ .action-icon-btn {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ width: 26px;+ height: 26px;+ border: none;+ border-radius: var(--radius-sm);+ background: transparent;+ color: var(--text-muted);+ cursor: pointer;+ padding: 0;+ transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);+ }++ .action-icon-btn:hover {+ background: var(--fill-2);+ color: var(--text);+ }++ .item-status {+ display: inline-flex;+ align-items: center;+ height: 20px;+ padding: 0 8px;+ border-radius: var(--radius-full);+ font-size: var(--text-xs);+ font-weight: 600;+ text-transform: capitalize;+ letter-spacing: 0.02em;+ background: var(--accent-soft);+ color: var(--accent-hi);+ }++ .item-meta {+ display: flex;+ align-items: center;+ flex-wrap: wrap;+ gap: 6px;+ font-size: var(--text-sm);+ color: var(--text-dim);+ }++ .meta-text {+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }++ .meta-author {+ color: var(--text-muted);+ }++ .meta-sep {+ color: var(--text-faint);+ }++ .item-stats {+ display: flex;+ align-items: center;+ gap: 6px;+ font-size: var(--text-sm);+ color: var(--text-dim);+ }++ .stat-speed {+ color: var(--text);+ font-weight: 500;+ }++ .eta-pill {+ padding: 1px 6px;+ border-radius: 4px;+ background: var(--fill-2);+ font-size: 11px;+ font-weight: 500;+ color: var(--text-muted);+ }++ .progress-row {+ display: flex;+ align-items: center;+ gap: var(--space-3);+ width: 100%;+ margin-top: 2px;+ }++ .progress-track {+ flex: 1;+ height: 6px;+ border-radius: var(--radius-full);+ background: var(--fill-2);+ overflow: hidden;+ }++ .progress-fill {+ height: 100%;+ border-radius: var(--radius-full);+ background: var(--accent);+ transition: width 0.3s ease-out;+ }++ .progress-pct {+ font-size: var(--text-sm);+ color: var(--text-dim);+ font-variant-numeric: tabular-nums;+ min-width: 36px;+ text-align: right;+ }++ /* Log Viewer Console */+ .download-log {+ display: flex;+ flex-direction: column;+ gap: 6px;+ margin-top: 6px;+ width: 100%;+ }++ .log-toggle {+ display: inline-flex;+ align-items: center;+ gap: 4px;+ height: 22px;+ padding: 0 8px;+ margin-left: -4px;+ background: transparent;+ border: none;+ border-radius: var(--radius-xs);+ color: var(--text-dim);+ font-size: var(--text-xs);+ font-weight: 500;+ cursor: pointer;+ align-self: flex-start;+ transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);+ }++ .log-toggle:hover {+ background: var(--fill-2);+ color: var(--text);+ }++ .log-panel {+ border-radius: var(--radius-md);+ background: var(--popup-bg, #111116);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ overflow: hidden;+ animation: panel-in 140ms ease-out;+ }++ .log-header {+ display: flex;+ align-items: center;+ justify-content: space-between;+ padding: 6px 12px;+ border-bottom: 1px solid var(--separator, rgba(255,255,255,0.06));+ font-size: 11px;+ color: var(--text-dim);+ }++ .log-copy {+ background: none;+ border: none;+ padding: 0;+ font: inherit;+ font-size: 11px;+ font-weight: 500;+ color: var(--accent-hi);+ cursor: pointer;+ }++ .log-copy:hover {+ text-decoration: underline;+ }++ .demo-log-pre {+ margin: 0;+ padding: 10px 12px;+ font-family: var(--font-mono, monospace);+ font-size: 11.5px;+ line-height: 1.5;+ color: var(--text-muted);+ max-height: 180px;+ overflow-y: auto;+ white-space: pre-wrap;+ word-break: break-all;+ }++ /* Sample Link Chips */+++++++ /* More Menu Popover */+ .more-menu {+ position: absolute;+ top: calc(100% + 8px);+ left: 0;+ z-index: 50;+ min-width: 200px;+ padding: 6px;+ background: var(--surface);+ border-radius: var(--radius-md);+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 0 var(--hairline) var(--content-border);+ display: flex;+ flex-direction: column;+ gap: 2px;+ animation: panel-in 140ms var(--ease-out);+ }++ .more-item {+ display: flex;+ align-items: center;+ gap: 10px;+ width: 100%;+ height: 32px;+ padding: 0 10px;+ border: none;+ border-radius: var(--radius-sm);+ background: transparent;+ color: var(--text);+ font: inherit;+ font-size: var(--text-sm);+ font-weight: 500;+ text-align: left;+ cursor: pointer;+ transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);+ }++ .more-item:hover {+ background: var(--fill-2);+ color: var(--text);+ }++ .more-item svg {+ color: var(--text-muted);+ flex-shrink: 0;+ }++ .more-divider {+ height: 1px;+ margin: 4px 6px;+ background: var(--separator, rgba(255, 255, 255, 0.08));+ }++ .toast-notice {+ position: fixed;+ bottom: 24px;+ left: 50%;+ transform: translateX(-50%);+ background: var(--surface);+ color: var(--text);+ padding: 10px 20px;+ border-radius: var(--radius-full);+ box-shadow: 0 8px 24px rgba(0,0,0,0.4), inset 0 0 0 var(--hairline) var(--accent);+ font-size: var(--text-sm);+ font-weight: 600;+ z-index: 10000;+ display: flex;+ align-items: center;+ gap: 8px;+ animation: toastIn 180ms var(--ease-out);+ }++ @keyframes toastIn {+ from { opacity: 0; transform: translate(-50%, 10px); }+ to { opacity: 1; transform: translate(-50%, 0); }+ }++ </style>+</head>+<body>++++ <div class="app-window-container">+ <div class="shell">++ <!-- Actual LibreGet Left Sidebar -->+ <aside class="mac-source-list" aria-label="Sidebar">+ <div class="mac-source-list-drag" data-tauri-drag-region></div>++ <!-- Core Navigation -->+ <nav class="mac-nav-section" role="navigation" aria-label="Core Navigation">+ <a href="#home" class="mac-nav-item" id="nav-item-home" onclick="navToHome(); return false;">+ <span class="nav-penguin" style="--icon-size: 26px;">+ <img src="../../static/icons/nav/home-32.png" width="26" height="26" class="nav-penguin-img" alt="" />+ </span>+ <span class="mac-nav-label">Home</span>+ </a>+ <a href="#downloads" class="mac-nav-item" id="nav-item-downloads" onclick="navToDownloads(); return false;">+ <span class="nav-penguin" style="--icon-size: 26px;">+ <img src="../../static/icons/nav/downloads-32.png" width="26" height="26" class="nav-penguin-img" alt="" />+ </span>+ <span class="mac-nav-label">Downloads</span>+ <span class="mac-nav-badge live" id="sidebar-downloads-badge" style="display: none;">1</span>+ </a>+ <a href="#tools" class="mac-nav-item" onclick="return false;">+ <span class="nav-penguin" style="--icon-size: 26px;">+ <img src="../../static/icons/nav/tools-32.png" width="26" height="26" class="nav-penguin-img" alt="" />+ </span>+ <span class="mac-nav-label">Tools</span>+ </a>+ <a href="#nami" class="mac-nav-item active" id="nav-item-nami" onclick="navToNami(); return false;">+ <span class="nav-penguin" style="--icon-size: 26px;">+ <img src="../../static/icons/nav/nami-32.png" width="26" height="26" class="nav-penguin-img" alt="" />+ </span>+ <span class="mac-nav-label">Nami</span>+ </a>+ </nav>++ <!-- App Navigation (Standard LibreGet Flow: Directly below Core) -->+ <nav class="mac-nav-section" role="navigation" aria-label="Application">+ <div class="mac-nav-section-header">+ <span>App</span>+ </div>+ <a href="#marketplace" class="mac-nav-item" onclick="return false;">+ <span class="nav-penguin" style="--icon-size: 26px;">+ <img src="../../static/icons/nav/marketplace-32.png" width="26" height="26" class="nav-penguin-img" alt="" />+ </span>+ <span class="mac-nav-label">Marketplace</span>+ </a>+ <a href="#settings" class="mac-nav-item" onclick="return false;">+ <span class="nav-penguin" style="--icon-size: 26px;">+ <img src="../../static/icons/nav/settings-32.png" width="26" height="26" class="nav-penguin-img" alt="" />+ </span>+ <span class="mac-nav-label">Settings</span>+ </a>+ </nav>++ <!-- Plugins Navigation -->+ <nav class="mac-nav-section" role="navigation" aria-label="Plugins">+ <div class="mac-nav-section-header">+ <span>Plugins</span>+ </div>+ <a href="#courses" class="mac-nav-item" onclick="return false;">+ <span class="nav-penguin" style="--icon-size: 26px;">+ <img src="../../static/icons/nav/courses-32.png" width="26" height="26" class="nav-penguin-img" alt="" />+ </span>+ <span class="mac-nav-label">Courses</span>+ </a>+ <a href="#convert" class="mac-nav-item" onclick="return false;">+ <span class="nav-penguin" style="--icon-size: 26px;">+ <img src="../../static/icons/nav/convert-32.png" width="26" height="26" class="nav-penguin-img" alt="" />+ </span>+ <span class="mac-nav-label">Convert</span>+ </a>+ <a href="#telegram" class="mac-nav-item" onclick="return false;">+ <span class="nav-penguin" style="--icon-size: 26px;">+ <img src="../../static/icons/nav/telegram-32.png" width="26" height="26" class="nav-penguin-img" alt="" />+ </span>+ <span class="mac-nav-label">Telegram</span>+ </a>+ </nav>+ </aside>++ <!-- Shell Body -->+ <div class="shell-body">++ <!-- Window Titlebar -->+ <header class="mac-titlebar" data-tauri-drag-region>+ <div class="mac-titlebar-leading" data-tauri-drag-region>+ <span class="mac-titlebar-title mac-titlebar-title--quiet" id="window-titlebar-title"></span>+ </div>+ <div class="mac-titlebar-center">+ <div class="segmented" id="nami-titlebar-tabs" role="tablist">+ <button type="button" class="segmented-btn active" id="subtab-btn-home" onclick="switchNamiSubTab('home')">Home</button>+ <button type="button" class="segmented-btn" id="subtab-btn-profiles" onclick="switchNamiSubTab('profiles')">Profiles</button>+ <button type="button" class="segmented-btn" id="subtab-btn-history" onclick="switchNamiSubTab('history')">History</button>+ <button type="button" class="segmented-btn" id="subtab-btn-settings" onclick="switchNamiSubTab('settings')">Settings</button>+ </div>+ </div>+ <div class="mac-titlebar-actions">+ <button type="button" class="mac-search-field">+ <svg class="mac-search-glyph" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>+ <span class="mac-search-label">Search</span>+ <span class="kbd">⌘K</span>+ </button>+ </div>+ </header>++ <!-- Main Content Area: .mac-pane -->+ <main id="main-content" class="content">+ <div class="mac-pane">+ <div class="mac-pane-scroll core-shell">++ <!-- ========================================================================= -->+ <!-- VIEW 1: NAMI CORE VIEW -->+ <!-- ========================================================================= -->+ <div class="page" id="view-nami" style="max-width: 780px;">++++ <!-- ================= NAMI TAB: HOME ================= -->+ <section id="nami-panel-home" style="display: flex; flex-direction: column; gap: var(--space-4); align-items: center;">++ <!-- Centered Nami Mascot Logo (Like LibreGet Home Screen) -->+ <div class="home-stage-hero" style="display: flex; justify-content: center; margin-top: var(--space-4); margin-bottom: var(--space-2);">+ <img+ src="../../static/icons/nav/nami.svg"+ width="96"+ height="96"+ alt="Nami Logo"+ style="object-fit: contain; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));"+ />+ </div>++ <!-- EXACT LibreGet HomeUrlBar -->+ <div class="url-bar" id="nami-url-bar">+++ <!-- URL Input Field -->+ <input+ id="nami-url-input"+ class="url-input"+ type="text"+ placeholder="Paste creator profile or media URL..."+ autocomplete="off"+ spellcheck="false"+ oninput="handleUrlInput(this.value)"+ onkeydown="if(event.key==='Enter') inspectUrl(this.value)"+ />++ <!-- Clear Button (x) -->+ <button+ type="button"+ class="clear-btn"+ id="nami-clear-btn"+ style="display: none;"+ onclick="clearUrlBar()"+ title="Clear"+ >+ <svg viewBox="0 0 16 16" width="14" height="14" fill="currentColor">+ <path d="M8 1.4a6.6 6.6 0 1 0 0 13.2A6.6 6.6 0 0 0 8 1.4zm2.35 3.5a.75.75 0 0 1 1.06 1.06L9.06 8l2.35 2.35a.75.75 0 1 1-1.06 1.06L8 9.06 5.65 11.4a.75.75 0 1 1-1.06-1.06L6.94 8 4.6 5.65A.75.75 0 0 1 5.65 4.6L8 6.94l2.35-2.04z" />+ </svg>+ </button>++ <!-- Circular Orange Submit Button (↓) -->+ <button+ type="button"+ class="go-btn"+ id="nami-submit-btn"+ style="display: none;"+ onclick="inspectCurrentUrl()"+ title="Inspect"+ >+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round">+ <path d="M12 5v14M6 13l6 6 6-6" />+ </svg>+ </button>++ <!-- Paste Button -->+ <button+ type="button"+ class="paste-btn"+ id="nami-paste-btn"+ onclick="triggerPasteSample()"+ >+ <span>Paste</span>+ <kbd>Ctrl+V</kbd>+ </button>+ </div>++ <!-- Platform Detected Feedback Line -->+ <div class="feedback feedback-enter" id="nami-detection-feedback" style="display: none;" data-supported="true">+ <span class="feedback-text" id="nami-detection-text">Instagram detected</span>+ </div>++ <!-- Added to Downloads Feedback Notice -->+ <div class="feedback feedback-enter added-notice" id="nami-added-notice" style="display: none;">+ <strong class="added-notice-title">Added to downloads</strong>+ <button type="button" class="added-notice-link" onclick="navToDownloads()">+ Open Downloads →+ </button>+ </div>++ <!-- EXACT LibreGet HomeInspector Preview Panel -->+ <section class="home-panel" id="nami-inspector-panel" style="display: none;" aria-label="Creator preview">+ <div class="home-panel-body">++ <!-- MediaPreview Row -->+ <div class="preview-container">+ <div class="preview-thumbnail-wrapper">+ <img+ id="inspector-avatar-img"+ class="preview-thumbnail"+ src="https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=160&auto=format&fit=crop&q=80"+ alt="Creator Avatar"+ />+ </div>+ <div class="preview-info">+ <p class="preview-title" id="inspector-name">National Geographic</p>+ <p class="preview-author" id="inspector-meta">@natgeo • Instagram • 283M followers • 28.4K posts</p>+ </div>+ <button+ type="button"+ class="btn btn-sm btn-secondary"+ id="inspector-save-btn"+ style="flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; font-weight: 500; font-size: var(--text-xs); border-radius: var(--radius-sm);"+ onclick="toggleSaveFromInspector()"+ title="Save Profile"+ >+ <svg id="inspector-save-icon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">+ <path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/>+ </svg>+ <span id="inspector-save-text">Save</span>+ </button>+ </div>++ <!-- Category Selector -->+ <div style="display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-1);">+ <span style="font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim);">Category</span>+ <div class="segmented" id="scope-selector">+ <button type="button" class="segmented-btn active" onclick="setScope(this, 'All Posts')">All Posts</button>+ <button type="button" class="segmented-btn" onclick="setScope(this, 'Photos')">Photos</button>+ <button type="button" class="segmented-btn" onclick="setScope(this, 'Videos')">Videos</button>+ <button type="button" class="segmented-btn" onclick="setScope(this, 'Stories')">Stories</button>+ <button type="button" class="segmented-btn" onclick="setScope(this, 'Highlights')">Highlights</button>+ </div>+ </div>++ <!-- Action Button: Download -->+ <div style="margin-top: var(--space-2); width: 100%;">+ <button+ type="button"+ class="download-primary-btn"+ id="start-archive-btn"+ style="width: 100%;"+ onclick="executeDownload()"+ >+ Download+ </button>+ </div>++ </div>+ </section>++ </section>++ <!-- ================= NAMI TAB: PROFILES ================= -->+ <section id="nami-panel-profiles" style="display: none; flex-direction: column; gap: var(--space-4);">+ <div style="display: flex; align-items: center; justify-content: space-between;">+ <span class="group-label" style="margin: 0;">Saved Profile</span>+ </div>++ <div class="group" id="saved-profiles-list">+ <!-- Instagram Profile -->+ <div class="list-row interactive" data-platform="instagram" onclick="loadSavedProfile('https://instagram.com/natgeo')">+ <img src="https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=64&auto=format&fit=crop&q=80" style="width: 34px; height: 34px; border-radius: var(--radius-sm); object-fit: cover;" alt="" />+ <span class="list-row-content">+ <span class="list-row-title">National Geographic (@natgeo)</span>+ <span class="list-row-sub">https://instagram.com/natgeo • Instagram • 38 items</span>+ </span>+ <span class="list-row-trailing">+ <button type="button" class="btn btn-sm btn-secondary" onclick="event.stopPropagation(); loadSavedProfile('https://instagram.com/natgeo');">Download</button>+ <button type="button" class="btn btn-sm btn-ghost" title="Remove Profile" onclick="event.stopPropagation(); deleteProfileRow(this, 'National Geographic');">+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>+ </button>+ </span>+ </div>++ <!-- TikTok Profile -->+ <div class="list-row interactive" data-platform="tiktok" onclick="loadSavedProfile('https://www.tiktok.com/@khaby.lame')">+ <img src="https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=64&auto=format&fit=crop&q=80" style="width: 34px; height: 34px; border-radius: var(--radius-sm); object-fit: cover;" alt="" />+ <span class="list-row-content">+ <span class="list-row-title">Khaby Lame (@khaby.lame)</span>+ <span class="list-row-sub">https://www.tiktok.com/@khaby.lame • TikTok • 112 items</span>+ </span>+ <span class="list-row-trailing">+ <button type="button" class="btn btn-sm btn-secondary" onclick="event.stopPropagation(); loadSavedProfile('https://www.tiktok.com/@khaby.lame');">Download</button>+ <button type="button" class="btn btn-sm btn-ghost" title="Remove Profile" onclick="event.stopPropagation(); deleteProfileRow(this, 'Khaby Lame');">+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>+ </button>+ </span>+ </div>++ <!-- Facebook Profile -->+ <div class="list-row interactive" data-platform="facebook" onclick="loadSavedProfile('https://facebook.com/natgeowild')">+ <img src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=64&auto=format&fit=crop&q=80" style="width: 34px; height: 34px; border-radius: var(--radius-sm); object-fit: cover;" alt="" />+ <span class="list-row-content">+ <span class="list-row-title">NatGeo Wild (@natgeowild)</span>+ <span class="list-row-sub">https://facebook.com/natgeowild • Facebook • 45 items</span>+ </span>+ <span class="list-row-trailing">+ <button type="button" class="btn btn-sm btn-secondary" onclick="event.stopPropagation(); loadSavedProfile('https://facebook.com/natgeowild');">Download</button>+ <button type="button" class="btn btn-sm btn-ghost" title="Remove Profile" onclick="event.stopPropagation(); deleteProfileRow(this, 'NatGeo Wild');">+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>+ </button>+ </span>+ </div>++ <!-- X (Twitter) Profile -->+ <div class="list-row interactive" data-platform="x" onclick="loadSavedProfile('https://x.com/OpenAI')">+ <img src="https://images.unsplash.com/photo-1614680376593-902f749f7ffc?w=64&auto=format&fit=crop&q=80" style="width: 34px; height: 34px; border-radius: var(--radius-sm); object-fit: cover;" alt="" />+ <span class="list-row-content">+ <span class="list-row-title">OpenAI (@OpenAI)</span>+ <span class="list-row-sub">https://x.com/OpenAI • X • 84 items</span>+ </span>+ <span class="list-row-trailing">+ <button type="button" class="btn btn-sm btn-secondary" onclick="event.stopPropagation(); loadSavedProfile('https://x.com/OpenAI');">Download</button>+ <button type="button" class="btn btn-sm btn-ghost" title="Remove Profile" onclick="event.stopPropagation(); deleteProfileRow(this, 'OpenAI');">+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>+ </button>+ </span>+ </div>+ </div>+ </section>++ <!-- ================= NAMI TAB: HISTORY ================= -->+ <section id="nami-panel-history" style="display: none; flex-direction: column; gap: var(--space-4);">+ <div style="display: flex; align-items: center; justify-content: space-between;">+ <span class="group-label" style="margin: 0;">Downloaded Media</span>+ <button type="button" class="btn btn-sm btn-ghost" onclick="showToastNotice('History synchronized with disk')">Refresh</button>+ </div>+ <div class="group" id="downloaded-media-list">+ <div class="list-row">+ <span class="list-row-content">+ <span class="list-row-title">natgeo_20261120_post_321894.jpg</span>+ <span class="list-row-sub">Instagram Photo • 2.4 MB • Today 02:40</span>+ </span>+ <span class="list-row-trailing">+ <button type="button" class="btn btn-sm btn-secondary" onclick="openMediaFile('natgeo_20261120_post_321894.jpg')">Open</button>+ <button type="button" class="btn btn-sm btn-ghost" onclick="showToastNotice('Folder opened: /home/igect/Downloads/Nami/natgeo')">Folder</button>+ </span>+ </div>+ <div class="list-row">+ <span class="list-row-content">+ <span class="list-row-title">khaby_tiktok_72849182.mp4</span>+ <span class="list-row-sub">TikTok Video • 14.8 MB • Yesterday 18:22</span>+ </span>+ <span class="list-row-trailing">+ <button type="button" class="btn btn-sm btn-secondary" onclick="openMediaFile('khaby_tiktok_72849182.mp4')">Open</button>+ <button type="button" class="btn btn-sm btn-ghost" onclick="showToastNotice('Folder opened: /home/igect/Downloads/Nami/khaby.lame')">Folder</button>+ </span>+ </div>+ <div class="list-row">+ <span class="list-row-content">+ <span class="list-row-title">openai_gpt4o_showcase.mp4</span>+ <span class="list-row-sub">X Video • 32.1 MB • Nov 19, 2026</span>+ </span>+ <span class="list-row-trailing">+ <button type="button" class="btn btn-sm btn-secondary" onclick="openMediaFile('openai_gpt4o_showcase.mp4')">Open</button>+ <button type="button" class="btn btn-sm btn-ghost" onclick="showToastNotice('Folder opened: /home/igect/Downloads/Nami/OpenAI')">Folder</button>+ </span>+ </div>+ <div class="list-row">+ <span class="list-row-content">+ <span class="list-row-title">cristiano_workout_reel.mp4</span>+ <span class="list-row-sub">Instagram Reel • 18.5 MB • Nov 18, 2026</span>+ </span>+ <span class="list-row-trailing">+ <button type="button" class="btn btn-sm btn-secondary" onclick="openMediaFile('cristiano_workout_reel.mp4')">Open</button>+ <button type="button" class="btn btn-sm btn-ghost" onclick="showToastNotice('Folder opened: /home/igect/Downloads/Nami/cristiano')">Folder</button>+ </span>+ </div>+ <div class="list-row">+ <span class="list-row-content">+ <span class="list-row-title">natgeo_serengeti_story_02.jpg</span>+ <span class="list-row-sub">Instagram Story • 1.8 MB • Nov 18, 2026</span>+ </span>+ <span class="list-row-trailing">+ <button type="button" class="btn btn-sm btn-secondary" onclick="openMediaFile('natgeo_serengeti_story_02.jpg')">Open</button>+ <button type="button" class="btn btn-sm btn-ghost" onclick="showToastNotice('Folder opened: /home/igect/Downloads/Nami/natgeo')">Folder</button>+ </span>+ </div>+ </div>+ </section>++ <!-- ================= NAMI TAB: SETTINGS ================= -->+ <section id="nami-panel-settings" style="display: none; flex-direction: column; gap: var(--space-4);">+ <div class="card" style="padding: 0 var(--space-3);">+ <div class="setting-row">+ <div class="setting-col">+ <span class="setting-label">Save Directory</span>+ <span class="setting-desc" id="setting-save-dir">/home/igect/Downloads/Nami</span>+ </div>+ <div class="setting-control">+ <button type="button" class="btn btn-secondary" onclick="browseSaveDir()">Browse...</button>+ </div>+ </div>+ <div class="setting-row">+ <div class="setting-col">+ <span class="setting-label">Session Cookies Bridge</span>+ <span class="setting-desc">Import active session cookies for private profiles and stories</span>+ </div>+ <div class="setting-control">+ <button type="button" class="btn btn-secondary" onclick="showToastNotice('Session cookies bridge connected!')">Configure</button>+ </div>+ </div>+ </div>+ </section>++ </div>+++ <!-- ========================================================================= -->+ <!-- VIEW 2: LIBREGET DOWNLOADS VIEW -->+ <!-- ========================================================================= -->+ <div class="page" id="view-downloads" style="display: none; max-width: 780px;">++ <!-- Page Header: Title, Description, and Downloads Filter Tabs -->+ <header class="page-head">+ <div>+ <h1 class="page-title" style="font-size: var(--text-2xl); font-weight: 700;">Downloads</h1>+ <p class="page-lede" style="margin-top: 2px;">Active and completed tasks</p>+ </div>++ <!-- Standard LibreGet Segmented Switcher -->+ <div class="segmented" role="tablist">+ <button type="button" class="segmented-btn active" id="dl-tab-all">All (<span id="dl-count-badge">1</span>)</button>+ <button type="button" class="segmented-btn" id="dl-tab-active">Active (1)</button>+ <button type="button" class="segmented-btn" id="dl-tab-completed">Completed (0)</button>+ </div>+ </header>++ <div class="download-list">++ <!-- Download Item Card (Exact LibreGet Download Item) -->+ <div class="download-item" id="active-download-card">+ <div class="item-row">++ <!-- Creator Avatar Poster -->+ <img+ id="dl-item-poster"+ class="item-poster"+ src="https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=160&auto=format&fit=crop&q=80"+ alt=""+ />++ <!-- Body -->+ <div class="item-body">++ <!-- Header: Name & Actions -->+ <div class="item-header">+ <div class="item-header-left">+ <span class="item-name" id="dl-item-title">National Geographic (@natgeo) - Instagram Profile Archive</span>+ </div>+ <div class="item-header-actions">+ <!-- Pause -->+ <button type="button" class="action-icon-btn" title="Pause" onclick="togglePauseDownload(this)">+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <rect x="6" y="4" width="4" height="16" />+ <rect x="14" y="4" width="4" height="16" />+ </svg>+ </button>+ <!-- Cancel -->+ <button type="button" class="action-icon-btn" title="Cancel" onclick="cancelDownload()">+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M18 6L6 18M6 6l12 12" />+ </svg>+ </button>+ <!-- Status Pill -->+ <span class="item-status" id="dl-item-status-pill">Archiving</span>+ </div>+ </div>++ <!-- Meta Row -->+ <div class="item-meta">+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect>+ <path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path>+ <line x1="17.5" y1="6.5" x2="17.51" y2="6.5"></line>+ </svg>+ <span class="meta-text" id="dl-item-platform-label">Instagram</span>+ <span class="meta-sep">·</span>+ <span class="meta-text meta-author" id="dl-item-author-label">@natgeo</span>+ <span class="meta-sep">·</span>+ <span class="quality-chip" id="dl-item-scope-chip">All Posts</span>+ <span class="meta-sep">·</span>+ <span class="meta-text" id="dl-item-size-est">≈ 1.4 GB</span>+ </div>++ <!-- Transfer Stats -->+ <div class="item-stats" id="dl-item-stats-row">+ <span id="dl-item-bytes-label">420 MB / 1.4 GB</span>+ <span class="meta-sep">·</span>+ <span class="stat-speed" id="dl-item-speed-label">8.4 MB/s</span>+ <span class="meta-sep">·</span>+ <span class="eta-pill" id="dl-item-eta-label">ETA 1m 58s</span>+ </div>++ <!-- Progress Bar Row -->+ <div class="progress-row">+ <div class="progress-track">+ <div class="progress-fill" id="dl-item-progress-fill" style="width: 30%;"></div>+ </div>+ <span class="progress-pct" id="dl-item-progress-pct">30%</span>+ </div>++ <!-- Download Logs -->+ <div class="download-log">+ <button type="button" class="log-toggle" onclick="toggleLogs()">+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" />+ <polyline points="14 2 14 8 20 8" />+ <line x1="8" y1="13" x2="16" y2="13" />+ <line x1="8" y1="17" x2="14" y2="17" />+ </svg>+ <span id="log-toggle-label">Show logs</span>+ </button>++ <div class="log-panel" id="dl-log-panel" style="display: none;">+ <div class="log-header">+ <span class="log-count">8 lines</span>+ <button type="button" class="log-copy" onclick="copyLogLines()">Copy</button>+ </div>+ <pre class="demo-log-pre" id="dl-log-pre">[instagram] natgeo: Downloading user profile metadata+[instagram] natgeo: Scanning posts (28,410 total found)+[instagram] natgeo: Archiving batch 1 (posts 1 to 50)+[instagram] natgeo: Downloading media 32189481928491_01.jpg (1080x1350)+[download] Destination: /home/igect/Downloads/Nami/natgeo/20261120_32189481928491_01.jpg+[download] 100% of 2.41MiB in 00:00:00 at 8.42MiB/s+[instagram] natgeo: Downloading media 32189481928492_01.mp4 (1080p)+[download] 38.4% of 14.8MiB at 8.40MiB/s ETA 00:01</pre>+ </div>+ </div>++ </div>++ </div>+ </div>++ </div>++ </div>++ </div>+ </div>+ </main>++ </div>++ </div>+ </div>++ <script>+ // State store+ let currentCreator = {+ platform: "instagram",+ platformName: "Instagram",+ name: "National Geographic",+ handle: "@natgeo",+ meta: "@natgeo • Instagram • 283M followers • 28.4K posts",+ avatar: "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=160&auto=format&fit=crop&q=80",+ scope: "All Posts",+ url: "https://instagram.com/natgeo"+ };++ let selectedScope = "All Posts";+ let isDownloading = false;+ let progressTimer = null;+ let currentProgress = 30;++ // Navigation handlers+ function navToNami() {+ document.getElementById('view-nami').style.display = 'block';+ document.getElementById('view-downloads').style.display = 'none';+ document.getElementById('nav-item-nami').classList.add('active');+ document.getElementById('nav-item-downloads').classList.remove('active');+ document.getElementById('window-titlebar-title').textContent = '';+ const tabs = document.getElementById('nami-titlebar-tabs');+ if (tabs) tabs.style.display = 'inline-flex';+ }++ function navToDownloads() {+ document.getElementById('view-nami').style.display = 'none';+ document.getElementById('view-downloads').style.display = 'block';+ document.getElementById('nav-item-nami').classList.remove('active');+ document.getElementById('nav-item-downloads').classList.add('active');+ document.getElementById('window-titlebar-title').textContent = 'Downloads';+ const tabs = document.getElementById('nami-titlebar-tabs');+ if (tabs) tabs.style.display = 'none';+ }++ function navToHome() {+ navToNami();+ }++ // Sub-tab switcher inside Nami+ function switchNamiSubTab(tabName) {+ ['home', 'profiles', 'history', 'settings'].forEach(function(t) {+ var btn = document.getElementById('subtab-btn-' + t);+ var panel = document.getElementById('nami-panel-' + t);+ if (btn && panel) {+ if (t === tabName) {+ btn.classList.add('active');+ panel.style.display = 'flex';+ } else {+ btn.classList.remove('active');+ panel.style.display = 'none';+ }+ }+ });+ }++ // Toggle More Options / Save Menu+ function toggleMoreMenu(e) {+ if (e) e.stopPropagation();+ const menu = document.getElementById('home-more-menu');+ if (menu.style.display === 'none' || menu.style.display === '') {+ menu.style.display = 'flex';+ } else {+ menu.style.display = 'none';+ }+ }++ // Close menu when clicking outside+ document.addEventListener('click', function(e) {+ const menu = document.getElementById('home-more-menu');+ const btn = document.getElementById('nami-more-btn');+ if (menu && menu.style.display !== 'none' && !menu.contains(e.target) && e.target !== btn && !btn.contains(e.target)) {+ menu.style.display = 'none';+ }+ });++ // Save current profile to Saved Profile list++ // Platform profile filtering+ function filterPlatformProfiles(platform, btn) {+ const buttons = document.querySelectorAll('#profile-platform-segmented .segmented-btn');+ buttons.forEach(b => b.classList.remove('active'));+ if (btn) btn.classList.add('active');++ const rows = document.querySelectorAll('#saved-profiles-list .list-row');+ rows.forEach(row => {+ if (platform === 'all' || row.getAttribute('data-platform') === platform) {+ row.style.display = 'flex';+ } else {+ row.style.display = 'none';+ }+ });+ }++ // Delete profile row+ function isProfileSaved(url) {+ const list = document.getElementById('saved-profiles-list');+ if (!list || !url) return false;+ let found = false;+ list.querySelectorAll('.list-row').forEach(row => {+ if (row.getAttribute('onclick') && row.getAttribute('onclick').includes(url)) {+ found = true;+ }+ });+ return found;+ }++ function updateInspectorSaveButtonState() {+ const btn = document.getElementById('inspector-save-btn');+ const icon = document.getElementById('inspector-save-icon');+ const text = document.getElementById('inspector-save-text');+ if (!btn || !currentCreator) return;++ const saved = isProfileSaved(currentCreator.url);+ if (saved) {+ btn.style.background = 'var(--accent-soft)';+ btn.style.color = 'var(--accent-hi)';+ btn.style.borderColor = 'var(--accent)';+ icon.setAttribute('fill', 'currentColor');+ text.textContent = 'Saved';+ } else {+ btn.style.background = '';+ btn.style.color = '';+ btn.style.borderColor = '';+ icon.setAttribute('fill', 'none');+ text.textContent = 'Save';+ }+ }++ function toggleSaveFromInspector() {+ if (isProfileSaved(currentCreator.url)) {+ const list = document.getElementById('saved-profiles-list');+ list.querySelectorAll('.list-row').forEach(row => {+ if (row.getAttribute('onclick') && row.getAttribute('onclick').includes(currentCreator.url)) {+ row.remove();+ }+ });+ updateInspectorSaveButtonState();+ showToastNotice("Removed " + currentCreator.name + " from Saved Profile");+ } else {+ saveCurrentProfile();+ }+ }++ // Delete profile row+ function deleteProfileRow(btn, profileName) {+ const row = btn.closest('.list-row');+ if (row) {+ row.style.transition = 'opacity 0.2s ease, transform 0.2s ease';+ row.style.opacity = '0';+ row.style.transform = 'translateY(-4px)';+ setTimeout(() => {+ row.remove();+ updateInspectorSaveButtonState();+ showToastNotice("Removed " + profileName + " from Saved Profile");+ }, 200);+ }+ }++ function saveCurrentProfile() {+ const menu = document.getElementById('home-more-menu');+ if (menu) menu.style.display = 'none';++ const list = document.getElementById('saved-profiles-list');+ const plat = (currentCreator.platform === 'twitter' || currentCreator.platform === 'x') ? 'x' : currentCreator.platform;++ // Check if already in list+ if (!isProfileSaved(currentCreator.url)) {+ const row = document.createElement('div');+ row.className = 'list-row interactive';+ row.setAttribute('data-platform', plat);+ row.setAttribute('onclick', "loadSavedProfile('" + currentCreator.url + "')");+ row.innerHTML = `+ <img src="${currentCreator.avatar}" style="width: 34px; height: 34px; border-radius: var(--radius-sm); object-fit: cover;" alt="" />+ <span class="list-row-content">+ <span class="list-row-title">${currentCreator.name} (${currentCreator.handle})</span>+ <span class="list-row-sub">${currentCreator.url} • ${currentCreator.platformName} • Saved</span>+ </span>+ <span class="list-row-trailing">+ <button type="button" class="btn btn-sm btn-secondary" onclick="event.stopPropagation(); loadSavedProfile('${currentCreator.url}');">Download</button>+ <button type="button" class="btn btn-sm btn-ghost" title="Remove Profile" onclick="event.stopPropagation(); deleteProfileRow(this, '${currentCreator.name.replace(/'/g, "\'")}');">+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>+ </button>+ </span>+ `;+ list.prepend(row);+ }++ updateInspectorSaveButtonState();+ showToastNotice("Profile saved to Saved Profile: " + currentCreator.name);+ }++ function loadSavedProfile(url) {+ switchNamiSubTab('home');+ applyCreatorUrl(url);+ }++ function openMediaFile(filename) {+ showToastNotice("Opening media: " + filename);+ // Item remains completely intact in the list!+ }++ function browseSaveDir() {+ const newPath = prompt("Enter save directory:", document.getElementById('setting-save-dir').textContent);+ if (newPath) {+ document.getElementById('setting-save-dir').textContent = newPath;+ showToastNotice("Save directory updated!");+ }+ }++ function toggleSyncInterval(btn) {+ if (btn.textContent === 'Every 24 Hours') {+ btn.textContent = 'Every 6 Hours';+ } else if (btn.textContent === 'Every 6 Hours') {+ btn.textContent = 'Manual';+ } else {+ btn.textContent = 'Every 24 Hours';+ }+ showToastNotice("Sync schedule set to " + btn.textContent);+ }++ // Toast notification utility+ function showToastNotice(msg) {+ let toast = document.getElementById('app-live-toast');+ if (!toast) {+ toast = document.createElement('div');+ toast.id = 'app-live-toast';+ toast.className = 'toast-notice';+ document.body.appendChild(toast);+ }+ toast.textContent = msg;+ toast.style.display = 'flex';+ if (window.toastTimer) clearTimeout(window.toastTimer);+ window.toastTimer = setTimeout(function() {+ toast.style.display = 'none';+ }, 2500);+ }++ // Input handlers+ function handleUrlInput(val) {+ const trimmed = val.trim();+ const clearBtn = document.getElementById('nami-clear-btn');+ const submitBtn = document.getElementById('nami-submit-btn');+ const pasteBtn = document.getElementById('nami-paste-btn');++ if (trimmed.length > 0) {+ clearBtn.style.display = 'grid';+ submitBtn.style.display = 'grid';+ pasteBtn.style.display = 'none';+ } else {+ clearBtn.style.display = 'none';+ submitBtn.style.display = 'none';+ pasteBtn.style.display = 'inline-flex';+ hideInspector();+ }++ if (trimmed.includes('instagram.com') || trimmed.includes('tiktok.com') || trimmed.includes('facebook.com') || trimmed.includes('twitter.com') || trimmed.includes('x.com')) {+ inspectUrl(trimmed);+ }+ }++ function clearUrlBar() {+ const input = document.getElementById('nami-url-input');+ input.value = '';+ handleUrlInput('');+ input.focus();+ }++ async function triggerPasteSample() {+ try {+ const text = await navigator.clipboard.readText();+ if (text && text.trim().length > 0) {+ const input = document.getElementById('nami-url-input');+ input.value = text.trim();+ handleUrlInput(input.value);+ return;+ }+ } catch (e) {+ // Fallback if browser clipboard permission prompt is dismissed+ }+ // Demo default paste:+ applyCreatorUrl('https://instagram.com/natgeo');+ }++ function applyCreatorUrl(url) {+ const input = document.getElementById('nami-url-input');+ input.value = url;+ handleUrlInput(url);+ inspectUrl(url);+ }++ function applySample(type) {+ if (type === 'instagram') {+ currentCreator = {+ platform: "instagram",+ platformName: "Instagram",+ name: "National Geographic",+ handle: "@natgeo",+ meta: "@natgeo • Instagram • 283M followers • 28.4K posts",+ avatar: "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=160&auto=format&fit=crop&q=80",+ scope: selectedScope,+ url: "https://instagram.com/natgeo"+ };+ } else if (type === 'tiktok') {+ currentCreator = {+ platform: "tiktok",+ platformName: "TikTok",+ name: "Khaby Lame",+ handle: "@khaby.lame",+ meta: "@khaby.lame • TikTok • 162M followers • 1.2K videos",+ avatar: "https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=160&auto=format&fit=crop&q=80",+ scope: selectedScope,+ url: "https://tiktok.com/@khaby.lame"+ };+ } else if (type === 'twitter') {+ currentCreator = {+ platform: "twitter",+ platformName: "X (Twitter)",+ name: "OpenAI",+ handle: "@OpenAI",+ meta: "@OpenAI • X • 3.2M followers • 1.4K media posts",+ avatar: "https://images.unsplash.com/photo-1614680376593-902f749f7ffc?w=160&auto=format&fit=crop&q=80",+ scope: selectedScope,+ url: "https://x.com/OpenAI"+ };+ }++ const input = document.getElementById('nami-url-input');+ input.value = currentCreator.url;+ handleUrlInput(input.value);+ inspectUrl(currentCreator.url);+ }++ function inspectCurrentUrl() {+ const input = document.getElementById('nami-url-input');+ if (input.value.trim()) {+ inspectUrl(input.value.trim());+ }+ }++ function inspectUrl(url) {+ const lower = url.toLowerCase();+ if (lower.includes('facebook.com')) {+ const match = url.match(/facebook\.com\/([a-zA-Z0-9._]+)/);+ const handle = match ? '@' + match[1] : '@creator';+ currentCreator = {+ platform: 'facebook',+ platformName: 'Facebook',+ name: match ? match[1] : 'Creator',+ handle: handle,+ meta: handle + ' • Facebook • 12M followers',+ avatar: 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=160&auto=format&fit=crop&q=80',+ scope: selectedScope,+ url: url+ };+ } else if (lower.includes('tiktok.com')) {+ const match = url.match(/@([a-zA-Z0-9._]+)/);+ const handle = match ? '@' + match[1] : '@creator';+ currentCreator = {+ platform: 'tiktok',+ platformName: 'TikTok',+ name: match ? match[1] : 'Creator',+ handle: handle,+ meta: handle + ' • TikTok • 162M followers • 1.2K videos',+ avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=160&auto=format&fit=crop&q=80',+ scope: selectedScope,+ url: url+ };+ } else if (lower.includes('twitter.com') || lower.includes('x.com')) {+ const match = url.match(/(?:x|twitter)\.com\/([a-zA-Z0-9._]+)/);+ const handle = match ? '@' + match[1] : '@creator';+ currentCreator = {+ platform: 'x',+ platformName: 'X (Twitter)',+ name: match ? match[1] : 'Creator',+ handle: handle,+ meta: handle + ' • X • 3.2M followers • 1.4K media posts',+ avatar: 'https://images.unsplash.com/photo-1614680376593-902f749f7ffc?w=160&auto=format&fit=crop&q=80',+ scope: selectedScope,+ url: url+ };+ } else if (lower.includes('instagram.com')) {+ const match = url.match(/instagram\.com\/([a-zA-Z0-9._]+)/);+ const handle = match ? '@' + match[1] : '@creator';+ currentCreator = {+ platform: 'instagram',+ platformName: 'Instagram',+ name: match ? match[1] : 'Creator',+ handle: handle,+ meta: handle + ' • Instagram • 283M followers • 28.4K posts',+ avatar: 'https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=160&auto=format&fit=crop&q=80',+ scope: selectedScope,+ url: url+ };+ }+ // Platform detection line+ const detectionRow = document.getElementById('nami-detection-feedback');+ const detectionText = document.getElementById('nami-detection-text');+ detectionText.textContent = currentCreator.platformName + " detected";+ detectionRow.style.display = 'flex';++ // Hide any previous added notice+ document.getElementById('nami-added-notice').style.display = 'none';++ // Update Inspector UI+ document.getElementById('inspector-avatar-img').src = currentCreator.avatar;+ document.getElementById('inspector-name').textContent = currentCreator.name;+ document.getElementById('inspector-meta').textContent = currentCreator.meta;++ // Reveal Inspector+ document.getElementById('nami-inspector-panel').style.display = 'block';+ updateInspectorSaveButtonState();++ }++ function hideInspector() {+ document.getElementById('nami-detection-feedback').style.display = 'none';+ document.getElementById('nami-inspector-panel').style.display = 'none';+ }++ function setScope(el, scope) {+ selectedScope = scope;+ currentCreator.scope = scope;+ const buttons = document.querySelectorAll('#scope-selector .segmented-btn');+ buttons.forEach(function(b) { b.classList.remove('active'); });+ el.classList.add('active');+ }++ // Execute Download (Hands off to Downloads section)+ function executeDownload() {+ // 1. Collapse inspector and clear URL bar+ hideInspector();+ clearUrlBar();++ // 2. Show authentic LibreGet Added Notice+ const addedNotice = document.getElementById('nami-added-notice');+ addedNotice.style.display = 'flex';++ // 3. Update sidebar badge+ const badge = document.getElementById('sidebar-downloads-badge');+ badge.textContent = '1';+ badge.style.display = 'inline-block';++ // 4. Update the downloads card to reflect what was selected+ document.getElementById('dl-item-poster').src = currentCreator.avatar;+ document.getElementById('dl-item-title').textContent = currentCreator.name + " (" + currentCreator.handle + ") - " + currentCreator.platformName + " Profile Archive";+ document.getElementById('dl-item-platform-label').textContent = currentCreator.platformName;+ document.getElementById('dl-item-author-label').textContent = currentCreator.handle;+ document.getElementById('dl-item-scope-chip').textContent = selectedScope;++ // Reset progress+ currentProgress = 15;+ updateProgressUI(currentProgress);++ // Start simulated download progression+ if (progressTimer) clearInterval(progressTimer);+ progressTimer = setInterval(function() {+ if (currentProgress < 95) {+ currentProgress += Math.floor(Math.random() * 4) + 1;+ updateProgressUI(currentProgress);+ }+ }, 1200);+ }++ function updateProgressUI(pct) {+ document.getElementById('dl-item-progress-fill').style.width = pct + '%';+ document.getElementById('dl-item-progress-pct').textContent = pct + '%';+ const downloadedMb = Math.round((pct / 100) * 1400);+ document.getElementById('dl-item-bytes-label').textContent = downloadedMb + " MB / 1.4 GB";+ }++ // Toggle pause / cancel+ function togglePauseDownload(btn) {+ const statusPill = document.getElementById('dl-item-status-pill');+ if (statusPill.textContent === 'Archiving') {+ statusPill.textContent = 'Paused';+ statusPill.style.background = 'var(--fill-2)';+ statusPill.style.color = 'var(--text-dim)';+ if (progressTimer) clearInterval(progressTimer);+ } else {+ statusPill.textContent = 'Archiving';+ statusPill.style.background = 'var(--accent-soft)';+ statusPill.style.color = 'var(--accent-hi)';+ progressTimer = setInterval(function() {+ if (currentProgress < 95) {+ currentProgress += 2;+ updateProgressUI(currentProgress);+ }+ }, 1200);+ }+ }++ function cancelDownload() {+ if (confirm('Cancel this archiving task?')) {+ if (progressTimer) clearInterval(progressTimer);+ document.getElementById('active-download-card').style.display = 'none';+ document.getElementById('sidebar-downloads-badge').style.display = 'none';+ document.getElementById('dl-count-badge').textContent = '0';+ }+ }++ // Toggle Log Console+ function toggleLogs() {+ const panel = document.getElementById('dl-log-panel');+ const label = document.getElementById('log-toggle-label');+ if (panel.style.display === 'none') {+ panel.style.display = 'block';+ label.textContent = 'Hide logs';+ } else {+ panel.style.display = 'none';+ label.textContent = 'Show logs';+ }+ }++ function copyLogLines() {+ const text = document.getElementById('dl-log-pre').textContent;+ navigator.clipboard.writeText(text).then(function() {+ alert('Logs copied to clipboard!');+ }).catch(function() {+ alert('Copied logs!');+ });+ }++ // Run on startup+ if (document.readyState === 'loading') {+ document.addEventListener('DOMContentLoaded', function() { applySample('instagram'); });+ } else {+ applySample('instagram');+ }+ </script>+</body>+</html>diff --git a/package.json b/package.jsonindex 566b8495..1c93327f 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "libreget",- "version": "0.16.10",+ "version": "1.0.0","private": true,"description": "","type": "module",@@ -41,11 +41,11 @@"@tauri-apps/api": "^2.12.4","@tauri-apps/plugin-clipboard-manager": "^2.5.0","@tauri-apps/plugin-dialog": "^2.8.4",- "@tauri-apps/plugin-notification": "~2.3.3",+ "@tauri-apps/plugin-notification": "~2.8.0","@tauri-apps/plugin-opener": "^2","@tauri-apps/plugin-process": "^2.4.0","@tauri-apps/plugin-shell": "~2.3.5",- "@tauri-apps/plugin-updater": "~2.10.0",+ "@tauri-apps/plugin-updater": "~2.14.1","@tiptap/core": "^3.31.4","@tiptap/extension-bubble-menu": "^3.31.4","@tiptap/extension-code-block-lowlight": "^3.31.4",@@ -61,7 +61,7 @@"@tiptap/extension-task-item": "^3.32.2","@tiptap/extension-task-list": "^3.32.2","@tiptap/pm": "^3.31.4",- "@tiptap/starter-kit": "^3.32.2",+ "@tiptap/starter-kit": "^3.33.0","@tiptap/suggestion": "^3.31.4","@types/cytoscape": "^3.31.0","abcjs": "^6.7.2",@@ -72,15 +72,15 @@"katex": "^0.19.1","lowlight": "^3.3.0","marked": "^14.1.3",- "markmap-lib": "^0.18.12",- "markmap-view": "^0.18.12",+ "markmap-lib": "^0.18.13",+ "markmap-view": "^0.18.13","mermaid": "^11.17.2","sveltekit-i18n": "^2.4.2","tiptap-markdown": "^0.9.0","vidstack": "^1.15.7"},"devDependencies": {- "@sveltejs/adapter-static": "^3.0.6",+ "@sveltejs/adapter-static": "^3.0.11","@sveltejs/kit": "^2.9.0","@sveltejs/vite-plugin-svelte": "^5.0.0","@tauri-apps/cli": "^2.12.4",@@ -88,7 +88,7 @@"@types/marked": "^6.0.0","@types/node": "^26.6.6","lintapple": "^0.1.24",- "playwright": "^1.64.1",+ "playwright": "^1.65.0","svelte": "^5.57.3","svelte-check": "^4.0.0","typescript": "~5.9.3",diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 1801381f..f44f2eb7 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -47,8 +47,8 @@ importers:specifier: ^2.8.4version: 2.8.4'@tauri-apps/plugin-notification':- specifier: ~2.3.3- version: 2.3.3+ specifier: ~2.8.0+ version: 2.8.1'@tauri-apps/plugin-opener':specifier: ^2version: 2.5.3@@ -59,8 +59,8 @@ importers:specifier: ~2.3.5version: 2.3.6'@tauri-apps/plugin-updater':- specifier: ~2.10.0- version: 2.10.1+ specifier: ~2.14.1+ version: 2.14.1'@tiptap/core':specifier: ^3.31.4version: 3.31.4(@tiptap/[email protected])@@ -69,7 +69,7 @@ importers:'@tiptap/extension-code-block-lowlight':specifier: ^3.31.4- version: 3.31.4(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))(@tiptap/[email protected])([email protected])([email protected])+ version: 3.31.4(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))(@tiptap/[email protected])([email protected])([email protected])'@tiptap/extension-drag-handle':specifier: ^3.31.4version: 3.31.4(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))@@ -99,16 +99,16 @@ importers:version: 3.31.4(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))'@tiptap/extension-task-item':specifier: ^3.32.2- version: 3.32.2(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))+ version: 3.32.2(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))'@tiptap/extension-task-list':specifier: ^3.32.2- version: 3.32.2(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))+ version: 3.32.2(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))'@tiptap/pm':specifier: ^3.31.4version: 3.31.4'@tiptap/starter-kit':- specifier: ^3.32.2- version: 3.32.2+ specifier: ^3.33.0+ version: 3.35.0'@tiptap/suggestion':specifier: ^3.31.4version: 3.31.4(@floating-ui/[email protected])(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])@@ -140,11 +140,11 @@ importers:specifier: ^14.1.3version: 14.1.4markmap-lib:- specifier: ^0.18.12- version: 0.18.12([email protected])+ specifier: ^0.18.13+ version: 0.18.13([email protected])markmap-view:- specifier: ^0.18.12- version: 0.18.12([email protected])+ specifier: ^0.18.13+ version: 0.18.13([email protected])mermaid:specifier: ^11.17.2version: 11.17.2@@ -159,8 +159,8 @@ importers:version: 1.15.7devDependencies:'@sveltejs/adapter-static':- specifier: ^3.0.6- version: 3.0.10(@sveltejs/[email protected](@sveltejs/[email protected]([email protected])([email protected](@types/[email protected])([email protected])))([email protected])([email protected])([email protected](@types/[email protected])([email protected])))+ specifier: ^3.0.11+ version: 3.0.11(@sveltejs/[email protected](@sveltejs/[email protected]([email protected])([email protected](@types/[email protected])([email protected])))([email protected])([email protected])([email protected](@types/[email protected])([email protected])))'@sveltejs/kit':specifier: ^2.9.0version: 2.51.0(@sveltejs/[email protected]([email protected])([email protected](@types/[email protected])([email protected])))([email protected])([email protected])([email protected](@types/[email protected])([email protected]))@@ -183,8 +183,8 @@ importers:specifier: ^0.1.24version: 0.1.24playwright:- specifier: ^1.64.1- version: 1.64.1+ specifier: ^1.65.0+ version: 1.65.1svelte:specifier: ^5.57.3version: 5.57.3@@ -216,10 +216,6 @@ packages:resolution: {integrity: sha512-NpugTzbKgGrNe45Ui32cN8vCFFMxVtP/9rtfwv0nP5FRDAjvYBxJcLVpYA9mr1jxP6cnIT7x9LUzuDTbWYYNRA==}engines: {node: '>=6.9.0'}- '@babel/[email protected]':- resolution: {integrity: sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==}- engines: {node: '>=6.9.0'}-'@braintree/[email protected]':resolution: {integrity: sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==}@@ -621,8 +617,8 @@ packages:peerDependencies:acorn: ^8.9.0- '@sveltejs/[email protected]':- resolution: {integrity: sha512-7D9lYFWJmB7zxZyTE/qxjksvMqzMuYrrsyh1f4AlZqeZeACPRySjbC3aFiY55wb1tWUaKOQG9PVbm74JcN2Iew==}+ '@sveltejs/[email protected]':+ resolution: {integrity: sha512-DyX1bWx9uiPxzq7Mr+jnxqY+w3UhE3pYy5D1LcfdS++2KZTHSZBD60BoP44LjVgtGILfeOQCF8ESqzmLVrz4Ng==}peerDependencies:'@sveltejs/kit': ^2.0.0@@ -846,8 +842,8 @@ packages:'@tauri-apps/[email protected]':resolution: {integrity: sha512-+6ZOiXenOaxXwb8qCbBPdT2jX2cFPaVVHGIskrpmJLpmWj+qKRTD6X/z9x7hTdSQn7NedcoXCkWGej4a7dC4lw==}- '@tauri-apps/[email protected]':- resolution: {integrity: sha512-Zw+ZH18RJb41G4NrfHgIuofJiymusqN+q8fGUIIV7vyCH+5sSn5coqRv/MWB9qETsUs97vmU045q7OyseCV3Qg==}+ '@tauri-apps/[email protected]':+ resolution: {integrity: sha512-B+OCJv17XCFQxAhe2+fn2bHqQ1fz/hGnYHeT++yv8+q0daOH5o1ghX7MmxWgoGFp7POaNn4UMONclHeZn65mJA==}'@tauri-apps/[email protected]':resolution: {integrity: sha512-CCcUltXMOfUEArbf3db3kCE7Ggy1ExBEBl51Ko2ODJ6GDYHRp1nSNlQm5uNCFY5k7/ufaK5Ib3Du/Zir19IYQQ==}@@ -858,29 +854,29 @@ packages:'@tauri-apps/[email protected]':resolution: {integrity: sha512-C2AG+QmBJPK0E3gccLXfRdjTfGBC9DgwzGi/PfYa61ieAZbYvhvOss4OdSGfn/D28N3THGhJZEhf3lozOh/Uqw==}- '@tauri-apps/[email protected]':- resolution: {integrity: sha512-NFYMg+tWOZPJdzE/PpFj2qfqwAWwNS3kXrb1tm1gnBJ9mYzZ4WDRrwy8udzWoAnfGCHLuePNLY1WVCNHnh3eRA==}+ '@tauri-apps/[email protected]':+ resolution: {integrity: sha512-Hr7nlBm1wT6xbwzjZ/S36YULazu8MNlj5vvOwMl47fXI7HTa5Bjl1PbDEwVHaZTAKzE1VZsUy35UqnbrQxmYQw==}'@tiptap/[email protected]':resolution: {integrity: sha512-cIVUQYBycighzsk6GbmCef8ZiEDVxoT5EuAe4xg2q9dNkDqCXVqI4YGr9aavCQEiAS4uHiRwqvcsPqJHipFDfg==}peerDependencies:'@tiptap/pm': 3.31.4- '@tiptap/[email protected]':- resolution: {integrity: sha512-EitM8KY3agYfnp/bqhfxcaReVq4CUqVzMqoSIl7xSfYABTGYoTDtVXUdYSGutcCBFjc86BbXjrOlDlqkgC8BsQ==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-jrtRrAfgL7bXd2ecy0T7G4b6ozwzW9h67B3iQsDmgu7PWytkqbrUPFrki6LjyysrxZEK4jqgRMNCvfe2Yx2fKg==}peerDependencies:- '@tiptap/pm': 3.32.2+ '@tiptap/pm': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-VLcdnbOm7G52NpUhgbyo3XIOz6Eky7/DyGYuYnCpEUe0TE5xk7Qs6ukrh9vaf2XhyeLDHsmVZuzybGrdtqoC0w==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-i+GmSTWMjiVnvjAPcwX+2QVgV4YqIAreiRgYQTuWF7SnyRXw2gTF5OB5zZ1S/wPSgNJkAUj9gFHLm5ZsVZlpFQ==}peerDependencies:- '@tiptap/core': 3.32.2- '@tiptap/pm': 3.32.2+ '@tiptap/core': 3.35.0+ '@tiptap/pm': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-5Q8bScZEZbIBB2tBgnc7Cr6XuH2Nt/6l1HP3FO0wWO7nqXPOcodEbjslePI3v1iag+LNWX16BZ8fDrJr/PbxXA==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-jRLo/b2o8x6XVNQXZLHFgpjD7ibaVgCZjvGxlbT9POeuHgVgveJUYluLukXVxFQGvcPmEKHN2ZOyN10nZlcmlw==}peerDependencies:- '@tiptap/core': 3.32.2+ '@tiptap/core': 3.35.0'@tiptap/[email protected]':resolution: {integrity: sha512-Ml/yswuys+3QkOMajfXyAGlUKCxEbT3dMyF8vHwQ5mDk9MDm+dqp10It5CrDBkUT/KkVTa6AJI3kb0TXZJZiAA==}@@ -888,10 +884,10 @@ packages:'@tiptap/core': 3.31.4'@tiptap/pm': 3.31.4- '@tiptap/[email protected]':- resolution: {integrity: sha512-YP7IlC3swrNPlnFHIgVDsDl70geqqWtcAkbuncQEs5FJ9UQg432VwVfwCUW4NsG532p5AqlTTwOKcSLS7p/pqA==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-3oolZyXt1iF2ZHyZgtF2ESH+0BOu0K9R4aOkR9SjOv5GReLMl5goPIVYdVMLB2GG89Cy3XCOZsvvDzEKBtKcdQ==}peerDependencies:- '@tiptap/extension-list': 3.32.2+ '@tiptap/extension-list': 3.35.0'@tiptap/[email protected]':resolution: {integrity: sha512-OZgBo3IzRpsKpXA+CzGYrNMw9gWP9c6EySl3FfRHO5Utfe9OSU9pcDbJ1rhPfbsVdJP1rw+EMEJQ2r2UxlpRGA==}@@ -902,16 +898,16 @@ packages:highlight.js: ^11lowlight: ^2 || ^3- '@tiptap/[email protected]':- resolution: {integrity: sha512-KFkPMMgXEgXImGpbUsrHNaERtvOGbJ/JiWn0zHNGSJCf6frn44OLeRFPpEMptmwMqtJxftBVFbEbcPOlATYqDw==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-x5tyWZGal+67fZH04e1p3VskF2398SxLDg9UWeuBuXHZjKchvzyh5C40VR/Q1C08ANCRmO3vEO6mdU6tqI1izQ==}peerDependencies:- '@tiptap/core': 3.32.2- '@tiptap/pm': 3.32.2+ '@tiptap/core': 3.35.0+ '@tiptap/pm': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-jm7qXuDmBzQYPemm/9chLepQjCNVtZhaoU9N2f4GxdUi8u/fi3AQLP7xlXjRCQUyam50FVqIIWgD567mLQ3sMg==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-QehRbI1qFEGyhPicb7AVb2G1R3BsGH0W9yndRuw0fHM0+Fy5hDGGcs2umuZsE9TMoyXo3sxau7szYhNZ0ZKzTA==}peerDependencies:- '@tiptap/core': 3.32.2+ '@tiptap/core': 3.35.0'@tiptap/[email protected]':resolution: {integrity: sha512-3rax34HKSo8L5ihv5iGxISNBUIdVP0Fq9O6T/mq4kQOLhVhNbqwr9I/lWOvaz24nPE7u5Vkz0Ii3zWGlzxyPPA==}@@ -921,10 +917,10 @@ packages:'@tiptap/y-tiptap': ^3.0.7yjs: ^13- '@tiptap/[email protected]':- resolution: {integrity: sha512-zKWj8jh1kpckfSwle+kqFn0ZnYvkhb7nz89nrNvpnnsQMbbGU2/+bUAfYU3XSEKZr3VBvW176FtlMPD8ggC3Cg==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-DOyA27ChJMpFjmIDpA33Vdf4UycfWops8FHbezBCBkNtZv/Og7+FLGnpcmo1X0QiBSOpH5p7wRmA/pRPz+daZw==}peerDependencies:- '@tiptap/core': 3.32.2+ '@tiptap/core': 3.35.0'@tiptap/[email protected]':resolution: {integrity: sha512-UiHZNmr3fU/YeZxVyMyFTbb/ougIGSX0q3BkiCE0l1JPARhfYEsT6oULP6IC3tV8qnZHxiAZBSLlwRuJH0vuAw==}@@ -935,41 +931,41 @@ packages:'@tiptap/pm': 3.31.4'@tiptap/y-tiptap': ^3.0.7- '@tiptap/[email protected]':- resolution: {integrity: sha512-mE9muf4KSY3s+LCaHG/G957pVHVF2q46i+YkZF3ZG70errQcyZ5YFKnce9PSL1fiL0VLL+2UhMAL2QDM5oDiNA==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-xWUKpYFCZTevhoDxDKWMLGMaWWp13ZQNf3EBI28b65vHfYKFB8Sp3kzoUD1G4EjHieP/qvwgdH9Cwr37507++w==}peerDependencies:- '@tiptap/extensions': 3.32.2+ '@tiptap/extensions': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-7W/iX8h6KQ2HK2SfvzCIgySOEJwTM4owqz1tXVOPiLPvKSvDDa9GQsp60+xNyqDNHuplE8bRsZ5dH1nilgAaAg==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-dVYabC1u91YWUr17tvNDaEWGG1YnforvPdF8krscw+xvolmpJz7/U9dZyb52NyVUdyg14XJ/DXXu8/hIdezZxg==}peerDependencies:- '@tiptap/extensions': 3.32.2+ '@tiptap/extensions': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-oIdXmya2XBzp3Cw9Nr36agPvr9ZXP3p2fQXaFflxYYBKOG3UUzw38CId7J6K1jYxBf8c1zodbiKFEL7rttJ6fQ==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-SY4+GqIy9z1+HlgjFDIZ8A1eQbf7vaX1FAZPbuLvmlMJIGto2XWyt3JplWEJ/ZgAt9VBt/+vSv9Sx0s1zdS6+w==}peerDependencies:- '@tiptap/core': 3.32.2+ '@tiptap/core': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-AE2WNA3jVnPV/cVyTwTmtmGZqX8LiiGicDHXX4bdvfzv+Aez4sgzdkuFjOGWtnEy43NnXdoI1UX7y/984NM0iA==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-VehBIfOkbsgUykKrvFMAUL/IroA4dWgruY6kaQHfQSWIxJF58LOHqnG4ElK/aokROAC/YwWb81nGgxD4h5ClLg==}peerDependencies:- '@tiptap/core': 3.32.2+ '@tiptap/core': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-Pl0YRS60R339yHrAWGhPT9WHIlD72BO6SGVdj8lBs2OAaYw5RQL/1BGZi+7UvAyc2yJxaRC4XN9X4jdQHDUq9A==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-sT3DfYf/udMQjRXzZu3QEFAEkTUalTad39XpMtm7m8grdRqd7VxfgbfbvFf+P2l57xVs6n3vi40zKjoXLaDj5A==}peerDependencies:- '@tiptap/core': 3.32.2- '@tiptap/pm': 3.32.2+ '@tiptap/core': 3.35.0+ '@tiptap/pm': 3.35.0'@tiptap/[email protected]':resolution: {integrity: sha512-vtD+rK73abJnPRKOjU37sQTCa5Auyg451yhqZD/3lZKiFJDBHAZKI7lQARkXBQYK289hBhK6yMIwofoqCBvi3g==}peerDependencies:'@tiptap/core': 3.31.4- '@tiptap/[email protected]':- resolution: {integrity: sha512-aqk8OK4Xo59qZni7YSy42/ltQFb2IOmli3YERIq1XPQ4vl5sxoYhL+sFoOPmvbjHvaHZpK6n8vPh1SmAnB570A==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-FAJgWB0LfIFwLPddbFkEC92dgrmyPKj9P52Bis1fh+RpspmvBneqgmAp0aveyDJ0EtA8LJ2b5FxJN9S8b7HDNg==}peerDependencies:- '@tiptap/core': 3.32.2+ '@tiptap/core': 3.35.0'@tiptap/[email protected]':resolution: {integrity: sha512-LLxW3qfeL9gvDdMPVdxYFYZ0zZSjsoIDhOqjJ5U2UfaK3U2iwkKTBgV2qT+FWf3uUHmBRjBZ08q3dRPmWBAD5g==}@@ -977,27 +973,27 @@ packages:'@tiptap/core': 3.31.4'@tiptap/pm': 3.31.4- '@tiptap/[email protected]':- resolution: {integrity: sha512-EwQtMXsU1Vc03n+yud7lfaR+RjHTPwFyI/hcEylvJba7iIXDSLA/ey4mnpwt2od8CEx/ZcOutIryORKVR9Py/Q==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-s3yRI3JygzHrZilGyuwB+Z870TYUrH8LjDh3V25eOvswU8Q3neavSp695UNUzgV0+zmalrIhGImSp4K3TLV+ew==}peerDependencies:- '@tiptap/core': 3.32.2- '@tiptap/pm': 3.32.2+ '@tiptap/core': 3.35.0+ '@tiptap/pm': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-vTdPfzZODLVXog/NMs6zcaTOhtlh6ptJidlMg8l1TLhO+YQyEyO/K45aV429D9xTo/BOVazreav/C+hgemSnYg==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-zH4WdVgR9JKtXsquZUBfMvFiTKIA1ADALrk9ZZL5EyMA1FVAl1nVjPKD40ND2/j5FcCU/+X1oopMoBw4XQNAuw==}peerDependencies:- '@tiptap/extension-list': 3.32.2+ '@tiptap/extension-list': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-SioQO8TqRb8aq9L+GpI/a/F7HCSBarm3Uvqtt2YttyazjSjEedu1zSnaa93V+WEFmlqyXnxVa24vv2zj6qlavQ==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-pWD1pQVzlNWj5WRi3P4JXs0kPj+BXse7L06BRRodMcW+giAVZK3cX8VWpLN+MDq0A0JY4qf1OhZP/j4MQBWfdg==}peerDependencies:- '@tiptap/extension-list': 3.32.2+ '@tiptap/extension-list': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-rLYk3GXSswrCakyZwo8VW0+yjnYhLJSBRvzClneIrlPhqQ2r/oDUjeqkpm8lGvwREw1lDSh7wefGhkhTRcQkAw==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-1m6Lii2LMhkDe9Wr4OU0UkJZMSBLN9nEyWGMVA6AfI/z0Dt7yiyTnKwTSSZS5Is83sGPYAxgWCoz7TnlDmxtWg==}peerDependencies:- '@tiptap/core': 3.32.2- '@tiptap/pm': 3.32.2+ '@tiptap/core': 3.35.0+ '@tiptap/pm': 3.35.0'@tiptap/[email protected]':resolution: {integrity: sha512-qWJHvp+ETbwpaEY6WhWk94yzZFc3OnX/kfBqHfgpdX2x1LVgjZLpFqSmNIvpwtR97+RBP4cKLZT4kwJbSse/zA==}@@ -1019,20 +1015,20 @@ packages:'@tiptap/core': 3.22.5'@tiptap/pm': 3.22.5- '@tiptap/[email protected]':- resolution: {integrity: sha512-WQw2fLtJAxCYftKAk+YNlPDc+OxtXK4nNfXRBwr6oC67SoJtoLe0bo5jS6vF+cEqzHjDaboJi+O3MSNp2L2VQA==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-cSCRDCwWWyc6IKOy/+mBgaFZddkC8c4lfo7xCW4nlpLOrs9PBqzinXrFeh902gsLbtejk40dotzoo9t1NAIySQ==}peerDependencies:- '@tiptap/extension-list': 3.32.2+ '@tiptap/extension-list': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-3bqC//4GEhUiux3dhW/TJuveBp9ADv4nHlqBdVQa3A+USGbaBvE9YvXxA32wZL0leSRykxEnHbNHZ1J4KjIynQ==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-3ep6HPJIipkPNSN49CylCeq59uQzfzrxZXEiad1Nk35CBHnICBSwawYz+h8L+FVh9Tn+XBQDZAU4NLEBRH0EIg==}peerDependencies:- '@tiptap/core': 3.32.2+ '@tiptap/core': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-i3d4vCrZySS9g5nGa5W0LS6LPMKxcAnJO6uADTnGVlKK0ewklcWWZbZ9GB/Fpx/IjKAvXWeayjfsNpTae/yVZg==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-xOLLgRO0yD9gYxMdp5fD4sJw4DJNTGrox4zLOSO99J6Pf8+8GdCPZAb9HBu4aHbCjt+16vu1i2uWmmkNnmbD1A==}peerDependencies:- '@tiptap/core': 3.32.2+ '@tiptap/core': 3.35.0'@tiptap/[email protected]':resolution: {integrity: sha512-jM5siWIALv7AIRGgWmiLxEaVnyQ26VqAPaF5E8TM2Z/u9AWZ8UfPCzJnHeWQxYMyFdZzYZJQXbA+5VfNLl36zg==}@@ -1065,30 +1061,30 @@ packages:peerDependencies:'@tiptap/extension-list': 3.32.2- '@tiptap/[email protected]':- resolution: {integrity: sha512-W6G7UbQ71TyvZvORDdj6u8By8B/Dymy8KoaKGaNHqB82SpM42ZK2TmeFBHI0Lo4wTkZJL3LuI+QthaDvh0USsA==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-g1llNE9A1QA0xCRpWIzBiUtzAVYoElUAhZAcF1NNYxftPs+pW6Xz3f3QfdvFQljaCF5tClfX/C9pjtfT5YfWPQ==}peerDependencies:- '@tiptap/core': 3.32.2+ '@tiptap/core': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-kY7B5ocKx3JzqIl2kLXGvnLGZRxuYEFzMkpgJ6Vh6/VTTK+JCeOVItYEQGFrAxrodIMmhIrXpi1jF57s6iZswg==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-OLQlcmHcwvh1SDmqLDX0gyXIacaDS+jpwXZOKTipuanhSpSZnCzITqvmf5CRW+NhVFfMgsrlC+nKgu/O8St10Q==}peerDependencies:- '@tiptap/core': 3.32.2+ '@tiptap/core': 3.35.0- '@tiptap/[email protected]':- resolution: {integrity: sha512-TUE1JedPjYQ/T527f2a4xz+4Xi1a5nIgW8KwC0DjmqbaHirlz0eCNI2nMEN70pu5WPpqgXmki3lCF3LScQxIGw==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-sxXAIlEAQUpNGUXHZeVRmEfbUkQqyEaKpXwXP3wONe7ZdKQL5WO6l2dyd3+vbCY7H67NWyEG51NKF6lwmplreA==}peerDependencies:- '@tiptap/core': 3.32.2- '@tiptap/pm': 3.32.2+ '@tiptap/core': 3.35.0+ '@tiptap/pm': 3.35.0'@tiptap/[email protected]':resolution: {integrity: sha512-x7dwth79cQp4QGae66/RJqMDJQv0+n7b7dD7cyFQBWqzPFLJxN/4paHY4qbWedZjNLhRyIOAD9a5q4AYM1zmPA==}- '@tiptap/[email protected]':- resolution: {integrity: sha512-4cuUbYf55NnYBIvDBK/K1VFVQ4pocKwAZC5TAy4s9dptvazxVHkQVMbiQsyhwfIbM4rxmHWkM/6omaFfTB++/g==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-bijTl/bhwi+KYo0Xte872JwJl6rTsz557z5NTuuf8f5oqlocIESQLLFHLHsII2t3Urrf78OSnZaGe0qJ/kEU0Q==}- '@tiptap/[email protected]':- resolution: {integrity: sha512-6K+oOMF4orhnOxivgUTKiSpNAEftHyWOcfFIvIEMUP044b34obBUogzMTfM3RjtewZtQXVafO9zmGU30IllC1g==}+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-8+RCgXBlI6rqARCr5RP9Jn73CxNFIuGyh3u2nxcs87QN15xzCKzZWlIBDE4fb9Y2ieWX06QZ9Lx34YjbzwoGLQ==}'@tiptap/[email protected]':resolution: {integrity: sha512-J9WWMQDAzZOlF9VSdLohpxgrwlB1NscqvNhOPoS3WjwrzQqLj+FAvcchfJQcnybF5mYOtftFZexpOzOt1MqjUA==}@@ -1782,16 +1778,19 @@ packages:resolution: {integrity: sha512-+kC5C4sCGntGUhGvTa5VIb5rtM75cSy/VCy3tzZoNAcn2qZGdgYvljN0WvjsOzrEzp+V6XKgwzO0u2TdzNAiOg==}+ deprecated: Replaced by @markmap/* in 1.0.0. See https://markmap.js.org/docs/migrationpeerDependencies:markmap-common: '*'- resolution: {integrity: sha512-WCA4OT+b71jYg0e4PS/6NRKqihod5OpPsvw1jEGHQwCtqQrY/yXXCeRyuL3axOS5cMy5pV8BSl4CwKfJU1LxJg==}+ resolution: {integrity: sha512-8ufvDRDxKu7aMeVaVZpCxcbpaJa96q+FdwzSDtb/tpPYPF9L6lO7t5X0kji6M3N1TAEFb2gzaVoe8EAbBTASYw==}+ deprecated: Replaced by @markmap/* in 1.0.0. See https://markmap.js.org/docs/migrationpeerDependencies:markmap-common: '*'- resolution: {integrity: sha512-D8bzT1YwIC/8rkbwm6WzigVUrpOAGv7ioEGTi1Lj+Oo8gO5sAm6hhli27jvTgUcZ9TwBeIWZ+dSUP+AupYUGlQ==}+ resolution: {integrity: sha512-FNzBzDZ81hR9TJ8MmpDxH1qhFWVqAHeCE2BkOW4GseDrymNTlXg5uLaiVl6PFAlB+O6mG6Gkbd+UsHuaOpgyKA==}+ deprecated: Replaced by @markmap/* in 1.0.0. See https://markmap.js.org/docs/migrationpeerDependencies:markmap-common: '*'@@ -1867,8 +1866,8 @@ packages:engines: {node: '>=20'}hasBin: true- resolution: {integrity: sha512-BC4s8y6SEVA6Q1rSxZTto8hI1KUI3xXlHGZgvGqP4IqPdI/a6FX9H29IDNz7vKo9l21b6LfYosScPL6M3xxyDQ==}+ resolution: {integrity: sha512-hqPpz7blSMPxWVdoeE1yiBSzXsKiVOd2k+kjCvmUywD2GPO2Dd9HfcWnq9NN0GHbNZDFgZ9JfBFr+X5/BLo0qw==}engines: {node: '>=20'}hasBin: true@@ -1877,8 +1876,8 @@ packages:engines: {node: '>=20'}hasBin: true- resolution: {integrity: sha512-HCrVhHr5QQuwYoswEUGTb7gGp522yflbv/ST8nF4sFWGuLjQCt17Q/EubpGGSNKYn1tsTCPZxqHhHCfVURu7UA==}+ resolution: {integrity: sha512-vJ1FuoOrNwOKHUIVEvSt3jT1L+wjjDpwhwIstKtfvTh8XIG4FG4bIFuvNdMxi81LGfAhUgUZleVFaOLY4RIUUw==}engines: {node: '>=20'}hasBin: true@@ -2251,8 +2250,6 @@ snapshots:'@babel/[email protected]': {}- '@babel/[email protected]': {}-'@braintree/[email protected]': {}'@chevrotain/[email protected]': {}@@ -2500,7 +2497,7 @@ snapshots:dependencies:acorn: 8.15.0- '@sveltejs/[email protected](@sveltejs/[email protected](@sveltejs/[email protected]([email protected])([email protected](@types/[email protected])([email protected])))([email protected])([email protected])([email protected](@types/[email protected])([email protected])))':+ '@sveltejs/[email protected](@sveltejs/[email protected](@sveltejs/[email protected]([email protected])([email protected](@types/[email protected])([email protected])))([email protected])([email protected])([email protected](@types/[email protected])([email protected])))':dependencies:'@sveltejs/kit': 2.51.0(@sveltejs/[email protected]([email protected])([email protected](@types/[email protected])([email protected])))([email protected])([email protected])([email protected](@types/[email protected])([email protected]))@@ -2672,7 +2669,7 @@ snapshots:dependencies:'@tauri-apps/api': 2.12.4- '@tauri-apps/[email protected]':+ '@tauri-apps/[email protected]':dependencies:'@tauri-apps/api': 2.12.4@@ -2688,7 +2685,7 @@ snapshots:dependencies:'@tauri-apps/api': 2.12.4- '@tauri-apps/[email protected]':+ '@tauri-apps/[email protected]':dependencies:'@tauri-apps/api': 2.12.4@@ -2696,18 +2693,18 @@ snapshots:dependencies:'@tiptap/pm': 3.31.4- '@tiptap/[email protected](@tiptap/[email protected])':+ '@tiptap/[email protected](@tiptap/[email protected])':dependencies:- '@tiptap/pm': 3.32.2+ '@tiptap/pm': 3.35.0- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])- '@tiptap/pm': 3.32.2+ '@tiptap/core': 3.35.0(@tiptap/[email protected])+ '@tiptap/pm': 3.35.0dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])+ '@tiptap/core': 3.35.0(@tiptap/[email protected])'@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:@@ -2715,31 +2712,31 @@ snapshots:'@tiptap/core': 3.31.4(@tiptap/[email protected])'@tiptap/pm': 3.31.4- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':dependencies:- '@tiptap/extension-list': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extension-list': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))(@tiptap/[email protected])([email protected])([email protected])':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))(@tiptap/[email protected])([email protected])([email protected])':dependencies:'@tiptap/core': 3.31.4(@tiptap/[email protected])- '@tiptap/extension-code-block': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extension-code-block': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])'@tiptap/pm': 3.31.4highlight.js: 11.12.0lowlight: 3.3.0- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:'@tiptap/core': 3.31.4(@tiptap/[email protected])'@tiptap/pm': 3.31.4- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])- '@tiptap/pm': 3.32.2+ '@tiptap/core': 3.35.0(@tiptap/[email protected])+ '@tiptap/pm': 3.35.0dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])+ '@tiptap/core': 3.35.0(@tiptap/[email protected])'@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])':dependencies:@@ -2748,9 +2745,9 @@ snapshots:'@tiptap/y-tiptap': 3.0.3([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])yjs: 13.6.30dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])+ '@tiptap/core': 3.35.0(@tiptap/[email protected])'@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))':dependencies:@@ -2761,34 +2758,34 @@ snapshots:'@tiptap/pm': 3.31.4'@tiptap/y-tiptap': 3.0.3([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':dependencies:- '@tiptap/extensions': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extensions': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':dependencies:- '@tiptap/extensions': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extensions': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])+ '@tiptap/core': 3.35.0(@tiptap/[email protected])dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])+ '@tiptap/core': 3.35.0(@tiptap/[email protected])- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])- '@tiptap/pm': 3.32.2+ '@tiptap/core': 3.35.0(@tiptap/[email protected])+ '@tiptap/pm': 3.35.0dependencies:'@tiptap/core': 3.31.4(@tiptap/[email protected])dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])+ '@tiptap/core': 3.35.0(@tiptap/[email protected])'@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:@@ -2796,29 +2793,29 @@ snapshots:'@tiptap/pm': 3.31.4linkifyjs: 4.3.3- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])- '@tiptap/pm': 3.32.2+ '@tiptap/core': 3.35.0(@tiptap/[email protected])+ '@tiptap/pm': 3.35.0linkifyjs: 4.4.0- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':dependencies:- '@tiptap/extension-list': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extension-list': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':dependencies:- '@tiptap/extension-list': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extension-list': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:'@tiptap/core': 3.31.4(@tiptap/[email protected])'@tiptap/pm': 3.31.4- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])- '@tiptap/pm': 3.32.2+ '@tiptap/core': 3.35.0(@tiptap/[email protected])+ '@tiptap/pm': 3.35.0'@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])([email protected])':dependencies:@@ -2837,17 +2834,17 @@ snapshots:'@tiptap/core': 3.31.4(@tiptap/[email protected])'@tiptap/pm': 3.31.4- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':dependencies:- '@tiptap/extension-list': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extension-list': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])+ '@tiptap/core': 3.35.0(@tiptap/[email protected])dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])+ '@tiptap/core': 3.35.0(@tiptap/[email protected])'@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':dependencies:@@ -2866,23 +2863,23 @@ snapshots:'@tiptap/core': 3.31.4(@tiptap/[email protected])'@tiptap/pm': 3.31.4- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':dependencies:- '@tiptap/extension-list': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extension-list': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))':dependencies:- '@tiptap/extension-list': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extension-list': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])+ '@tiptap/core': 3.35.0(@tiptap/[email protected])dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])+ '@tiptap/core': 3.35.0(@tiptap/[email protected])- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:'@tiptap/core': 3.31.4(@tiptap/[email protected])'@tiptap/pm': 3.31.4@@ -2903,7 +2900,7 @@ snapshots:prosemirror-transform: 1.12.0prosemirror-view: 1.42.6- '@tiptap/[email protected]':+ '@tiptap/[email protected]':dependencies:prosemirror-changeset: 2.4.5prosemirror-commands: 1.7.2@@ -2919,32 +2916,32 @@ snapshots:prosemirror-transform: 1.12.4prosemirror-view: 1.42.8- '@tiptap/[email protected]':- dependencies:- '@tiptap/core': 3.32.2(@tiptap/[email protected])- '@tiptap/extension-blockquote': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])- '@tiptap/extension-bold': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))- '@tiptap/extension-bullet-list': 3.32.2(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))- '@tiptap/extension-code': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))- '@tiptap/extension-code-block': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])- '@tiptap/extension-document': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))- '@tiptap/extension-dropcursor': 3.32.2(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))- '@tiptap/extension-gapcursor': 3.32.2(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))- '@tiptap/extension-hard-break': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))- '@tiptap/extension-heading': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))- '@tiptap/extension-horizontal-rule': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])- '@tiptap/extension-italic': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))- '@tiptap/extension-link': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])- '@tiptap/extension-list': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])- '@tiptap/extension-list-item': 3.32.2(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))- '@tiptap/extension-list-keymap': 3.32.2(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))- '@tiptap/extension-ordered-list': 3.32.2(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))- '@tiptap/extension-paragraph': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))- '@tiptap/extension-strike': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))- '@tiptap/extension-text': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))- '@tiptap/extension-underline': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))- '@tiptap/extensions': 3.32.2(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])- '@tiptap/pm': 3.32.2+ '@tiptap/[email protected]':+ dependencies:+ '@tiptap/core': 3.35.0(@tiptap/[email protected])+ '@tiptap/extension-blockquote': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extension-bold': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))+ '@tiptap/extension-bullet-list': 3.35.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))+ '@tiptap/extension-code': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))+ '@tiptap/extension-code-block': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extension-document': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))+ '@tiptap/extension-dropcursor': 3.35.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))+ '@tiptap/extension-gapcursor': 3.35.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))+ '@tiptap/extension-hard-break': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))+ '@tiptap/extension-heading': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))+ '@tiptap/extension-horizontal-rule': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extension-italic': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))+ '@tiptap/extension-link': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extension-list': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/extension-list-item': 3.35.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))+ '@tiptap/extension-list-keymap': 3.35.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))+ '@tiptap/extension-ordered-list': 3.35.0(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))+ '@tiptap/extension-paragraph': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))+ '@tiptap/extension-strike': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))+ '@tiptap/extension-text': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))+ '@tiptap/extension-underline': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))+ '@tiptap/extensions': 3.35.0(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/pm': 3.35.0'@tiptap/[email protected](@floating-ui/[email protected])(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:@@ -3680,13 +3677,13 @@ snapshots:dependencies:- '@babel/runtime': 7.29.2+ '@babel/runtime': 7.29.10cheerio: 1.0.0markmap-common: 0.18.9dependencies:- '@babel/runtime': 7.29.2+ '@babel/runtime': 7.29.10'@vscode/markdown-it-katex': 1.1.2highlight.js: 11.12.0katex: 0.16.47@@ -3697,13 +3694,13 @@ snapshots:markdown-it-sup: 2.0.0markmap-common: 0.18.9markmap-html-parser: 0.18.11([email protected])- markmap-view: 0.18.12([email protected])+ markmap-view: 0.18.13([email protected])prismjs: 1.30.0yaml: 2.8.4dependencies:- '@babel/runtime': 7.29.2+ '@babel/runtime': 7.29.10d3: 7.9.0markmap-common: 0.18.9@@ -3781,15 +3778,15 @@ snapshots:- [email protected]: {}+ [email protected]: {}dependencies:playwright-core: 1.63.0dependencies:- playwright-core: 1.64.1+ playwright-core: 1.65.1diff --git a/scripts/linux/linuxdeploy-plugin-gtk.sh b/scripts/linux/linuxdeploy-plugin-gtk.shindex 294531dd..11a4566a 100755--- a/scripts/linux/linuxdeploy-plugin-gtk.sh+++ b/scripts/linux/linuxdeploy-plugin-gtk.sh@@ -228,13 +228,6 @@ export GTK_THEME="$APPIMAGE_GTK_THEME" # Custom themes are brokenexport GDK_BACKEND=x11 # Crash with Wayland backend on Wayland - We tested it without it and ended up with this: https://github.com/tauri-apps/tauri/issues/8541export XDG_DATA_DIRS="$APPDIR/usr/share:/usr/share:$XDG_DATA_DIRS" # g_get_system_data_dirs() from GLib-if [ -z "${WEBKIT_DISABLE_DMABUF_RENDERER:-}" ]; then- export WEBKIT_DISABLE_DMABUF_RENDERER=1-fi-if [ -z "${WEBKIT_DISABLE_COMPOSITING_MODE:-}" ]; then- export WEBKIT_DISABLE_COMPOSITING_MODE=1-fi-# WebKitGTK plays media through GStreamer, and the bundled core libraries come# without plugins or the plugin-scanner helper — so the default scan finds no# appsink/autoaudiosink/decodebin and the first media pipeline dies (blank pagediff --git a/scripts/resample-nav-penguins.py b/scripts/resample-nav-penguins.pynew file mode 100644index 00000000..c760aee9--- /dev/null+++ b/scripts/resample-nav-penguins.py@@ -0,0 +1,54 @@+#!/usr/bin/env python3+"""+Resample LibreGet's master penguin artwork into 1x (32px) and 2x (64px) PNGs+using high-quality Lanczos sinc filtering.+"""+import base64+import glob+import io+import os+import re+from PIL import Image++ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+NAV_DIR = os.path.join(ROOT_DIR, "static", "icons", "nav")++SVG_ICONS = ["home", "downloads", "tools", "nami", "marketplace", "settings", "convert", "courses"]+PNG_SOURCES = {+ "about": os.path.join(ROOT_DIR, "static", "icons", "about-64.png"),+ "telegram": os.path.join(ROOT_DIR, "static", "icons", "telegram-64.png"),+}+++def resample_and_save(im: Image.Image, name: str) -> None:+ im_rgba = im.convert("RGBA")+ im32 = im_rgba.resize((32, 32), Image.Resampling.LANCZOS)+ im64 = im_rgba.resize((64, 64), Image.Resampling.LANCZOS)++ out32 = os.path.join(NAV_DIR, f"{name}-32.png")+ out64 = os.path.join(NAV_DIR, f"{name}-64.png")++ im32.save(out32, "PNG", optimize=True)+ im64.save(out64, "PNG", optimize=True)+ print(f"Generated {name}-32.png and {name}-64.png")+++def main() -> None:+ for name in SVG_ICONS:+ svg_path = os.path.join(NAV_DIR, f"{name}.svg")+ with open(svg_path, "r", encoding="utf-8") as f:+ content = f.read()+ m = re.search(r"data:image/png;base64,([A-Za-z0-9+/=]+)", content)+ if not m:+ raise ValueError(f"No base64 image found in {svg_path}")+ raw = base64.b64decode(m.group(1))+ im = Image.open(io.BytesIO(raw))+ resample_and_save(im, name)++ for name, p in PNG_SOURCES.items():+ im = Image.open(p)+ resample_and_save(im, name)+++if __name__ == "__main__":+ main()diff --git a/scripts/ui-lint-baseline.json b/scripts/ui-lint-baseline.jsonindex 3239b473..b6eae04e 100644--- a/scripts/ui-lint-baseline.json+++ b/scripts/ui-lint-baseline.json@@ -1,11 +1,10 @@{- "updated_at": "2026-11-10",+ "updated_at": "2026-11-22","targets": {"/": {- "control-gap": 6,- "control-size": 16,- "label-consistency": 5,- "text-contrast": 27+ "control-size": 2,+ "label-consistency": 3,+ "text-contrast": 2},"/about": {"control-size": 2,@@ -32,24 +31,22 @@},"/marketplace": {"control-gap": 1,- "control-size": 20,+ "control-size": 18,"label-consistency": 3,"text-contrast": 20},"/nami": {- "content-inset": 10,- "control-gap": 8,- "control-size": 6,- "font-size": 4,+ "control-gap": 3,+ "control-size": 4,"label-consistency": 3,- "text-contrast": 6+ "text-contrast": 2},"/settings": {"control-gap": 18,"control-size": 2,"font-size": 10,"label-consistency": 3,- "text-contrast": 6+ "text-contrast": 4},"/study": {"control-gap": 4,diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lockindex 9ef87926..fdf74389 100644--- a/src-tauri/Cargo.lock+++ b/src-tauri/Cargo.lock@@ -189,15 +189,6 @@ dependencies = ["objc",]-[[package]]-name = "arbitrary"-version = "1.4.2"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1"-dependencies = [- "derive_arbitrary",-]-[[package]]name = "arboard"version = "3.6.1"@@ -228,6 +219,18 @@ dependencies = ["rustversion",]+[[package]]+name = "arrayref"+version = "0.3.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"++[[package]]+name = "arrayvec"+version = "0.7.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56"+[[package]]name = "assert_cfg"version = "0.1.0"@@ -970,17 +973,6 @@ dependencies = ["nom 7.1.3",]-[[package]]-name = "cfb"-version = "0.7.3"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f"-dependencies = [- "byteorder",- "fnv",- "uuid 1.21.0",-]-[[package]]name = "cfb"version = "0.14.0"@@ -1389,6 +1381,15 @@ dependencies = ["libc",]+[[package]]+name = "core_maths"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30"+dependencies = [+ "libm",+]+[[package]]name = "cpubits"version = "0.1.1"@@ -1507,7 +1508,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d045de693cb712d0b22c6a64be5b953f67b3ce00ab5ad3dd5d8b441886ab8e1a"dependencies = ["quote",- "syn 2.0.117",+ "syn 3.0.3",][[package]]@@ -1615,6 +1616,12 @@ version = "2.11.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06"+[[package]]+name = "data-url"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376"+[[package]]name = "dbus"version = "0.9.12"@@ -1678,17 +1685,6 @@ dependencies = ["syn 1.0.109",]-[[package]]-name = "derive_arbitrary"-version = "1.4.2"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a"-dependencies = [- "proc-macro2",- "quote",- "syn 2.0.117",-]-[[package]]name = "derive_builder"version = "0.13.1"@@ -2086,6 +2082,15 @@ version = "3.3.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59"+[[package]]+name = "euclid"+version = "0.22.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06"+dependencies = [+ "num-traits",+]+[[package]]name = "event-listener"version = "2.5.3"@@ -2223,6 +2228,12 @@ dependencies = ["zlib-rs",]+[[package]]+name = "float-cmp"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"+[[package]]name = "fnv"version = "1.0.7"@@ -2241,6 +2252,29 @@ version = "0.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"+[[package]]+name = "fontconfig-parser"+version = "0.5.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bbc773e24e02d4ddd8395fd30dc147524273a83e54e0f312d986ea30de5f5646"+dependencies = [+ "roxmltree",+]++[[package]]+name = "fontdb"+version = "0.22.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a3a6f9af55fb97ad673fb7a69533eb2f967648a06fa21f8c9bb2cd6d33975716"+dependencies = [+ "fontconfig-parser",+ "log",+ "memmap2",+ "slotmap",+ "tinyvec",+ "ttf-parser",+]+[[package]]name = "foreign-types"version = "0.3.2"@@ -2610,6 +2644,16 @@ dependencies = ["wasm-bindgen",]+[[package]]+name = "gif"+version = "0.13.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b"+dependencies = [+ "color_quant",+ "weezl 0.1.12",+]+[[package]]name = "gif"version = "0.14.2"@@ -3255,9 +3299,11 @@ dependencies = ["percent-encoding","pin-project-lite","socket2 0.6.5",+ "system-configuration","tokio","tower-service","tracing",+ "windows-registry",][[package]]@@ -3286,12 +3332,12 @@ dependencies = [[[package]]name = "ico"-version = "0.5.0"+version = "0.6.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371"+checksum = "d75e94d66081e4d8dcd098bd8dc5254800fea14a26389b298410158d834de167"dependencies = ["byteorder",- "png 0.17.16",+ "png 0.18.1",][[package]]@@ -3410,15 +3456,15 @@ dependencies = [[[package]]name = "image"-version = "0.25.9"+version = "0.25.10"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "e6506c6c10786659413faa717ceebcb8f70731c0a60cbae39795fdf114519c1a"+checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"dependencies = ["bytemuck","byteorder-lite","color_quant",- "gif",- "image-webp",+ "gif 0.14.2",+ "image-webp 0.2.4","moxcms","num-traits","png 0.18.1",@@ -3427,6 +3473,16 @@ dependencies = ["zune-jpeg 0.5.15",]+[[package]]+name = "image-webp"+version = "0.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f79afb8cbee2ef20f59ccd477a218c12a93943d075b492015ecb1bb81f8ee904"+dependencies = [+ "byteorder-lite",+ "quick-error",+]+[[package]]name = "image-webp"version = "0.2.4"@@ -3437,6 +3493,12 @@ dependencies = ["quick-error",]+[[package]]+name = "imagesize"+version = "0.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285"+[[package]]name = "indexmap"version = "1.9.3"@@ -3473,22 +3535,13 @@ dependencies = ["web-time",]-[[package]]-name = "infer"-version = "0.19.0"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7"-dependencies = [- "cfb 0.7.3",-]-[[package]]name = "infer"version = "0.22.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f4200d433cbd5178df7797c9c2e75b348b728e39631cf14520d1e2fc424201f4"dependencies = [- "cfb 0.14.0",+ "cfb",][[package]]@@ -3730,9 +3783,9 @@ dependencies = [[[package]]name = "kamadak-exif"-version = "0.6.1"+version = "0.6.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "1130d80c7374efad55a117d715a3af9368f0fa7a2c54573afc15a188cd984837"+checksum = "8772c92c0f41c4a672cbdee6728253e5ae8fcc1c5eb5c6c676579565684bbf68"dependencies = ["mutate_once",]@@ -3787,6 +3840,17 @@ dependencies = ["zeroize",]+[[package]]+name = "kurbo"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c62026ae44756f8a599ba21140f350303d4f08dcdcc71b5ad9c9bb8128c13c62"+dependencies = [+ "arrayvec",+ "euclid",+ "smallvec",+]+[[package]]name = "lazy_static"version = "1.5.0"@@ -3885,6 +3949,12 @@ dependencies = ["windows-link 0.2.1",]+[[package]]+name = "libm"+version = "0.2.16"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"+[[package]]name = "libredox"version = "0.1.12"@@ -3897,7 +3967,7 @@ dependencies = [[[package]]name = "libreget"-version = "0.16.10"+version = "1.0.0"dependencies = ["aes 0.8.4","anyhow",@@ -3962,7 +4032,7 @@ dependencies = ["tokio","tokio-tungstenite","tokio-util",- "tower-http",+ "tower-http 0.7.1","tracing","tracing-subscriber","unicode-normalization",@@ -4029,6 +4099,7 @@ dependencies = ["rand 0.10.2","regex","reqwest 0.12.28",+ "resvg","rust_xlsxwriter","sanitize-filename","serde",@@ -4443,9 +4514,9 @@ dependencies = [[[package]]name = "log"-version = "0.4.34"+version = "0.4.35"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"+checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c"[[package]]name = "lopdf"@@ -4494,9 +4565,9 @@ dependencies = [[[package]]name = "m3u8-rs"-version = "6.0.0"+version = "6.0.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "f03cd3335fb5f2447755d45cda9c70f76013626a9db44374973791b0926a86c3"+checksum = "c94fe25bd0d08c68fd0fac4f9537f747246579cd270658fa9fee3d10af382716"dependencies = ["chrono","nom 7.1.3",@@ -4504,14 +4575,16 @@ dependencies = [[[package]]name = "mac-notification-sys"-version = "0.6.9"+version = "0.6.15"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "65fd3f75411f4725061682ed91f131946e912859d0044d39c4ec0aac818d7621"+checksum = "fd604973958ddcc11b561193c0fb96ba146506ef2f231ef2e7c35fd2cbc9beca"dependencies = ["cc",+ "log","objc2","objc2-foundation","time",+ "uuid 1.21.0",][[package]]@@ -4676,9 +4749,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"[[package]]name = "minisign-verify"-version = "0.2.4"+version = "0.3.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "e856fdd13623a2f5f2f54676a4ee49502a96a80ef4a62bcedd23d52427c44d43"+checksum = "871285dc19d8d0ebe0eef3d0e99a205f2a71363b122632cbbfa4a6c370a960ce"[[package]]name = "miniz_oxide"@@ -4713,9 +4786,9 @@ dependencies = [[[package]]name = "moxcms"-version = "0.7.11"+version = "0.8.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "ac9557c559cd6fc9867e122e20d2cbefc9ca29d80d027a8e39310920ed2f0a97"+checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b"dependencies = ["num-traits","pxfm",@@ -4894,9 +4967,9 @@ checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21"[[package]]name = "notify-rust"-version = "4.12.0"+version = "4.18.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "21af20a1b50be5ac5861f74af1a863da53a11c38684d9818d82f1c42f7fdc6c2"+checksum = "4587364a9a0074333429b3df75a30a205340c56a536ca3eb6ca0e59b87bbf8af"dependencies = ["futures-lite 2.6.1","log",@@ -5647,6 +5720,12 @@ dependencies = ["siphasher",]+[[package]]+name = "pico-args"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"+[[package]]name = "pin-project-lite"version = "0.2.16"@@ -6229,7 +6308,7 @@ dependencies = ["tokio-rustls","tokio-util","tower",- "tower-http",+ "tower-http 0.6.8","tower-service","url","wasm-bindgen",@@ -6269,7 +6348,7 @@ dependencies = ["tokio-rustls","tokio-util","tower",- "tower-http",+ "tower-http 0.6.8","tower-service","url","wasm-bindgen",@@ -6278,6 +6357,23 @@ dependencies = ["web-sys",]+[[package]]+name = "resvg"+version = "0.44.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4a325d5e8d1cebddd070b13f44cec8071594ab67d1012797c121f27a669b7958"+dependencies = [+ "gif 0.13.3",+ "image-webp 0.1.3",+ "log",+ "pico-args",+ "rgb",+ "svgtypes",+ "tiny-skia",+ "usvg",+ "zune-jpeg 0.4.21",+]+[[package]]name = "rfd"version = "0.17.2"@@ -6304,6 +6400,15 @@ dependencies = ["windows-sys 0.61.2",]+[[package]]+name = "rgb"+version = "0.8.53"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4"+dependencies = [+ "bytemuck",+]+[[package]]name = "ring"version = "0.17.14"@@ -6327,6 +6432,12 @@ dependencies = ["libc",]+[[package]]+name = "roxmltree"+version = "0.20.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"+[[package]]name = "rusqlite"version = "0.32.1"@@ -6501,6 +6612,24 @@ version = "1.0.22"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"+[[package]]+name = "rustybuzz"+version = "0.18.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c85d1ccd519e61834798eb52c4e886e8c2d7d698dd3d6ce0b1b47eb8557f1181"+dependencies = [+ "bitflags 2.13.1",+ "bytemuck",+ "core_maths",+ "log",+ "smallvec",+ "ttf-parser",+ "unicode-bidi-mirroring",+ "unicode-ccc",+ "unicode-properties",+ "unicode-script",+]+[[package]]name = "ryu"version = "1.0.23"@@ -6995,6 +7124,15 @@ version = "0.3.8"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2"+[[package]]+name = "simplecss"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7a9c6883ca9c3c7c90e888de77b7a5c849c779d25d74a1269b0218b14e8b136c"+dependencies = [+ "log",+]+[[package]]name = "siphasher"version = "1.0.2"@@ -7017,6 +7155,15 @@ version = "0.4.12"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"+[[package]]+name = "slotmap"+version = "1.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038"+dependencies = [+ "version_check",+]+[[package]]name = "smallvec"version = "1.15.1"@@ -7124,6 +7271,21 @@ version = "1.1.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"+[[package]]+name = "static_vcruntime"+version = "3.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ff7589a1859b09232522bb9edf076ca7fcf14ded96685d3fa629db73023ffbb7"++[[package]]+name = "strict-num"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"+dependencies = [+ "float-cmp",+]+[[package]]name = "string_cache"version = "0.9.0"@@ -7202,6 +7364,16 @@ version = "2.6.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"+[[package]]+name = "svgtypes"+version = "0.15.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc"+dependencies = [+ "kurbo",+ "siphasher",+]+[[package]]name = "swift-rs"version = "1.0.9"@@ -7275,6 +7447,27 @@ dependencies = ["libc",]+[[package]]+name = "system-configuration"+version = "0.7.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b"+dependencies = [+ "bitflags 2.13.1",+ "core-foundation 0.9.4",+ "system-configuration-sys",+]++[[package]]+name = "system-configuration-sys"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"+dependencies = [+ "core-foundation-sys",+ "libc",+]+[[package]]name = "system-deps"version = "6.2.2"@@ -7364,9 +7557,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"[[package]]name = "tauri"-version = "2.12.3"+version = "2.12.5"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "c404ecf956ff241bf6b39dd688614724e1bf1f63255abb4fc46d1c40371672ea"+checksum = "5fb0244332cfb9cee7e2a568bf5da29a36ed8fdbd717f6f47a66b6b7b358c072"dependencies = ["anyhow","bytes",@@ -7416,9 +7609,9 @@ dependencies = [[[package]]name = "tauri-build"-version = "2.7.2"+version = "2.7.4"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "2eea0b6302f82c574b21af6fc6ae6e86183b9280853c22621d0abf0936911ffc"+checksum = "adddb0e648752aaac5da9c3c3c6a68e1e87cab55e3b757b18a9441ef8c3ac614"dependencies = ["anyhow","cargo_toml",@@ -7430,6 +7623,8 @@ dependencies = ["semver","serde","serde_json",+ "static_vcruntime",+ "strsim 0.11.1","tauri-utils","tauri-winres","walkdir",@@ -7437,9 +7632,9 @@ dependencies = [[[package]]name = "tauri-codegen"-version = "2.7.2"+version = "2.7.4"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "02f468f9a9bcd404f57e5c191d91024e3de953d4b610f78c2907e7110615cb1c"+checksum = "fb37631cf71dab5e8ab55e1bdd701e18a52653d90b78e71d0e5598b1e0a61316"dependencies = ["base64 0.23.1","brotli 9.0.0",@@ -7464,9 +7659,9 @@ dependencies = [[[package]]name = "tauri-macros"-version = "2.7.2"+version = "2.7.4"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "131bffec939b20642380317f8403a33c8888489925e14bb965ceaff0d949b1cb"+checksum = "0cc38db58854c10fb5f91a887ed8bf82d3239bb92b5d8db86eda09e96d9963d1"dependencies = ["heck 0.5.0","proc-macro2",@@ -7601,13 +7796,13 @@ dependencies = [[[package]]name = "tauri-plugin-notification"-version = "2.3.3"+version = "2.8.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "01fc2c5ff41105bd1f7242d8201fdf3efd70749b82fa013a17f2126357d194cc"+checksum = "14a226bfb8189ec4ab2c1936e66330ad06c44d9f6c54a674338208491dee177f"dependencies = ["log","notify-rust",- "rand 0.9.5",+ "rand 0.10.2","serde","serde_json","serde_repr",@@ -7616,6 +7811,7 @@ dependencies = ["thiserror 2.0.18","time","url",+ "zbus 5.14.0",][[package]]@@ -7666,9 +7862,9 @@ dependencies = [[[package]]name = "tauri-plugin-store"-version = "2.4.2"+version = "2.5.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "5ca1a8ff83c269b115e98726ffc13f9e548a10161544a92ad121d6d0a96e16ea"+checksum = "2981fb70ff65a4d2ffc4e366d8f3e45996a85fdb72af4f7ee274bcbda824fa37"dependencies = ["dunce","serde",@@ -7682,16 +7878,17 @@ dependencies = [[[package]]name = "tauri-plugin-updater"-version = "2.10.0"+version = "2.14.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "3fe8e9bebd88fc222938ffdfbdcfa0307081423bd01e3252fc337d8bde81fc61"+checksum = "d957abbcb3f9f6c76d22a3a0f012f30880640d0bccb5634d2b12a9937e4c872b"dependencies = [- "base64 0.22.1",- "dirs 6.0.0",+ "base64 0.23.1",+ "dirs 7.0.0","flate2","futures-util","http",- "infer 0.19.0",+ "infer",+ "libc","log","minisign-verify","osakit",@@ -7709,15 +7906,15 @@ dependencies = ["time","tokio","url",- "windows-sys 0.60.2",- "zip 4.6.1",+ "windows-sys 0.61.2",+ "zip 9.4.1",][[package]]name = "tauri-runtime"-version = "2.12.1"+version = "2.12.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "c2a57a2a9b8c8b7fc00d35b510fe808ded7f9f1b44fc1cdda6aee38632ea5413"+checksum = "7c55766d99cea69055904d1735b93c2049302b2e09effd462120deb5581d78e9"dependencies = ["cookie","dpi",@@ -7740,9 +7937,9 @@ dependencies = [[[package]]name = "tauri-runtime-wry"-version = "2.12.1"+version = "2.12.3"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "7f9e7e0c9f80a5130773cfabb6df4dc924518fb1b2c923726966804634b57d22"+checksum = "e1aa9d8b7a120f879f44fdc1053f7b7dbf416bf0bbc6a72b714dec46b782b52f"dependencies = ["gtk","http",@@ -7750,7 +7947,6 @@ dependencies = ["log","objc2","objc2-app-kit",- "once_cell","percent-encoding","raw-window-handle","softbuffer",@@ -7778,7 +7974,7 @@ dependencies = ["dunce","glob","http",- "infer 0.22.0",+ "infer","json-patch","log","memchr",@@ -7815,13 +8011,12 @@ dependencies = [[[package]]name = "tauri-winrt-notification"-version = "0.7.2"+version = "0.8.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "0b1e66e07de489fe43a46678dd0b8df65e0c973909df1b60ba33874e297ba9b9"+checksum = "f37a6c354fd28fc9e322ed9bd47e3959576dad28c9d58ea1cf888cce1c7ccb36"dependencies = [- "quick-xml 0.37.5","thiserror 2.0.18",- "windows 0.61.3",+ "windows 0.62.2","windows-version",]@@ -7898,16 +8093,16 @@ dependencies = [[[package]]name = "tiff"-version = "0.10.3"+version = "0.11.3"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "af9605de7fee8d9551863fd692cce7637f548dbd9db9180fcc07ccc6d26c336f"+checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52"dependencies = ["fax","flate2","half","quick-error","weezl 0.1.12",- "zune-jpeg 0.4.21",+ "zune-jpeg 0.5.15",][[package]]@@ -7950,6 +8145,32 @@ dependencies = ["crunchy",]+[[package]]+name = "tiny-skia"+version = "0.11.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab"+dependencies = [+ "arrayref",+ "arrayvec",+ "bytemuck",+ "cfg-if",+ "log",+ "png 0.17.16",+ "tiny-skia-path",+]++[[package]]+name = "tiny-skia-path"+version = "0.11.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93"+dependencies = [+ "arrayref",+ "bytemuck",+ "strict-num",+]+[[package]]name = "tinystr"version = "0.8.2"@@ -8267,6 +8488,21 @@ dependencies = ["tower-service",]+[[package]]+name = "tower-http"+version = "0.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "08a05a66a4fdd61cbbe0a1d755ffe0ca6aba159dd4820936a0ff8a8278245b9c"+dependencies = [+ "bitflags 2.13.1",+ "bytes",+ "http",+ "percent-encoding",+ "pin-project-lite",+ "tower-layer",+ "tower-service",+]+[[package]]name = "tower-layer"version = "0.3.3"@@ -8397,6 +8633,15 @@ version = "0.2.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"+[[package]]+name = "ttf-parser"+version = "0.24.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a"+dependencies = [+ "core_maths",+]+[[package]]name = "tungstenite"version = "0.24.0"@@ -8438,6 +8683,12 @@ version = "0.12.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "8e28f89b80c87b8fb0cf04ab448d5dd0dd0ade2f8891bae878de66a75a28600e"+[[package]]+name = "typed-path"+version = "0.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9ce898823d8cd0f028662d2f349694b1af0a5cc9be83f1d213a00d3147445e1e"+[[package]]name = "typeid"version = "1.0.3"@@ -8479,6 +8730,18 @@ version = "0.3.18"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5"+[[package]]+name = "unicode-bidi-mirroring"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "64af057ad7466495ca113126be61838d8af947f41d93a949980b2389a118082f"++[[package]]+name = "unicode-ccc"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "260bc6647b3893a9a90668360803a15f96b85a5257b1c3a0c3daf6ae2496de42"+[[package]]name = "unicode-ident"version = "1.0.24"@@ -8500,12 +8763,24 @@ version = "0.1.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d"+[[package]]+name = "unicode-script"+version = "0.5.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aa04c955db05429d464c74d495c1ee677e1866e783a4c3747f9c0cef7756cabf"+[[package]]name = "unicode-segmentation"version = "1.12.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"+[[package]]+name = "unicode-vo"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94"+[[package]]name = "unicode-width"version = "0.2.2"@@ -8567,6 +8842,33 @@ dependencies = ["url",]+[[package]]+name = "usvg"+version = "0.44.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7447e703d7223b067607655e625e0dbca80822880248937da65966194c4864e6"+dependencies = [+ "base64 0.22.1",+ "data-url",+ "flate2",+ "fontdb",+ "imagesize",+ "kurbo",+ "log",+ "pico-args",+ "roxmltree",+ "rustybuzz",+ "simplecss",+ "siphasher",+ "strict-num",+ "svgtypes",+ "tiny-skia-path",+ "unicode-bidi",+ "unicode-script",+ "unicode-vo",+ "xmlwriter",+]+[[package]]name = "utf-8"version = "0.7.6"@@ -10004,6 +10306,12 @@ dependencies = ["markup5ever 0.38.0",]+[[package]]+name = "xmlwriter"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"+[[package]]name = "xz2"version = "0.1.7"@@ -10245,28 +10553,32 @@ dependencies = [[[package]]name = "zip"-version = "4.6.1"+version = "8.6.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "caa8cd6af31c3b31c6631b8f483848b91589021b28fffe50adada48d4f4d2ed1"+checksum = "2d04a6b5381502aa6087c94c669499eb1602eb9c5e8198e534de571f7154809b"dependencies = [- "arbitrary","crc32fast",+ "flate2","indexmap 2.14.2","memchr",+ "typed-path 0.12.3",+ "zopfli",][[package]]name = "zip"-version = "8.6.0"+version = "9.4.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "2d04a6b5381502aa6087c94c669499eb1602eb9c5e8198e534de571f7154809b"+checksum = "23f17fbc870bfac28c6228aed7d6e6df352e26bf7015c4313727e16a7a01ce5e"dependencies = ["crc32fast",- "flate2",+ "getrandom 0.4.1","indexmap 2.14.2",+ "libc","memchr",- "typed-path",- "zopfli",+ "nix 0.31.3",+ "typed-path 0.13.0",+ "windows-sys 0.61.2",][[package]]diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.tomlindex c63ea8fa..2d5eac9e 100644--- a/src-tauri/Cargo.toml+++ b/src-tauri/Cargo.toml@@ -13,7 +13,7 @@ resolver = "2"[package]name = "libreget"-version = "0.16.10"+version = "1.0.0"description = "LibreGet — Universal Downloader & Media Player"authors = ["OpenSelena"]edition = "2021"@@ -50,7 +50,7 @@ tracing = "0.1"tracing-subscriber = "0.3"uuid = { version = "1", features = ["v4"] }axum = { version = "0.8", default-features = false, features = ["http1", "json", "tokio"] }-tower-http = { version = "0.6", features = ["cors"] }+tower-http = { version = "0.7", features = ["cors"] }constant_time_eq = "0.6"socket2 = "0.6"chrono = { version = "0.4", features = ["serde"] }@@ -112,7 +112,7 @@ webkit2gtk = { version = "=2.0.2", features = ["v2_38"] }[target.'cfg(any(target_os = "macos", windows, target_os = "linux"))'.dependencies]tauri-plugin-process = "2.4"-tauri-plugin-updater = "2.10.0"+tauri-plugin-updater = "2.14.1"tauri-plugin-global-shortcut = "2"tauri-plugin-clipboard-manager = "2.5"tauri-plugin-single-instance = "2"diff --git a/src-tauri/libreget-cli/src/commands/common.rs b/src-tauri/libreget-cli/src/commands/common.rsindex 2beb5889..f8b49ed4 100644--- a/src-tauri/libreget-cli/src/commands/common.rs+++ b/src-tauri/libreget-cli/src/commands/common.rs@@ -8,7 +8,7 @@ use libreget_core::core::ytdlp;use libreget_core::models::media::{DownloadOptions, MediaInfo};use libreget_core::models::settings::ProxySettings;use libreget_core::platforms::{- BilibiliDownloader, BlueskyDownloader, DirectFileDownloader, DouyinDownloader,+ BilibiliDownloader, BlueskyDownloader, DirectFileDownloader, DouyinDownloader, GdocsDownloader,GenericYtdlpDownloader, InstagramDownloader, P2pDownloader, PinterestDownloader,PlatformDownloader, RedditDownloader, ThreadsDownloader, TikTokDownloader,TwitchClipsDownloader, TwitterDownloader, VimeoDownloader, YouTubeDownloader,@@ -93,6 +93,7 @@ pub fn core_platform_registry() -> PlatformRegistry {registry.register(Arc::new(BilibiliDownloader::new()));registry.register(Arc::new(DouyinDownloader::new()));registry.register(Arc::new(P2pDownloader::new()));+ registry.register(Arc::new(GdocsDownloader::new()));registry.register(Arc::new(DirectFileDownloader::new()));registry.register(Arc::new(GenericYtdlpDownloader::new()));registrydiff --git a/src-tauri/libreget-core/Cargo.toml b/src-tauri/libreget-core/Cargo.tomlindex 5f8a89c1..082cab9f 100644--- a/src-tauri/libreget-core/Cargo.toml+++ b/src-tauri/libreget-core/Cargo.toml@@ -65,6 +65,8 @@ trash = "5"enigo = { version = "0.6", default-features = false, features = ["x11rb"] }fs4 = "1"image = { version = "0.25", default-features = false, features = ["jpeg", "png", "webp", "gif", "ico"] }+# Renderizado vectorial SVG (Google Slides / Calameo -> PDF 16:9) em Rust puro.+resvg = "0.44"# Tags de audio (ID3/Vorbis/MP4) em Rust puro, sem binario externo.lofty = "0.25"# HTML -> Markdown para exportar posts (Substack/Medium), mesmo padrao do pdf-to-markdown.diff --git a/src-tauri/libreget-core/src/core/dependencies.rs b/src-tauri/libreget-core/src/core/dependencies.rsindex ab982701..78c1f0bb 100644--- a/src-tauri/libreget-core/src/core/dependencies.rs+++ b/src-tauri/libreget-core/src/core/dependencies.rs@@ -7,7 +7,7 @@ pub fn is_flatpak() -> bool {std::path::Path::new("/.flatpak-info").exists() || std::env::var("FLATPAK_ID").is_ok()}-pub(crate) fn managed_bin_dir() -> Option<PathBuf> {+pub fn managed_bin_dir() -> Option<PathBuf> {Some(crate::core::paths::app_data_dir()?.join("bin"))}@@ -774,10 +774,15 @@ async fn download_deno() -> anyhow::Result<PathBuf> {tracing::info!("Downloading Deno JS runtime from {}", url);+ let asset_name = url.rsplit('/').next().unwrap_or("deno.zip");+ let sums_url = format!("{url}.sha256sum");+let client = crate::core::http_client::apply_global_proxy(reqwest::Client::builder()).timeout(std::time::Duration::from_secs(300)).build()?;+ let expected_sha256 = integrity::expected_from_sums_url(&client, &sums_url, asset_name).await?;+let response = client.get(url).send().await?;if !response.status().is_success() {return Err(anyhow!(@@ -787,6 +792,7 @@ async fn download_deno() -> anyhow::Result<PathBuf> {}let bytes = response.bytes().await?;+ integrity::verify_sha256(&bytes, &expected_sha256, "deno")?;let data = bytes.to_vec();let bin_dir_clone = bin_dir.clone();let deno_name_clone = deno_name.clone();@@ -855,14 +861,23 @@ pub async fn ensure_gallerydl() -> Option<PathBuf> {None}-async fn download_gallerydl() -> anyhow::Result<PathBuf> {+pub async fn update_gallerydl() -> anyhow::Result<PathBuf> {+ if is_flatpak() {+ if let Some((_, "flatpak")) = find_tool_with_source("gallery-dl").await {+ return Err(anyhow!(+ "gallery-dl is provided by the Flatpak runtime and cannot be updated from inside the app"+ ));+ }+ }+ download_gallerydl().await+}++pub async fn download_gallerydl() -> anyhow::Result<PathBuf> {let bin_dir = managed_bin_dir().ok_or_else(|| anyhow!("Could not determine data directory"))?;std::fs::create_dir_all(&bin_dir)?;let target = bin_dir.join(bin_name("gallery-dl"));- // Os executaveis standalone vivem no repo gdl-org/builds (Windows, Linux- // e macOS); o release do mikf/gallery-dl nao publica mais assets.#[cfg(target_os = "windows")]let url = "https://github.com/gdl-org/builds/releases/latest/download/gallery-dl_windows.exe";#[cfg(target_os = "linux")]@@ -885,26 +900,72 @@ async fn download_gallerydl() -> anyhow::Result<PathBuf> {}let bytes = response.bytes().await?;+ if bytes.len() < 1_000_000 {+ return Err(anyhow!(+ "Downloaded gallery-dl file is too small ({}B) — likely an error page",+ bytes.len()+ ));+ }++ let temp_path = bin_dir.join(".gallery-dl_download.tmp");let data = bytes.to_vec();- let target_clone = target.clone();+ let temp_clone = temp_path.clone();tokio::task::spawn_blocking(move || -> anyhow::Result<()> {- std::fs::write(&target_clone, &data)?;+ std::fs::write(&temp_clone, &data)?;#[cfg(unix)]{use std::os::unix::fs::PermissionsExt;- let mut perm = std::fs::metadata(&target_clone)?.permissions();+ let mut perm = std::fs::metadata(&temp_clone)?.permissions();perm.set_mode(0o755);- std::fs::set_permissions(&target_clone, perm)?;+ std::fs::set_permissions(&temp_clone, perm)?;}Ok(())}).await- .map_err(|e| anyhow!("Spawn blocking failed: {}", e))??;+ .map_err(|e| anyhow!("spawn_blocking failed: {}", e))??;- if !target.exists() {- return Err(anyhow!("gallery-dl binary not found after download"));+ replace_managed_binary(&temp_path, &target)?;++ #[cfg(target_os = "macos")]+ {+ let mac_target = target.clone();+ let _ = tokio::task::spawn_blocking(move || {+ let _ = crate::core::process::std_command("xattr")+ .args(["-d", "com.apple.quarantine"])+ .arg(&mac_target)+ .output();+ let _ = crate::core::process::std_command("codesign")+ .args(["-s", "-", "-f"])+ .arg(&mac_target)+ .output();+ })+ .await;+ }++ let verify = {+ let verify_target = target.clone();+ tokio::task::spawn_blocking(move || {+ crate::core::process::std_command(&verify_target)+ .arg("--version")+ .stdout(Stdio::null())+ .stderr(Stdio::null())+ .status()+ })+ .await+ .map_err(|e| anyhow!("spawn_blocking failed: {}", e))?+ };+ match verify {+ Ok(s) if s.success() => {}+ Ok(s) => {+ return Err(anyhow!(+ "gallery-dl installed but failed to execute (exit code {})",+ s+ ))+ }+ Err(e) => return Err(anyhow!("gallery-dl installed but failed to execute: {}", e)),}+ tracing::info!("gallery-dl installed to {}", target.display());Ok(target)}diff --git a/src-tauri/libreget-core/src/core/hls_downloader.rs b/src-tauri/libreget-core/src/core/hls_downloader.rsindex cad58af6..35b2e05f 100644--- a/src-tauri/libreget-core/src/core/hls_downloader.rs+++ b/src-tauri/libreget-core/src/core/hls_downloader.rs@@ -570,7 +570,22 @@ fn resolve_url(base: &str, relative: &str) -> String {None => (base, None),};- let resolved = if let Some(pos) = base_path.rfind('/') {+ // Protocol-relative (`//host/path`): only the playlist's scheme carries over.+ if let Some(rest) = relative.strip_prefix("//") {+ return match base_path.split_once("://") {+ Some((scheme, _)) => format!("{}://{}", scheme, rest),+ None => relative.to_string(),+ };+ }++ let resolved = if relative.starts_with('/') {+ // Root-relative (`/path`): resolved against the playlist's origin,+ // not its directory.+ match url_origin(base_path) {+ Some(origin) => format!("{}{}", origin, relative),+ None => relative.to_string(),+ }+ } else if let Some(pos) = base_path.rfind('/') {format!("{}/{}", &base_path[..pos], relative)} else {relative.to_string()@@ -949,6 +964,43 @@ mod tests {);}+ #[test]+ fn resolve_url_root_relative() {+ assert_eq!(+ resolve_url(+ "https://cdn.example.com/path/master.m3u8",+ "/hls/v1/segment0.ts"+ ),+ "https://cdn.example.com/hls/v1/segment0.ts"+ );+ assert_eq!(+ resolve_url("http://localhost:8080/live/a/index.m3u8", "/keys/1.key"),+ "http://localhost:8080/keys/1.key"+ );+ }++ #[test]+ fn resolve_url_root_relative_propagates_query() {+ assert_eq!(+ resolve_url(+ "https://cdn.example.com/path/master.m3u8?token=abc",+ "/hls/v1/segment0.ts"+ ),+ "https://cdn.example.com/hls/v1/segment0.ts?token=abc"+ );+ }++ #[test]+ fn resolve_url_protocol_relative() {+ assert_eq!(+ resolve_url(+ "https://cdn.example.com/path/master.m3u8?token=abc",+ "//cdn2.example.com/v1/segment0.ts"+ ),+ "https://cdn2.example.com/v1/segment0.ts"+ );+ }+#[test]fn resolve_url_no_slash_in_base() {assert_eq!(resolve_url("master.m3u8", "segment0.ts"), "segment0.ts");diff --git a/src-tauri/libreget-core/src/core/leftovers.rs b/src-tauri/libreget-core/src/core/leftovers.rsnew file mode 100644index 00000000..17484872--- /dev/null+++ b/src-tauri/libreget-core/src/core/leftovers.rs@@ -0,0 +1,314 @@+use std::collections::HashMap;+use std::path::{Path, PathBuf};+use std::sync::{Mutex, OnceLock};++use serde::Serialize;++#[derive(Debug, Clone, PartialEq, Eq, Serialize)]+pub struct LeftoverFile {+ pub path: String,+ pub name: String,+ pub size_bytes: u64,+}++const STORE_FILE: &str = "download-leftovers.json";+const MAX_TASKS: usize = 300;++type Registry = HashMap<u64, Vec<PathBuf>>;++fn store_path() -> Option<PathBuf> {+ if cfg!(test) {+ return None;+ }+ crate::core::paths::app_data_dir().map(|d| d.join(STORE_FILE))+}++fn load_from(path: &Path) -> Registry {+ std::fs::read_to_string(path)+ .ok()+ .and_then(|raw| serde_json::from_str(&raw).ok())+ .unwrap_or_default()+}++fn save_to(path: &Path, map: &Registry) -> std::io::Result<()> {+ if let Some(parent) = path.parent() {+ std::fs::create_dir_all(parent)?;+ }+ let mut ids: Vec<u64> = map.keys().copied().collect();+ ids.sort_unstable();+ let keep: Registry = ids+ .into_iter()+ .rev()+ .take(MAX_TASKS)+ .filter_map(|id| map.get(&id).map(|p| (id, p.clone())))+ .collect();+ let json = serde_json::to_string(&keep).map_err(std::io::Error::other)?;+ let tmp = path.with_extension("json.tmp");+ std::fs::write(&tmp, json)?;+ std::fs::rename(&tmp, path)+}++fn persist(map: &Registry) {+ if let Some(path) = store_path() {+ if let Err(e) = save_to(&path, map) {+ tracing::warn!("[leftovers] could not save {}: {}", path.display(), e);+ }+ }+}++fn registry() -> &'static Mutex<Registry> {+ static REGISTRY: OnceLock<Mutex<Registry>> = OnceLock::new();+ REGISTRY.get_or_init(|| Mutex::new(store_path().map(|p| load_from(&p)).unwrap_or_default()))+}++pub fn note_task_destination(id: u64, path: &Path) {+ if let Ok(mut map) = registry().lock() {+ let paths = map.entry(id).or_default();+ if !paths.iter().any(|p| p == path) {+ paths.push(path.to_path_buf());+ persist(&map);+ }+ }+}++pub fn forget_task_destinations(id: u64) {+ if let Ok(mut map) = registry().lock() {+ if map.remove(&id).is_some() {+ persist(&map);+ }+ }+}++fn is_fragment_suffix(rest: &str) -> bool {+ let Some(tail) = rest.strip_prefix(".part-Frag") else {+ return false;+ };+ let digits = tail.strip_suffix(".part").unwrap_or(tail);+ !digits.is_empty() && digits.chars().all(|c| c.is_ascii_digit())+}++fn is_stream_file_name(name: &str) -> bool {+ let mut parts = name.rsplit('.');+ let _extension = parts.next();+ parts.next().is_some_and(|format| {+ format+ .strip_prefix('f')+ .is_some_and(|f| f.chars().next().is_some_and(|c| c.is_ascii_digit()))+ })+}++fn merge_temp_name(destination: &str) -> Option<String> {+ let (stem, extension) = destination.rsplit_once('.')?;+ Some(format!("{stem}.temp.{extension}"))+}++fn is_partial_of(candidate: &str, destination: &str) -> bool {+ if merge_temp_name(destination).as_deref() == Some(candidate) {+ return true;+ }+ let Some(rest) = candidate.strip_prefix(destination) else {+ return false;+ };+ if rest.is_empty() {+ return is_stream_file_name(destination);+ }+ matches!(rest, ".part" | ".ytdl" | ".aria2" | ".temp") || is_fragment_suffix(rest)+}++pub fn find_leftovers(destinations: &[PathBuf], finished: Option<&Path>) -> Vec<PathBuf> {+ let mut found: Vec<PathBuf> = Vec::new();+ let mut folders: Vec<&Path> = destinations.iter().filter_map(|d| d.parent()).collect();+ folders.sort();+ folders.dedup();+ for folder in folders {+ let names: Vec<String> = destinations+ .iter()+ .filter(|d| d.parent() == Some(folder))+ .filter_map(|d| d.file_name().map(|n| n.to_string_lossy().into_owned()))+ .collect();+ let Ok(entries) = std::fs::read_dir(folder) else {+ continue;+ };+ for entry in entries.flatten() {+ let path = entry.path();+ if finished == Some(path.as_path()) {+ continue;+ }+ let is_regular = entry+ .metadata()+ .map(|m| m.file_type().is_file())+ .unwrap_or(false);+ if !is_regular {+ continue;+ }+ let name = entry.file_name();+ let name = name.to_string_lossy();+ if names.iter().any(|d| is_partial_of(&name, d)) {+ found.push(path);+ }+ }+ }+ found.sort();+ found+}++pub fn task_leftovers(id: u64, finished: Option<&Path>) -> Vec<LeftoverFile> {+ let destinations = match registry().lock() {+ Ok(map) => map.get(&id).cloned().unwrap_or_default(),+ Err(_) => Vec::new(),+ };+ find_leftovers(&destinations, finished)+ .into_iter()+ .map(|path| LeftoverFile {+ size_bytes: std::fs::metadata(&path).map(|m| m.len()).unwrap_or(0),+ name: path+ .file_name()+ .map(|n| n.to_string_lossy().into_owned())+ .unwrap_or_else(|| path.to_string_lossy().into_owned()),+ path: path.to_string_lossy().into_owned(),+ })+ .collect()+}++pub fn delete_task_leftovers(id: u64, finished: Option<&Path>) -> usize {+ let mut deleted = 0;+ for file in task_leftovers(id, finished) {+ if std::fs::remove_file(&file.path).is_ok() {+ deleted += 1;+ }+ }+ deleted+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn destinations_survive_a_restart() {+ let dir =+ std::env::temp_dir().join(format!("libreget-leftovers-store-{}", std::process::id()));+ let file = dir.join(STORE_FILE);+ let mut map = Registry::new();+ map.insert(7, vec![dir.join("Clip.mp4")]);+ save_to(&file, &map).unwrap();+ assert_eq!(load_from(&file), map);+ let _ = std::fs::remove_dir_all(&dir);+ }++ #[test]+ fn the_store_keeps_only_the_newest_tasks() {+ let dir =+ std::env::temp_dir().join(format!("libreget-leftovers-cap-{}", std::process::id()));+ let file = dir.join(STORE_FILE);+ let map: Registry = (0..(MAX_TASKS as u64 + 5))+ .map(|id| (id, vec![PathBuf::from("x")]))+ .collect();+ save_to(&file, &map).unwrap();+ let loaded = load_from(&file);+ assert_eq!(loaded.len(), MAX_TASKS);+ assert!(loaded.contains_key(&(MAX_TASKS as u64 + 4)));+ assert!(!loaded.contains_key(&0));+ let _ = std::fs::remove_dir_all(&dir);+ }++ fn folder(name: &str) -> PathBuf {+ let dir = std::env::temp_dir().join(format!(+ "libreget-leftovers-{}-{}",+ name,+ std::process::id()+ ));+ let _ = std::fs::remove_dir_all(&dir);+ std::fs::create_dir_all(&dir).unwrap();+ dir+ }++ fn touch(dir: &Path, name: &str) -> PathBuf {+ let path = dir.join(name);+ std::fs::write(&path, b"x").unwrap();+ path+ }++ fn names(paths: &[PathBuf]) -> Vec<String> {+ paths+ .iter()+ .map(|p| p.file_name().unwrap().to_string_lossy().into_owned())+ .collect()+ }++ #[test]+ fn finds_the_partial_files_of_the_task_and_nothing_else() {+ let dir = folder("own");+ let video = dir.join("Clip [a].f137.mp4");+ let merged = dir.join("Clip [a].mp4");+ touch(&dir, "Clip [a].f137.mp4");+ touch(&dir, "Clip [a].f137.mp4.part");+ touch(&dir, "Clip [a].f137.mp4.ytdl");+ touch(&dir, "Clip [a].f137.mp4.part-Frag12");+ touch(&dir, "Clip [a].f137.mp4.part-Frag13.part");+ touch(&dir, "Clip [a].temp.mp4");+ touch(&dir, "Other [b].f137.mp4.part");+ touch(&dir, "Other [b].mp4");+ touch(&dir, "notes.txt");+ let found = find_leftovers(&[video, merged], None);+ assert_eq!(+ names(&found),+ vec![+ "Clip [a].f137.mp4",+ "Clip [a].f137.mp4.part",+ "Clip [a].f137.mp4.part-Frag12",+ "Clip [a].f137.mp4.part-Frag13.part",+ "Clip [a].f137.mp4.ytdl",+ "Clip [a].temp.mp4",+ ]+ );+ std::fs::remove_dir_all(dir).unwrap();+ }++ #[test]+ fn a_finished_file_is_never_a_leftover() {+ let dir = folder("finished");+ let merged = touch(&dir, "Clip [a].mp4");+ assert!(find_leftovers(std::slice::from_ref(&merged), None).is_empty());+ std::fs::remove_dir_all(dir).unwrap();+ }++ #[test]+ fn the_finished_path_is_kept_even_when_its_name_looks_partial() {+ let dir = folder("kept");+ let odd = touch(&dir, "Take.f1.mp4");+ assert!(find_leftovers(std::slice::from_ref(&odd), Some(&odd)).is_empty());+ std::fs::remove_dir_all(dir).unwrap();+ }++ #[test]+ fn a_similar_title_in_the_same_folder_is_not_touched() {+ let dir = folder("similar");+ let dest = dir.join("Clip.mp4");+ touch(&dir, "Clip.mp4.part");+ let lookalike = touch(&dir, "Clip.mp4.part2");+ let found = find_leftovers(&[dest], None);+ assert_eq!(names(&found), vec!["Clip.mp4.part"]);+ assert!(lookalike.exists());+ std::fs::remove_dir_all(dir).unwrap();+ }++ #[test]+ fn deleting_removes_only_what_the_task_recorded() {+ let dir = folder("delete");+ let id = 900_000_001;+ note_task_destination(id, &dir.join("Clip.f137.mp4"));+ let part = touch(&dir, "Clip.f137.mp4.part");+ let other = touch(&dir, "Clip.mp4");+ assert_eq!(delete_task_leftovers(id, None), 1);+ assert!(!part.exists());+ assert!(other.exists());+ forget_task_destinations(id);+ std::fs::remove_dir_all(dir).unwrap();+ }++ #[test]+ fn a_task_that_recorded_nothing_offers_nothing() {+ assert!(task_leftovers(900_000_002, None).is_empty());+ }+}diff --git a/src-tauri/libreget-core/src/core/mod.rs b/src-tauri/libreget-core/src/core/mod.rsindex 17548fda..f4b407a7 100644--- a/src-tauri/libreget-core/src/core/mod.rs+++ b/src-tauri/libreget-core/src/core/mod.rs@@ -17,6 +17,7 @@ pub mod http_client;pub mod http_fetcher;pub mod hwaccel;pub mod impersonation;+pub mod leftovers;pub mod livechat;pub mod log_hook;pub mod media_processor;diff --git a/src-tauri/libreget-core/src/core/tools/gdocs.rs b/src-tauri/libreget-core/src/core/tools/gdocs.rsindex 2f0a549f..9c1e5baa 100644--- a/src-tauri/libreget-core/src/core/tools/gdocs.rs+++ b/src-tauri/libreget-core/src/core/tools/gdocs.rs@@ -11,24 +11,49 @@ pub struct GdocInfo {pub kind: String,pub id: String,pub formats: Vec<String>,+ #[serde(default)]+ pub is_published: bool,}pub fn parse(url: &str) -> Option<GdocInfo> {+ let pub_re = regex::Regex::new(+ r"docs\.google\.com/(document|presentation|spreadsheets)/d/e/([A-Za-z0-9_-]+)",+ )+ .ok()?;+ if let Some(c) = pub_re.captures(url) {+ let kind = c[1].to_string();+ let formats = match kind.as_str() {+ "presentation" => vec!["pdf", "svg"],+ "document" => vec!["pdf", "html"],+ _ => vec!["pdf", "csv"],+ };+ return Some(GdocInfo {+ kind,+ id: c[2].to_string(),+ formats: formats.into_iter().map(String::from).collect(),+ is_published: true,+ });+ }+let re = regex::Regex::new(r"docs\.google\.com/(document|presentation|spreadsheets)/d/([A-Za-z0-9_-]+)",).ok()?;let c = re.captures(url)?;+ if &c[2] == "e" {+ return None;+ }let kind = c[1].to_string();let formats = match kind.as_str() {"document" => vec!["pdf", "docx", "odt", "txt", "epub", "html"],- "presentation" => vec!["pdf", "pptx", "odp", "txt"],+ "presentation" => vec!["pdf", "pptx", "odp", "txt", "svg"],_ => vec!["pdf", "xlsx", "ods", "csv"],};Some(GdocInfo {kind,id: c[2].to_string(),formats: formats.into_iter().map(String::from).collect(),+ is_published: false,})}@@ -68,16 +93,39 @@ pub async fn download(info.kind));}- let client = super::client()?;++ if info.kind == "presentation" && (info.is_published || format == "svg") {+ let res = super::gslides::download_presentation(url, format, dest_dir, progress).await?;+ return Ok(res.output_path);+ }++ let client = super::gslides::build_google_client(Some(url)).or_else(|_| super::client())?;let export = export_url(&info, format);let resp = client.get(&export).send().await?;- if resp.status().as_u16() == 401 || resp.status().as_u16() == 403 {+ let status = resp.status();+ let is_html_redirect = resp+ .headers()+ .get(reqwest::header::CONTENT_TYPE)+ .and_then(|v| v.to_str().ok())+ .map(|ct| ct.to_ascii_lowercase().starts_with("text/html") && format != "html")+ .unwrap_or(false);++ if (!status.is_success() || is_html_redirect) && info.kind == "presentation" && format == "pdf"+ {+ if let Ok(res) =+ super::gslides::download_presentation(url, "pdf", dest_dir, progress.clone()).await+ {+ return Ok(res.output_path);+ }+ }++ if status.as_u16() == 401 || status.as_u16() == 403 {return Err(anyhow!("o arquivo nao e publico; abra no navegador e use Arquivo > Fazer download"));}- if !resp.status().is_success() {- return Err(anyhow!("Google Docs: HTTP {}", resp.status()));+ if !status.is_success() {+ return Err(anyhow!("Google Docs: HTTP {}", status));}let name = resp.headers()@@ -110,11 +158,21 @@ mod tests {let i = parse("https://docs.google.com/presentation/d/1AbC_d-e/edit#slide=1").unwrap();assert_eq!(i.kind, "presentation");assert_eq!(i.id, "1AbC_d-e");+ assert!(!i.is_published);assert!(parse("https://drive.google.com/x").is_none());assert_eq!(export_url(&i, "pdf"),"https://docs.google.com/presentation/d/1AbC_d-e/export?format=pdf");++ let pub_i = parse("https://docs.google.com/presentation/d/e/2PACX-1vMockDummyId1234567890abcdefghijklmnopqrstuvwxyz/pubembed?start=false&loop=false").unwrap();+ assert_eq!(pub_i.kind, "presentation");+ assert!(pub_i.is_published);+ assert_eq!(+ pub_i.id,+ "2PACX-1vMockDummyId1234567890abcdefghijklmnopqrstuvwxyz"+ );+ assert_eq!(pub_i.formats, vec!["pdf".to_string(), "svg".to_string()]);}#[test]diff --git a/src-tauri/libreget-core/src/core/tools/gslides.rs b/src-tauri/libreget-core/src/core/tools/gslides.rsnew file mode 100644index 00000000..200500c7--- /dev/null+++ b/src-tauri/libreget-core/src/core/tools/gslides.rs@@ -0,0 +1,931 @@+//! Extractor y compilador vectorial de Google Slides a PDF panorámico (16:9).+//!+//! Soporta:+//! 1. Enlaces publicados en la web (`/presentation/d/e/2PACX-.../pubembed` o `/pub`),+//! los cuales no disponen de `/export?format=pdf` (devuelven HTTP 404).+//! 2. Presentaciones restringidas donde `/export?format=pdf` devuelve 401/403 pero el+//! visor (`/embed` o `/htmlpresent`) entrega las diapositivas en bloques `SK_svgData`.+//! 3. Compilación local de carpetas de archivos `.svg` ordenados numéricamente (`resvg` ++//! `tiny-skia` -> PDF 16:9 de `1280 x 720 pt`) y recepción desde el script JS del+//! navegador a través del `local_bridge`.++use std::collections::{HashMap, HashSet};+use std::path::{Path, PathBuf};+use std::sync::{Arc, OnceLock};++use anyhow::{anyhow, Context};+use base64::Engine;+use futures::stream::{self, StreamExt};+use image::codecs::jpeg::JpegEncoder;+use image::ColorType;+use regex::Regex;+use resvg::{tiny_skia, usvg};+use serde::{Deserialize, Serialize};++pub const SLIDE_WIDTH_PT: f64 = 1280.0;+pub const SLIDE_HEIGHT_PT: f64 = 720.0;++/// Resolución de rasterizado en píxeles (Full HD 16:9) sobre página física de 1280x720 pt.+const RENDER_WIDTH_PX: u32 = 1920;+const RENDER_HEIGHT_PX: u32 = 1080;+const JPEG_QUALITY: u8 = 92;++#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+pub struct GslidesTarget {+ pub id: String,+ pub is_published: bool,+}++impl GslidesTarget {+ pub fn viewer_url(&self) -> String {+ if self.is_published {+ format!(+ "https://docs.google.com/presentation/d/e/{}/pubembed?start=false&loop=false",+ self.id+ )+ } else {+ format!(+ "https://docs.google.com/presentation/d/{}/embed?start=false&loop=false",+ self.id+ )+ }+ }++ pub fn htmlpresent_url(&self) -> String {+ if self.is_published {+ format!("https://docs.google.com/presentation/d/e/{}/pub", self.id)+ } else {+ format!(+ "https://docs.google.com/presentation/d/{}/htmlpresent",+ self.id+ )+ }+ }+}++#[derive(Debug, Clone, Serialize, Deserialize)]+pub struct GslidesDownloadResult {+ pub title: String,+ pub pages: usize,+ pub output_path: String,+ pub format: String,+}++#[derive(Debug, Clone)]+pub struct ExtractedPresentation {+ pub title: String,+ pub svgs: Vec<String>,+}++/// Reconoce tanto `/presentation/d/e/2PACX-...` como `/presentation/d/{id}`.+pub fn parse_gslides_url(url: &str) -> Option<GslidesTarget> {+ static PUB_RE: OnceLock<Regex> = OnceLock::new();+ static DOC_RE: OnceLock<Regex> = OnceLock::new();++ let pub_re = PUB_RE.get_or_init(|| {+ Regex::new(r"docs\.google\.com/presentation/d/e/([A-Za-z0-9_-]+)").unwrap()+ });+ if let Some(c) = pub_re.captures(url) {+ return Some(GslidesTarget {+ id: c[1].to_string(),+ is_published: true,+ });+ }++ let doc_re = DOC_RE+ .get_or_init(|| Regex::new(r"docs\.google\.com/presentation/d/([A-Za-z0-9_-]+)").unwrap());+ let c = doc_re.captures(url)?;+ let id = &c[1];+ if id == "e" {+ return None;+ }+ Some(GslidesTarget {+ id: id.to_string(),+ is_published: false,+ })+}++/// Decodifica cadenas literales de JavaScript como las que emite Google Slides+/// en `SK_svgData = '\x3csvg version\x3d\x221.1\x22 ...'`.+pub fn unescape_js_string(raw: &str) -> String {+ let mut out = String::with_capacity(raw.len());+ let bytes = raw.as_bytes();+ let mut i = 0;+ while i < bytes.len() {+ if bytes[i] == b'\\' && i + 1 < bytes.len() {+ match bytes[i + 1] {+ b'x' if i + 3 < bytes.len() => {+ if let Ok(hex_str) = std::str::from_utf8(&bytes[i + 2..i + 4]) {+ if let Ok(val) = u8::from_str_radix(hex_str, 16) {+ out.push(val as char);+ i += 4;+ continue;+ }+ }+ }+ b'u' if i + 5 < bytes.len() => {+ if let Ok(hex_str) = std::str::from_utf8(&bytes[i + 2..i + 6]) {+ if let Ok(val) = u32::from_str_radix(hex_str, 16) {+ if let Some(ch) = char::from_u32(val) {+ out.push(ch);+ i += 6;+ continue;+ }+ }+ }+ }+ b'/' => {+ out.push('/');+ i += 2;+ continue;+ }+ b'\\' => {+ out.push('\\');+ i += 2;+ continue;+ }+ b'\'' => {+ out.push('\'');+ i += 2;+ continue;+ }+ b'"' => {+ out.push('"');+ i += 2;+ continue;+ }+ b'n' => {+ out.push('\n');+ i += 2;+ continue;+ }+ b'r' => {+ out.push('\r');+ i += 2;+ continue;+ }+ b't' => {+ out.push('\t');+ i += 2;+ continue;+ }+ _ => {}+ }+ }+ // Avanza un carácter UTF-8 válido+ let rest = &raw[i..];+ if let Some(ch) = rest.chars().next() {+ out.push(ch);+ i += ch.len_utf8();+ } else {+ break;+ }+ }+ out+}++/// Fija explícitamente `width="1280px" height="720px" viewBox="0 0 1280 720"`+/// en el elemento `<svg>` raíz si aún no tiene `width`/`height` explícitos,+/// preservando el `viewBox` original si ya es proporcional o asignando `0 0 1280 720`.+pub fn normalize_slide_svg_geometry(svg: &str) -> String {+ let trimmed = svg.trim();+ let Some(svg_start) = trimmed.find("<svg") else {+ return trimmed.to_string();+ };+ let Some(tag_end_rel) = trimmed[svg_start..].find('>') else {+ return trimmed.to_string();+ };+ let tag_end = svg_start + tag_end_rel;+ let open_tag = &trimmed[svg_start..=tag_end];++ static WIDTH_RE: OnceLock<Regex> = OnceLock::new();+ static HEIGHT_RE: OnceLock<Regex> = OnceLock::new();+ static VIEWBOX_RE: OnceLock<Regex> = OnceLock::new();++ let width_re = WIDTH_RE.get_or_init(|| Regex::new(r#"\bwidth\s*=\s*"[^"]*""#).unwrap());+ let height_re = HEIGHT_RE.get_or_init(|| Regex::new(r#"\bheight\s*=\s*"[^"]*""#).unwrap());+ let viewbox_re = VIEWBOX_RE.get_or_init(|| Regex::new(r#"\bviewBox\s*=\s*"[^"]*""#).unwrap());++ let mut cleaned = width_re.replace_all(open_tag, "").into_owned();+ cleaned = height_re.replace_all(&cleaned, "").into_owned();+ if !viewbox_re.is_match(&cleaned) {+ cleaned = cleaned.replacen("<svg", r#"<svg viewBox="0 0 1280 720""#, 1);+ }+ cleaned = cleaned.replacen("<svg", r#"<svg width="1280px" height="720px""#, 1);++ let mut result = String::with_capacity(trimmed.len() + 48);+ result.push_str(&trimmed[..svg_start]);+ result.push_str(&cleaned);+ result.push_str(&trimmed[tag_end + 1..]);+ result+}++fn clean_presentation_title(raw: &str) -> String {+ let mut t = raw+ .replace("&", "&")+ .replace(""", "\"")+ .replace("'", "'")+ .replace("<", "<")+ .replace(">", ">");+ for suffix in [+ " - Presentaciones de Google",+ " - Google Slides",+ " - Apresentações Google",+ " - Google 簡報",+ " - Google 幻灯片",+ " - Google スライド",+ ] {+ if let Some(stripped) = t.strip_suffix(suffix) {+ t = stripped.to_string();+ }+ }+ for ext in [".pptx", ".ppt", ".odp", ".pdf"] {+ if t.to_lowercase().ends_with(ext) && t.len() > ext.len() {+ t.truncate(t.len() - ext.len());+ }+ }+ let trimmed = t.trim();+ if trimmed.is_empty() {+ "presentacion_google_slides".to_string()+ } else {+ trimmed.to_string()+ }+}++pub fn extract_title_from_viewer_html(html: &str) -> String {+ static VIEWER_TITLE_RE: OnceLock<Regex> = OnceLock::new();+ static HTML_TITLE_RE: OnceLock<Regex> = OnceLock::new();++ let viewer_re =+ VIEWER_TITLE_RE.get_or_init(|| Regex::new(r"title:\s*'((?:\\.|[^'])*)'").unwrap());+ let head_slice = &html[..html.len().min(350_000)];+ if let Some(c) = viewer_re.captures(head_slice) {+ let decoded = unescape_js_string(&c[1]);+ if !decoded.trim().is_empty() {+ return clean_presentation_title(&decoded);+ }+ }++ let html_re =+ HTML_TITLE_RE.get_or_init(|| Regex::new(r"(?is)<title[^>]*>(.*?)</title>").unwrap());+ if let Some(c) = html_re.captures(head_slice) {+ let raw = c[1].trim();+ if !raw.is_empty() {+ return clean_presentation_title(raw);+ }+ }++ "presentacion_google_slides".to_string()+}++/// Extrae todos los bloques `SK_svgData` en el orden exacto de las diapositivas.+pub fn extract_viewer_slides(html: &str) -> ExtractedPresentation {+ static SVG_DATA_RE: OnceLock<Regex> = OnceLock::new();+ let re = SVG_DATA_RE.get_or_init(|| Regex::new(r"SK_svgData\s*=\s*'((?:\\.|[^'])*)'").unwrap());++ let title = extract_title_from_viewer_html(html);+ let mut svgs = Vec::new();+ for cap in re.captures_iter(html) {+ let decoded = unescape_js_string(&cap[1]);+ if decoded.contains("<svg") {+ svgs.push(normalize_slide_svg_geometry(&decoded));+ }+ }++ ExtractedPresentation { title, svgs }+}++/// Recolecta todas las URLs remotas `http(s)://` dentro de atributos `xlink:href` o `href`+/// en elementos `<image>`.+pub fn collect_remote_image_urls(svgs: &[String]) -> Vec<String> {+ static IMG_HREF_RE: OnceLock<Regex> = OnceLock::new();+ let re = IMG_HREF_RE.get_or_init(|| {+ Regex::new(r#"<image\b[^>]*?\b(?:xlink:)?href\s*=\s*"(https?://[^"]+)""#).unwrap()+ });++ let mut seen = HashSet::new();+ let mut out = Vec::new();+ for svg in svgs {+ for cap in re.captures_iter(svg) {+ let url = cap[1].replace("&", "&");+ if seen.insert(url.clone()) {+ out.push(url);+ }+ }+ }+ out+}++fn guess_image_mime(bytes: &[u8], content_type: Option<&str>) -> &'static str {+ if bytes.starts_with(&[0x89, b'P', b'N', b'G']) {+ return "image/png";+ }+ if bytes.starts_with(&[0xFF, 0xD8, 0xFF]) {+ return "image/jpeg";+ }+ if bytes.starts_with(b"GIF8") {+ return "image/gif";+ }+ if bytes.len() >= 12 && &bytes[0..4] == b"RIFF" && &bytes[8..12] == b"WEBP" {+ return "image/webp";+ }+ if let Some(ct) = content_type {+ let lower = ct.to_ascii_lowercase();+ if lower.contains("jpeg") || lower.contains("jpg") {+ return "image/jpeg";+ }+ if lower.contains("webp") {+ return "image/webp";+ }+ if lower.contains("gif") {+ return "image/gif";+ }+ if lower.contains("svg") {+ return "image/svg+xml";+ }+ }+ "image/png"+}++/// Descarga en paralelo las imágenes remotas referenciadas por los SVGs y las+/// incrusta como Data URLs (`data:<mime>;base64,...`) exactamente igual que+/// `svgImageToBase64` en el navegador, pero con deduplicación y concurrencia.+pub async fn embed_remote_images_base64(+ client: &reqwest::Client,+ svgs: &mut [String],+ progress: &super::ProgressFn,+ progress_id: &str,+) {+ let urls = collect_remote_image_urls(svgs);+ if urls.is_empty() {+ return;+ }++ let total_imgs = urls.len() as u64;+ super::report(+ progress,+ progress_id,+ "images",+ 0,+ Some(total_imgs),+ Some(format!("Descargando {} recursos de imagen...", total_imgs)),+ );++ let fetched: Vec<(String, String)> = stream::iter(urls.into_iter().enumerate())+ .map(|(idx, url)| {+ let client = client.clone();+ let progress = progress.clone();+ let progress_id = progress_id.to_string();+ async move {+ let res = match client.get(&url).send().await {+ Ok(r) if r.status().is_success() => {+ let ct = r+ .headers()+ .get(reqwest::header::CONTENT_TYPE)+ .and_then(|v| v.to_str().ok())+ .map(|s| s.to_string());+ match r.bytes().await {+ Ok(bytes) if !bytes.is_empty() => {+ let mime = guess_image_mime(&bytes, ct.as_deref());+ let b64 = base64::engine::general_purpose::STANDARD.encode(&bytes);+ Some((url, format!("data:{};base64,{}", mime, b64)))+ }+ _ => None,+ }+ }+ _ => None,+ };+ if (idx + 1) % 5 == 0 || (idx + 1) as u64 == total_imgs {+ super::report(+ &progress,+ &progress_id,+ "images",+ (idx + 1) as u64,+ Some(total_imgs),+ None,+ );+ }+ res+ }+ })+ .buffer_unordered(12)+ .filter_map(|x| async move { x })+ .collect()+ .await;++ if fetched.is_empty() {+ return;+ }++ let map: HashMap<String, String> = fetched.into_iter().collect();++ for svg in svgs.iter_mut() {+ for (url, data_uri) in &map {+ if svg.contains(url) {+ *svg = svg.replace(url, data_uri);+ }+ let escaped = url.replace('&', "&");+ if escaped != *url && svg.contains(&escaped) {+ *svg = svg.replace(&escaped, data_uri);+ }+ }+ }+}++fn shared_fontdb() -> Arc<usvg::fontdb::Database> {+ static FONTDB: OnceLock<Arc<usvg::fontdb::Database>> = OnceLock::new();+ FONTDB+ .get_or_init(|| {+ let mut db = usvg::fontdb::Database::new();+ db.load_system_fonts();+ Arc::new(db)+ })+ .clone()+}++/// Renderiza un SVG a un buffer JPEG en memoria con proporción 16:9 usando `resvg` y `tiny-skia`.+pub fn render_svg_to_jpeg(svg_str: &str) -> anyhow::Result<Vec<u8>> {+ let normalized = normalize_slide_svg_geometry(svg_str);+ let opt = usvg::Options {+ fontdb: shared_fontdb(),+ ..Default::default()+ };++ let tree = usvg::Tree::from_data(normalized.as_bytes(), &opt)+ .context("Error parseando el árbol SVG con usvg")?;++ let tree_size = tree.size();+ let target_w = RENDER_WIDTH_PX;+ let target_h = RENDER_HEIGHT_PX;++ let mut pixmap = tiny_skia::Pixmap::new(target_w, target_h).ok_or_else(|| {+ anyhow!(+ "No se pudo reservar memoria para el pixmap {}x{}",+ target_w,+ target_h+ )+ })?;++ // Fondo blanco por defecto para evitar transparencias negras al pasar a JPEG+ pixmap.fill(tiny_skia::Color::WHITE);++ let sx = target_w as f32 / tree_size.width().max(1.0);+ let sy = target_h as f32 / tree_size.height().max(1.0);+ let transform = tiny_skia::Transform::from_scale(sx, sy);++ resvg::render(&tree, transform, &mut pixmap.as_mut());++ // Convertir RGBA premultiplicado (tiny-skia) a RGB de 24 bits para JPEG+ let rgba = pixmap.data();+ let mut rgb = Vec::with_capacity((target_w * target_h * 3) as usize);+ for px in rgba.chunks_exact(4) {+ let a = px[3] as u16;+ if a == 255 {+ rgb.push(px[0]);+ rgb.push(px[1]);+ rgb.push(px[2]);+ } else if let Some(r) = (px[0] as u16 * 255).checked_div(a) {+ let g = (px[1] as u16 * 255) / a;+ let b = (px[2] as u16 * 255) / a;+ rgb.push(r.min(255) as u8);+ rgb.push(g.min(255) as u8);+ rgb.push(b.min(255) as u8);+ } else {+ rgb.push(255);+ rgb.push(255);+ rgb.push(255);+ }+ }++ let mut jpeg_buf = Vec::new();+ let mut encoder = JpegEncoder::new_with_quality(&mut jpeg_buf, JPEG_QUALITY);+ encoder+ .encode(&rgb, target_w, target_h, ColorType::Rgb8.into())+ .context("Error codificando diapositiva a JPEG")?;++ Ok(jpeg_buf)+}++/// Compila una lista ordenada de SVGs en un documento PDF 16:9 (`1280 x 720 pt`).+pub fn compile_svgs_to_pdf(+ svgs: &[String],+ progress: &super::ProgressFn,+ progress_id: &str,+) -> anyhow::Result<Vec<u8>> {+ if svgs.is_empty() {+ return Err(anyhow!("No hay diapositivas SVG para compilar"));+ }++ let total = svgs.len() as u64;+ let mut jpegs = Vec::with_capacity(svgs.len());++ for (idx, svg_str) in svgs.iter().enumerate() {+ super::report(+ progress,+ progress_id,+ "compile",+ idx as u64,+ Some(total),+ Some(format!("Renderizando diapositiva {}/{}...", idx + 1, total)),+ );+ let jpeg = render_svg_to_jpeg(svg_str)+ .with_context(|| format!("Error procesando diapositiva {}", idx + 1))?;+ jpegs.push(jpeg);+ }++ let pdf = super::jpeg_pdf::build_pdf_with_page_size(&jpegs, SLIDE_WIDTH_PT, SLIDE_HEIGHT_PT)?;+ super::report(progress, progress_id, "done", total, Some(total), None);+ Ok(pdf)+}++/// Extrae el primer número de un nombre de archivo para ordenamiento natural+/// (`diapositiva_1.svg`, `diapositiva_2.svg`, ..., `diapositiva_10.svg`).+pub fn extraer_numero_slide(nombre: &str) -> usize {+ static NUM_RE: OnceLock<Regex> = OnceLock::new();+ let re = NUM_RE.get_or_init(|| Regex::new(r"(\d+)").unwrap());+ re.captures(nombre)+ .and_then(|cap| cap.get(1))+ .and_then(|m| m.as_str().parse::<usize>().ok())+ .unwrap_or(0)+}++/// Lista todos los archivos `.svg` de un directorio en orden numérico natural.+pub fn obtener_svgs_ordenados(directorio: &Path) -> anyhow::Result<Vec<PathBuf>> {+ let mut entradas: Vec<PathBuf> = std::fs::read_dir(directorio)+ .with_context(|| format!("No se pudo leer el directorio {}", directorio.display()))?+ .filter_map(|e| e.ok())+ .map(|e| e.path())+ .filter(|p| {+ p.extension()+ .map(|ext| ext.eq_ignore_ascii_case("svg"))+ .unwrap_or(false)+ })+ .collect();++ entradas.sort_by(|a, b| {+ let na = a.file_name().unwrap_or_default().to_string_lossy();+ let nb = b.file_name().unwrap_or_default().to_string_lossy();+ extraer_numero_slide(&na)+ .cmp(&extraer_numero_slide(&nb))+ .then_with(|| na.cmp(&nb))+ });++ Ok(entradas)+}++/// Compila todos los archivos `.svg` de una carpeta local en un PDF 16:9 (`1280 x 720 pt`).+pub async fn compile_svg_dir_to_pdf(+ svg_dir: &str,+ output_pdf: Option<&str>,+ progress: super::ProgressFn,+) -> anyhow::Result<GslidesDownloadResult> {+ let dir_path = PathBuf::from(svg_dir);+ let paths = obtener_svgs_ordenados(&dir_path)?;+ if paths.is_empty() {+ return Err(anyhow!(+ "No se encontraron archivos .svg en {}",+ dir_path.display()+ ));+ }++ let mut svgs = Vec::with_capacity(paths.len());+ for p in &paths {+ let content = tokio::fs::read_to_string(p)+ .await+ .with_context(|| format!("Error leyendo {}", p.display()))?;+ svgs.push(content);+ }++ let progress_id = format!("gslides-dir:{}", svg_dir);+ if let Ok(client) = build_google_client(None) {+ embed_remote_images_base64(&client, &mut svgs, &progress, &progress_id).await;+ }++ let dir_title = dir_path+ .file_name()+ .map(|s| s.to_string_lossy().to_string())+ .filter(|s| !s.is_empty())+ .unwrap_or_else(|| "presentacion_compilada".to_string());++ let out_path = match output_pdf.map(str::trim).filter(|s| !s.is_empty()) {+ Some(custom) => {+ let p = PathBuf::from(custom);+ if p.is_dir() {+ p.join(format!("{}.pdf", super::sanitize_name(&dir_title)))+ } else if p+ .extension()+ .map(|e| e.eq_ignore_ascii_case("pdf"))+ .unwrap_or(false)+ {+ p+ } else {+ p.with_extension("pdf")+ }+ }+ None => dir_path.join(format!("{}.pdf", super::sanitize_name(&dir_title))),+ };++ if let Some(parent) = out_path.parent() {+ std::fs::create_dir_all(parent)?;+ }++ let svgs_for_compile = svgs;+ let progress_clone = progress.clone();+ let pid = progress_id.clone();+ let pdf_bytes = tokio::task::spawn_blocking(move || {+ compile_svgs_to_pdf(&svgs_for_compile, &progress_clone, &pid)+ })+ .await??;++ tokio::fs::write(&out_path, &pdf_bytes).await?;++ Ok(GslidesDownloadResult {+ title: dir_title,+ pages: paths.len(),+ output_path: out_path.to_string_lossy().to_string(),+ format: "pdf".to_string(),+ })+}++pub fn build_google_client(url_hint: Option<&str>) -> anyhow::Result<reqwest::Client> {+ use reqwest::header::{HeaderMap, HeaderValue, USER_AGENT};+ let mut headers = HeaderMap::new();+ headers.insert(+ USER_AGENT,+ HeaderValue::from_static(+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",+ ),+ );+ let mut builder = crate::core::http_client::apply_global_proxy(reqwest::Client::builder())+ .default_headers(headers)+ .timeout(std::time::Duration::from_secs(600));++ let probe_url = url_hint.unwrap_or("https://docs.google.com/presentation/");+ if let Some(jar) = crate::core::cookie_parser::load_extension_cookies_for_url(probe_url) {+ builder = builder.cookie_provider(jar);+ }+ Ok(builder.build()?)+}++/// Descarga y extrae las diapositivas de una presentación de Google Slides desde su visor+/// (`pubembed` / `embed` / `htmlpresent`), incrusta sus imágenes en Base64 y genera el+/// PDF 16:9 (`format == "pdf"`) o una carpeta con los `.svg` autocontenidos (`format == "svg"`).+pub async fn download_presentation(+ url: &str,+ format: &str,+ dest_dir: &str,+ progress: super::ProgressFn,+) -> anyhow::Result<GslidesDownloadResult> {+ let target = parse_gslides_url(url)+ .ok_or_else(|| anyhow!("Enlace de Google Slides no válido: {}", url))?;++ let client = build_google_client(Some(url))?;+ let progress_id = format!("gslides:{}", target.id);++ super::report(+ &progress,+ &progress_id,+ "fetch",+ 0,+ None,+ Some("Obteniendo visor de Google Slides...".to_string()),+ );++ let mut html = String::new();+ for candidate in [target.viewer_url(), target.htmlpresent_url()] {+ if let Ok(resp) = client.get(&candidate).send().await {+ if resp.status().is_success() {+ if let Ok(text) = resp.text().await {+ if text.contains("SK_svgData") {+ html = text;+ break;+ }+ }+ }+ }+ }++ if html.is_empty() {+ return Err(anyhow!(+ "No se encontraron diapositivas vectoriales en la presentación (puede requerir inicio de sesión o usar el extractor en navegador)."+ ));+ }++ let mut extracted = extract_viewer_slides(&html);+ drop(html);++ if extracted.svgs.is_empty() {+ return Err(anyhow!(+ "No se encontraron bloques SK_svgData en la presentación."+ ));+ }++ let pages = extracted.svgs.len();+ embed_remote_images_base64(&client, &mut extracted.svgs, &progress, &progress_id).await;++ let safe_title = super::sanitize_name(&extracted.title);+ let base_dir = PathBuf::from(dest_dir);+ std::fs::create_dir_all(&base_dir)?;++ if format.eq_ignore_ascii_case("svg") {+ let folder = base_dir.join(&safe_title);+ std::fs::create_dir_all(&folder)?;+ for (i, svg) in extracted.svgs.iter().enumerate() {+ let file_path = folder.join(format!("diapositiva_{:03}.svg", i + 1));+ tokio::fs::write(&file_path, svg.as_bytes()).await?;+ }+ super::report(+ &progress,+ &progress_id,+ "done",+ pages as u64,+ Some(pages as u64),+ None,+ );+ return Ok(GslidesDownloadResult {+ title: extracted.title,+ pages,+ output_path: folder.to_string_lossy().to_string(),+ format: "svg".to_string(),+ });+ }++ let svgs = extracted.svgs;+ let progress_clone = progress.clone();+ let pid = progress_id.clone();+ let pdf_bytes =+ tokio::task::spawn_blocking(move || compile_svgs_to_pdf(&svgs, &progress_clone, &pid))+ .await??;++ let pdf_path = base_dir.join(format!("{}.pdf", safe_title));+ tokio::fs::write(&pdf_path, &pdf_bytes).await?;++ Ok(GslidesDownloadResult {+ title: extracted.title,+ pages,+ output_path: pdf_path.to_string_lossy().to_string(),+ format: "pdf".to_string(),+ })+}++/// Genera el script JavaScript / Bookmarklet adaptado para enviar diapositivas al+/// `local_bridge` de LibreGet en `http://127.0.0.1:<port>/api` autenticado con token Bearer.+pub fn browser_extractor_script(port: u16, token: &str) -> String {+ let tpl = r##"javascript:(function(){+ const SERVER_URL = "http://127.0.0.1:__PORT__/api";+ const AUTH_HEADERS = { "Content-Type": "application/json", "Authorization": "Bearer __TOKEN__" };+ let count = 1;+ let lastSvgSignature = "";+ let duplicateCount = 0;+ const deckTitle = (document.title || "presentacion_google_slides").replace(/\s*-\s*(Presentaciones de Google|Google Slides|Apresentações Google).*$/i, "").trim();++ fetch(`${SERVER_URL}/reset`, {+ method: "POST",+ headers: AUTH_HEADERS,+ body: JSON.stringify({ title: deckTitle })+ });++ let btn = document.createElement("button");+ btn.textContent = "⏳ Enviando slides a LibreGet...";+ btn.style.cssText = "position:fixed;top:20px;right:20px;z-index:999999;padding:14px 22px;background:#4f46e5;color:white;font-weight:bold;border:none;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,0.35);font-family:system-ui,sans-serif;";+ document.body.appendChild(btn);++ async function svgImageToBase64(svgElement) {+ let images = svgElement.querySelectorAll("image");+ for (let img of images) {+ let href = img.getAttribute("xlink:href") || img.getAttribute("href");+ if (href && href.startsWith("http")) {+ try {+ let res = await fetch(href);+ let blob = await res.blob();+ let base64 = await new Promise(resolve => {+ let reader = new FileReader();+ reader.onloadend = () => resolve(reader.result);+ reader.readAsDataURL(blob);+ });+ img.setAttribute("xlink:href", base64);+ if (img.hasAttribute("href")) img.setAttribute("href", base64);+ } catch (e) {+ console.warn("Fallo CORS en imagen:", href);+ }+ }+ }+ }++ function advance() {+ let nextBtn = document.querySelector('[aria-label="Siguiente"]') ||+ document.querySelector('[aria-label="Next"]') ||+ document.querySelector('[aria-label="Próximo"]') ||+ document.querySelector('.punch-viewer-nav-next');+ if (nextBtn) {+ nextBtn.click();+ } else {+ let target = document.querySelector('.punch-viewer-content') || document.body;+ target.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowRight', keyCode: 39, bubbles: true }));+ }+ }++ async function stepCapture() {+ let svgs = document.querySelectorAll("svg");+ let target = null;+ svgs.forEach(s => {+ let vb = s.getAttribute("viewBox");+ if (vb && vb.includes("1280") && vb.includes("720")) target = s;+ });+ if (!target && svgs.length > 0) target = svgs[0];++ if (target) {+ let sig = target.innerHTML;+ if (sig === lastSvgSignature && count > 1) {+ if (++duplicateCount >= 2) {+ btn.textContent = "⚙️ Compilando PDF 16:9 en LibreGet...";+ let r = await fetch(`${SERVER_URL}/compile`, {+ method: "POST",+ headers: AUTH_HEADERS,+ body: JSON.stringify({ title: deckTitle })+ });+ let j = await r.json().catch(() => ({}));+ btn.textContent = j.file ? `✅ PDF guardado: ${j.file}` : "✅ ¡PDF generado en LibreGet!";+ btn.style.background = "#10b981";+ setTimeout(() => btn.remove(), 6000);+ return;+ }+ } else {+ duplicateCount = 0;+ lastSvgSignature = sig;+ }++ let clone = target.cloneNode(true);+ clone.setAttribute("width", "1280px");+ clone.setAttribute("height", "720px");+ clone.setAttribute("viewBox", "0 0 1280 720");++ await svgImageToBase64(clone);++ let xml = new XMLSerializer().serializeToString(clone);+ await fetch(`${SERVER_URL}/slide`, {+ method: "POST",+ headers: AUTH_HEADERS,+ body: JSON.stringify({ index: count++, svg_content: xml, title: deckTitle })+ });++ btn.textContent = `🚀 Enviado slide ${count - 1} a LibreGet...`;+ }++ advance();+ setTimeout(stepCapture, 1800);+ }++ setTimeout(stepCapture, 1200);+})();"##;+ tpl.replace("__PORT__", &port.to_string())+ .replace("__TOKEN__", token)+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn parses_published_and_standard_urls() {+ let pub_url = "https://docs.google.com/presentation/d/e/2PACX-1vMockDummyId1234567890abcdefghijklmnopqrstuvwxyz/pubembed?start=false&loop=false&delayms=3000&slide=id.p1";+ let t1 = parse_gslides_url(pub_url).unwrap();+ assert!(t1.is_published);+ assert_eq!(+ t1.id,+ "2PACX-1vMockDummyId1234567890abcdefghijklmnopqrstuvwxyz"+ );++ let std_url = "https://docs.google.com/presentation/d/1AbC_d-e/edit#slide=id.p1";+ let t2 = parse_gslides_url(std_url).unwrap();+ assert!(!t2.is_published);+ assert_eq!(t2.id, "1AbC_d-e");+ }++ #[test]+ fn unescapes_sk_svg_data_and_extracts_slides() {+ let sample_html = r#"+ <script>var viewerData = {title: 'Sample Presentation Deck.pptx', docData: []};</script>+ <script>SK_svgData = '\x3csvg version\x3d\x221.1\x22 viewBox\x3d\x220.0 0.0 1280.0 720.0\x22 xmlns\x3d\x22http:\/\/www.w3.org\/2000\/svg\x22\x3e\x3cpath fill\x3d\x22#ff0000\x22 d\x3d\x22M0 0h1280v720H0z\x22\/\x3e\x3c\/svg\x3e';</script>+ <script>SK_svgData = '\x3csvg version\x3d\x221.1\x22 viewBox\x3d\x220.0 0.0 1280.0 720.0\x22 xmlns\x3d\x22http:\/\/www.w3.org\/2000\/svg\x22\x3e\x3cpath fill\x3d\x22#00ff00\x22 d\x3d\x22M0 0h1280v720H0z\x22\/\x3e\x3c\/svg\x3e';</script>+ "#;+ let extracted = extract_viewer_slides(sample_html);+ assert_eq!(extracted.title, "Sample Presentation Deck");+ assert_eq!(extracted.svgs.len(), 2);+ assert!(extracted.svgs[0].contains(r#"width="1280px" height="720px""#));++ let pdf = compile_svgs_to_pdf(&extracted.svgs, &super::super::noop_progress(), "test")+ .expect("should compile valid 16:9 PDF");+ let pdf_str = String::from_utf8_lossy(&pdf);+ assert!(pdf_str.starts_with("%PDF-1.4"));+ assert!(pdf_str.contains("/Count 2"));+ assert!(pdf_str.contains("/MediaBox [0 0 1280 720]"));+ }++ #[test]+ fn natural_slide_number_sorting() {+ assert_eq!(extraer_numero_slide("diapositiva_1.svg"), 1);+ assert_eq!(extraer_numero_slide("diapositiva_10.svg"), 10);+ assert_eq!(extraer_numero_slide("slide_2.svg"), 2);+ }+}diff --git a/src-tauri/libreget-core/src/core/tools/jpeg_pdf.rs b/src-tauri/libreget-core/src/core/tools/jpeg_pdf.rsindex 7d100baf..60257965 100644--- a/src-tauri/libreget-core/src/core/tools/jpeg_pdf.rs+++ b/src-tauri/libreget-core/src/core/tools/jpeg_pdf.rs@@ -54,6 +54,24 @@ pub fn is_jpeg(data: &[u8]) -> bool {/// Monta o PDF em memória. Página no tamanho da imagem em pontos (72 dpi).pub fn build_pdf(images: &[Vec<u8>]) -> anyhow::Result<Vec<u8>> {+ build_pdf_inner(images, None)+}++/// Monta o PDF em memória fixando o tamanho físico de cada página em pontos+/// (ex.: `1280.0 x 720.0` para apresentações 16:9), independentemente da+/// resolução em pixels do JPEG embutido.+pub fn build_pdf_with_page_size(+ images: &[Vec<u8>],+ page_width_pt: f64,+ page_height_pt: f64,+) -> anyhow::Result<Vec<u8>> {+ build_pdf_inner(images, Some((page_width_pt, page_height_pt)))+}++fn build_pdf_inner(+ images: &[Vec<u8>],+ fixed_page_pt: Option<(f64, f64)>,+) -> anyhow::Result<Vec<u8>> {if images.is_empty() {return Err(anyhow!("nenhuma imagem"));}@@ -98,15 +116,18 @@ pub fn build_pdf(images: &[Vec<u8>]) -> anyhow::Result<Vec<u8>> {4 => "/DeviceCMYK",_ => "/DeviceRGB",};- let (w, h) = (info.width.max(1), info.height.max(1));+ let (img_w, img_h) = (info.width.max(1), info.height.max(1));+ let (page_w, page_h) = fixed_page_pt+ .map(|(pw, ph)| (pw.max(1.0), ph.max(1.0)))+ .unwrap_or((img_w as f64, img_h as f64));push_obj(&mut out,&mut offsets,format!("{} 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 {} {}] /Resources << /XObject << /Im0 {} 0 R >> >> /Contents {} 0 R >>\nendobj\n",obj_page(i),- w,- h,+ page_w,+ page_h,obj_img(i),obj_content(i))@@ -115,8 +136,8 @@ pub fn build_pdf(images: &[Vec<u8>]) -> anyhow::Result<Vec<u8>> {let mut xobj = format!("{} 0 obj\n<< /Type /XObject /Subtype /Image /Width {} /Height {} /ColorSpace {} /BitsPerComponent 8 /Filter /DCTDecode /Length {} >>\nstream\n",obj_img(i),- w,- h,+ img_w,+ img_h,cs,img.len())@@ -124,7 +145,7 @@ pub fn build_pdf(images: &[Vec<u8>]) -> anyhow::Result<Vec<u8>> {xobj.extend_from_slice(img);xobj.extend_from_slice(b"\nendstream\nendobj\n");push_obj(&mut out, &mut offsets, &xobj);- let content = format!("q {} 0 0 {} 0 0 cm /Im0 Do Q", w, h);+ let content = format!("q {} 0 0 {} 0 0 cm /Im0 Do Q", page_w, page_h);push_obj(&mut out,&mut offsets,diff --git a/src-tauri/libreget-core/src/core/tools/mod.rs b/src-tauri/libreget-core/src/core/tools/mod.rsindex e0fbffd7..445575c2 100644--- a/src-tauri/libreget-core/src/core/tools/mod.rs+++ b/src-tauri/libreget-core/src/core/tools/mod.rs@@ -23,6 +23,7 @@ pub mod gallery;pub mod games;pub mod gdocs;pub mod github;+pub mod gslides;pub mod hosts_block;pub mod humanize;pub mod icon_pack;diff --git a/src-tauri/libreget-core/src/core/ytdlp.rs b/src-tauri/libreget-core/src/core/ytdlp.rsindex 743752e5..48fc8f90 100644--- a/src-tauri/libreget-core/src/core/ytdlp.rs+++ b/src-tauri/libreget-core/src/core/ytdlp.rs@@ -462,7 +462,7 @@ pub(crate) fn prepare_override_args(args.push("-o".to_string());args.push(output_dir- .join("%(title).200s [%(id)s].%(ext)s")+ .join("%(title).200s.%(ext)s").to_string_lossy().to_string(),);@@ -3095,6 +3095,66 @@ pub async fn write_netscape_cookie_file(Ok(())}+pub(crate) fn build_format_selector(+ format_id: Option<&str>,+ quality_height: Option<u32>,+ mode: &str,+ ffmpeg_available: bool,+) -> String {+ if let Some(fid) = format_id {+ match mode {+ "audio" => format!("{fid}/ba/b"),+ "mute" => {+ if let Some(h) = quality_height.filter(|h| *h > 0) {+ format!("{fid}/bv*[height<={h}]/bv*/b")+ } else {+ format!("{fid}/bv*/b")+ }+ }+ _ => {+ if ffmpeg_available {+ if let Some(h) = quality_height.filter(|h| *h > 0) {+ let fallback = format!(+ "bv*[height<={h}]+ba[ext=m4a]/bv*[height<={h}]+ba/b[height<={h}]/b"+ );+ format!("{fid}+ba[ext=m4a]/{fid}+ba/{fid}/{fallback}")+ } else {+ format!("{fid}+ba[ext=m4a]/{fid}+ba/{fid}")+ }+ } else if let Some(h) = quality_height.filter(|h| *h > 0) {+ format!("{fid}/b[height<={h}]/b")+ } else {+ format!("{fid}/b")+ }+ }+ }+ } else {+ match mode {+ "audio" => "ba/b".to_string(),+ "mute" => match quality_height {+ Some(h) if h > 0 => format!("bv*[height<={h}]/bv*/b"),+ _ => "bv*/b".to_string(),+ },+ _ => {+ if ffmpeg_available {+ match quality_height {+ Some(h) if h > 0 => format!(+ "bv*[height<={h}]+ba[ext=m4a]/bv*[height<={h}]+ba/b[height<={h}]/b"+ ),+ _ => "bv*+ba[ext=m4a]/bv*+ba/b".to_string(),+ }+ } else {+ tracing::warn!("[yt-dlp] ffmpeg not available, using combined-stream fallback (best with audio)");+ match quality_height {+ Some(h) if h > 0 => format!("b[height<={h}]/b"),+ _ => "b".to_string(),+ }+ }+ }+ }+ }+}+#[allow(clippy::too_many_arguments)]pub async fn download_video(ytdlp: &Path,@@ -3150,52 +3210,7 @@ pub async fn download_video(let ffmpeg_available = ffmpeg_res.is_ok() || crate::core::ffmpeg::is_ffmpeg_available().await;let ffmpeg_location = find_ffmpeg_location_cached().await;- let format_selector = if let Some(fid) = format_id {- if let Some(h) = quality_height.filter(|h| *h > 0) {- let fallback = match mode {- "audio" => "ba/b".to_string(),- "mute" => format!("bv*[height<={}]/bv*/b", h),- _ => {- if ffmpeg_available {- format!(- "bv*[height<={}]+ba[ext=m4a]/bv*[height<={}]+ba/b[height<={}]/b",- h, h, h- )- } else {- format!("b[height<={}]/bv*[height<={}]/b", h, h)- }- }- };- format!("{}/{}", fid, fallback)- } else {- fid.to_string()- }- } else {- match mode {- "audio" => "ba/b".to_string(),- "mute" => match quality_height {- Some(h) if h > 0 => format!("bv*[height<={}]/bv*/b", h),- _ => "bv*/b".to_string(),- },- _ => {- if ffmpeg_available {- match quality_height {- Some(h) if h > 0 => format!(- "bv*[height<={}]+ba[ext=m4a]/bv*[height<={}]+ba/b[height<={}]/b",- h, h, h- ),- _ => "bv*+ba[ext=m4a]/bv*+ba/b".to_string(),- }- } else {- tracing::warn!("[yt-dlp] ffmpeg not available, using fallback format selector");- match quality_height {- Some(h) if h > 0 => format!("b[height<={}]/bv*[height<={}]/b", h, h),- _ => "b/bv*".to_string(),- }- }- }- }- };+ let format_selector = build_format_selector(format_id, quality_height, mode, ffmpeg_available);let dir_len = output_dir.to_string_lossy().len();let max_name = if cfg!(target_os = "windows") {@@ -3205,7 +3220,7 @@ pub async fn download_video(};let template = filename_template.map(|t| t.to_string())- .unwrap_or_else(|| format!("%(title).{}s [%(id)s].%(ext)s", max_name));+ .unwrap_or_else(|| format!("%(title).{}s.%(ext)s", max_name));let output_template = output_dir.join(&template).to_string_lossy().to_string();std::fs::create_dir_all(output_dir)?;@@ -4226,6 +4241,9 @@ fn spawn_stdout_reader(}if let Some(dest) = parse_destination_line(&line) {let dest_path = PathBuf::from(&dest);+ if let Some(id) = crate::core::log_hook::current_download_id() {+ crate::core::leftovers::note_task_destination(id, &dest_path);+ }let ext = dest_path.extension().and_then(|e| e.to_str())@@ -5292,10 +5310,41 @@ mod tests {}use super::{- parse_fragment_progress, parse_planned_formats, parse_stream_info, postprocess_phase,- prepare_override_args, tuner_host_key, YoutubeExtractorArgs, PROGRESS_TEMPLATE,+ build_format_selector, parse_fragment_progress, parse_planned_formats, parse_stream_info,+ postprocess_phase, prepare_override_args, tuner_host_key, YoutubeExtractorArgs,+ PROGRESS_TEMPLATE,};+ #[test]+ fn format_selector_pairs_video_stream_with_audio_when_ffmpeg_available() {+ let sel = build_format_selector(Some("270"), Some(1080), "auto", true);+ assert_eq!(+ sel,+ "270+ba[ext=m4a]/270+ba/270/bv*[height<=1080]+ba[ext=m4a]/bv*[height<=1080]+ba/b[height<=1080]/b"+ );++ let sel_noh = build_format_selector(Some("270"), None, "auto", true);+ assert_eq!(sel_noh, "270+ba[ext=m4a]/270+ba/270");+ }++ #[test]+ fn format_selector_respects_mute_and_audio_modes() {+ let sel_mute = build_format_selector(Some("270"), Some(1080), "mute", true);+ assert_eq!(sel_mute, "270/bv*[height<=1080]/bv*/b");++ let sel_audio = build_format_selector(Some("140"), None, "audio", true);+ assert_eq!(sel_audio, "140/ba/b");+ }++ #[test]+ fn format_selector_without_ffmpeg_uses_combined_streams() {+ let sel = build_format_selector(None, Some(1080), "auto", false);+ assert_eq!(sel, "b[height<=1080]/b");++ let sel_fid = build_format_selector(Some("270"), Some(1080), "auto", false);+ assert_eq!(sel_fid, "270/b[height<=1080]/b");+ }+#[test]fn youtube_args_saem_numa_flag_so() {// `--extractor-args youtube:` repetido substitui o anterior no yt-dlp;diff --git a/src-tauri/libreget-core/src/models/settings.rs b/src-tauri/libreget-core/src/models/settings.rsindex b6516c01..eaa10e36 100644--- a/src-tauri/libreget-core/src/models/settings.rs+++ b/src-tauri/libreget-core/src/models/settings.rs@@ -92,6 +92,8 @@ pub struct AppearanceSettings {#[derive(Debug, Clone, Serialize, Deserialize)]pub struct DownloadSettings {pub default_output_dir: PathBuf,+ #[serde(default)]+ pub saved_output_dirs: Vec<String>,pub always_ask_path: bool,pub video_quality: String,pub skip_existing: bool,@@ -107,7 +109,10 @@ pub struct DownloadSettings {pub clipboard_detection: bool,#[serde(default)]pub auto_download_on_paste: bool,- #[serde(default = "default_filename_template")]+ #[serde(+ default = "default_filename_template",+ deserialize_with = "deserialize_filename_template"+ )]pub filename_template: String,#[serde(default)]pub organize_by_platform: bool,@@ -309,8 +314,23 @@ fn default_true() -> bool {true}+pub const LEGACY_DEFAULT_FILENAME_TEMPLATE: &str = "%(title).200s [%(id)s].%(ext)s";+pub fn default_filename_template() -> String {- "%(title).200s [%(id)s].%(ext)s".into()+ "%(title).200s.%(ext)s".into()+}++fn deserialize_filename_template<'de, D>(deserializer: D) -> Result<String, D::Error>+where+ D: serde::Deserializer<'de>,+{+ use serde::Deserialize;+ let s = String::deserialize(deserializer)?;+ if s == LEGACY_DEFAULT_FILENAME_TEMPLATE {+ Ok(default_filename_template())+ } else {+ Ok(s)+ }}fn default_hotkey_binding() -> String {@@ -479,6 +499,7 @@ impl Default for AppSettings {},download: DownloadSettings {default_output_dir: dirs::download_dir().unwrap_or_else(|| PathBuf::from(".")),+ saved_output_dirs: Vec::new(),always_ask_path: false,video_quality: "720p".into(),skip_existing: true,diff --git a/src-tauri/libreget-core/src/platforms/douyin.rs b/src-tauri/libreget-core/src/platforms/douyin.rsindex 05ca18df..1fd7c876 100644--- a/src-tauri/libreget-core/src/platforms/douyin.rs+++ b/src-tauri/libreget-core/src/platforms/douyin.rs@@ -217,7 +217,9 @@ impl DouyinDownloader {}};- if video.height >= 1080 || video.width >= 1080 {+ let short_edge = std::cmp::min(video.width, video.height);++ if short_edge >= 1080 {let (w1080, h1080) = scale(video.width, video.height, 1080);qualities.push(MediaVideoQuality {label: "1080p".to_string(),@@ -380,7 +382,7 @@ impl PlatformDownloader for DouyinDownloader {) -> anyhow::Result<DownloadResult> {let _ = progress.send(ProgressUpdate::percent(0.0)).await;- let quality = opts+ let selected_quality = opts.quality.as_ref().and_then(|q| {@@ -389,8 +391,21 @@ impl PlatformDownloader for DouyinDownloader {.iter().find(|vq| vq.label == q_str || format!("{}p", vq.height) == q_str)})- .or_else(|| info.available_qualities.first())- .ok_or_else(|| anyhow!("No video URL available"))?;+ .or_else(|| info.available_qualities.first());++ let mut candidates = Vec::new();+ if let Some(sq) = selected_quality {+ candidates.push(sq);+ }+ for q in &info.available_qualities {+ if !candidates.iter().any(|c| c.url == q.url) {+ candidates.push(q);+ }+ }++ if candidates.is_empty() {+ return Err(anyhow!("No video URL available"));+ }let title = if info.title.trim().is_empty() {"Douyin Video"@@ -416,15 +431,41 @@ impl PlatformDownloader for DouyinDownloader {let client = Self::client()?;- let bytes = direct_downloader::download_direct_with_headers(- &client,- &quality.url,- &output,- progress.clone(),- Some(headers),- Some(&opts.cancel_token),- )- .await?;+ let mut last_err = None;+ let mut downloaded_bytes = None;++ for (idx, quality) in candidates.iter().enumerate() {+ match direct_downloader::download_direct_with_headers(+ &client,+ &quality.url,+ &output,+ progress.clone(),+ Some(headers.clone()),+ Some(&opts.cancel_token),+ )+ .await+ {+ Ok(bytes) => {+ downloaded_bytes = Some(bytes);+ break;+ }+ Err(e) => {+ tracing::warn!(+ "[douyin] Quality {} failed ({}); attempting fallback candidate if available",+ quality.label,+ e+ );+ last_err = Some(e);+ if idx + 1 < candidates.len() {+ let _ = progress.send(ProgressUpdate::percent(0.0)).await;+ }+ }+ }+ }++ let bytes = downloaded_bytes.ok_or_else(|| {+ last_err.unwrap_or_else(|| anyhow!("Failed to download Douyin video"))+ })?;Ok(DownloadResult {file_path: output,@@ -499,4 +540,29 @@ mod tests {.contains("ratio=1080p"));assert!(media_info.available_qualities[1].url.contains("ratio=720p"));}++ #[test]+ fn test_douyin_landscape_720p_does_not_offer_1080p() {+ let video = ShareVideo {+ video_id: "7704466212453371235".to_string(),+ title: "Landscape Video".to_string(),+ author: "Creator".to_string(),+ duration_seconds: Some(30.0),+ thumbnail_url: None,+ width: 1280,+ height: 720,+ play_url: "https://aweme.snssdk.com/aweme/v1/play/?ratio=720p&video_id=v123"+ .to_string(),+ };++ let media_info = DouyinDownloader::build_media_info(video);+ assert_eq!(media_info.available_qualities.len(), 1);+ assert_eq!(media_info.available_qualities[0].label, "720p");+ assert_eq!(media_info.available_qualities[0].width, 1280);+ assert_eq!(media_info.available_qualities[0].height, 720);+ assert!(!media_info+ .available_qualities+ .iter()+ .any(|q| q.label == "1080p"));+ }}diff --git a/src-tauri/libreget-core/src/platforms/gdocs.rs b/src-tauri/libreget-core/src/platforms/gdocs.rsnew file mode 100644index 00000000..8294dd31--- /dev/null+++ b/src-tauri/libreget-core/src/platforms/gdocs.rs@@ -0,0 +1,193 @@+use std::path::PathBuf;+use std::sync::Arc;++use anyhow::anyhow;+use async_trait::async_trait;+use tokio::sync::mpsc;++use crate::core::tools::{gdocs, gslides, ToolProgress};+use crate::models::media::{DownloadOptions, DownloadResult, MediaInfo, MediaType, VideoQuality};+use crate::models::progress::ProgressUpdate;+use crate::platforms::traits::PlatformDownloader;++pub struct GdocsDownloader;++impl Default for GdocsDownloader {+ fn default() -> Self {+ Self::new()+ }+}++impl GdocsDownloader {+ pub fn new() -> Self {+ Self+ }+}++async fn fetch_presentation_title(url: &str) -> Option<String> {+ let target = gslides::parse_gslides_url(url)?;+ let client = gslides::build_google_client(Some(url)).ok()?;+ let resp = tokio::time::timeout(+ std::time::Duration::from_secs(12),+ client.get(target.viewer_url()).send(),+ )+ .await+ .ok()?+ .ok()?;+ if !resp.status().is_success() {+ return None;+ }+ // Leer los primeros ~256 KB basta para extraer `<title>` o `viewerData.title`+ use futures::StreamExt;+ let mut stream = resp.bytes_stream();+ let mut buf = Vec::with_capacity(262_144);+ while let Some(Ok(chunk)) = stream.next().await {+ buf.extend_from_slice(&chunk);+ if buf.len() >= 262_144 {+ break;+ }+ }+ let html = String::from_utf8_lossy(&buf);+ let title = gslides::extract_title_from_viewer_html(&html);+ if title == "presentacion_google_slides" {+ None+ } else {+ Some(title)+ }+}++fn compute_path_size(path: &std::path::Path) -> u64 {+ if let Ok(meta) = std::fs::metadata(path) {+ if meta.is_file() {+ return meta.len();+ }+ if meta.is_dir() {+ return walkdir::WalkDir::new(path)+ .into_iter()+ .filter_map(|e| e.ok())+ .filter_map(|e| e.metadata().ok())+ .filter(|m| m.is_file())+ .map(|m| m.len())+ .sum();+ }+ }+ 0+}++#[async_trait]+impl PlatformDownloader for GdocsDownloader {+ fn name(&self) -> &str {+ "gdocs"+ }++ fn can_handle(&self, url: &str) -> bool {+ gdocs::parse(url).is_some()+ }++ async fn get_media_info(&self, url: &str) -> anyhow::Result<MediaInfo> {+ let parsed =+ gdocs::parse(url).ok_or_else(|| anyhow!("Enlace de Google Docs/Slides no válido"))?;++ let title = if parsed.kind == "presentation" {+ fetch_presentation_title(url).await.unwrap_or_else(|| {+ format!("Google Slides ({})", &parsed.id[..parsed.id.len().min(12)])+ })+ } else {+ format!(+ "Google {} ({})",+ parsed.kind,+ &parsed.id[..parsed.id.len().min(12)]+ )+ };++ let qualities: Vec<VideoQuality> = parsed+ .formats+ .iter()+ .map(|fmt| VideoQuality {+ label: fmt.to_uppercase(),+ width: if parsed.kind == "presentation" {+ 1280+ } else {+ 0+ },+ height: if parsed.kind == "presentation" {+ 720+ } else {+ 0+ },+ url: url.to_string(),+ format: fmt.clone(),+ })+ .collect();++ Ok(MediaInfo {+ title,+ author: "Google Docs".to_string(),+ platform: "gdocs".to_string(),+ duration_seconds: None,+ thumbnail_url: None,+ available_qualities: qualities,+ media_type: MediaType::File,+ file_size_bytes: None,+ })+ }++ async fn download(+ &self,+ info: &MediaInfo,+ opts: &DownloadOptions,+ progress: mpsc::Sender<ProgressUpdate>,+ ) -> anyhow::Result<DownloadResult> {+ let start = std::time::Instant::now();+ let _ = progress.send(ProgressUpdate::percent(1.0)).await;++ let target_url = opts+ .page_url+ .as_deref()+ .or_else(|| info.available_qualities.first().map(|q| q.url.as_str()))+ .ok_or_else(|| anyhow!("No hay URL disponible para Google Docs/Slides"))?;++ let parsed = gdocs::parse(target_url)+ .ok_or_else(|| anyhow!("Enlace de Google Docs/Slides no válido"))?;++ let requested_format = opts+ .format_id+ .as_deref()+ .or(opts.quality.as_deref())+ .map(|s| s.to_ascii_lowercase())+ .filter(|f| parsed.formats.iter().any(|pf| pf == f))+ .unwrap_or_else(|| "pdf".to_string());++ let dest_dir = opts.output_dir.to_string_lossy().to_string();+ let tx = progress.clone();+ let tool_progress: crate::core::tools::ProgressFn = Arc::new(move |tp: ToolProgress| {+ let pct = match (tp.stage.as_str(), tp.total) {+ ("fetch", _) => 5.0,+ ("images", Some(t)) if t > 0 => {+ 5.0 + ((tp.done as f64 / t as f64) * 45.0).clamp(0.0, 45.0)+ }+ ("compile", Some(t)) if t > 0 => {+ 50.0 + ((tp.done as f64 / t as f64) * 48.0).clamp(0.0, 48.0)+ }+ ("done", _) => 100.0,+ (_, Some(t)) if t > 0 => ((tp.done as f64 / t as f64) * 95.0).clamp(0.0, 95.0),+ _ => 10.0,+ };+ let _ = tx.try_send(ProgressUpdate::percent(pct));+ });++ let out_path_str =+ gdocs::download(target_url, &requested_format, &dest_dir, tool_progress).await?;+ let out_path = PathBuf::from(&out_path_str);+ let size = compute_path_size(&out_path);++ let _ = progress.send(ProgressUpdate::percent(100.0)).await;++ Ok(DownloadResult {+ file_path: out_path,+ file_size_bytes: size,+ duration_seconds: start.elapsed().as_secs_f64(),+ torrent_id: None,+ })+ }+}diff --git a/src-tauri/libreget-core/src/platforms/mod.rs b/src-tauri/libreget-core/src/platforms/mod.rsindex 64fd7bd9..528bfbe4 100644--- a/src-tauri/libreget-core/src/platforms/mod.rs+++ b/src-tauri/libreget-core/src/platforms/mod.rs@@ -3,6 +3,7 @@ pub mod bluesky;pub mod cookie_provider;pub mod direct_file;pub mod douyin;+pub mod gdocs;pub mod generic_ytdlp;pub mod instagram;pub mod p2p;@@ -21,6 +22,7 @@ pub use bilibili::BilibiliDownloader;pub use bluesky::BlueskyDownloader;pub use direct_file::DirectFileDownloader;pub use douyin::DouyinDownloader;+pub use gdocs::GdocsDownloader;pub use generic_ytdlp::GenericYtdlpDownloader;pub use instagram::InstagramDownloader;pub use p2p::P2pDownloader;@@ -210,6 +212,8 @@ impl Platform {Some(Platform::Other("mgtv".to_string()))} else if matches("youku.com") {Some(Platform::Other("youku".to_string()))+ } else if host == "docs.google.com" && crate::core::tools::gdocs::parse(url_str).is_some() {+ Some(Platform::Other("gdocs".to_string()))} else if is_direct_file_url(url_str) {Some(Platform::Other("direct_file".to_string()))} else {diff --git a/src-tauri/plugins/courses/KIWIFY_FIX.md b/src-tauri/plugins/courses/KIWIFY_FIX.mdnew file mode 100644index 00000000..8472df36--- /dev/null+++ b/src-tauri/plugins/courses/KIWIFY_FIX.md@@ -0,0 +1,120 @@+# Kiwify normalized course content++## Root cause++The successful `viewer/clubs/{id}/content?caipirinha=true` response can contain+`data.all_courses`, `data.all_modules` and `data.all_lessons`, indexed by UUID.+The previous parser only searched `course.modules`, `content.modules`, `modules`+and `content`, so it returned `No modules found in course content response`+before requesting any lesson or starting a download.++The normalized payload is a graph. Each course's `modules` array and each+module's `lessons` array contain ordered references, rather than embedded+objects. The club ID in the course listing can also differ from the internal+course ID on modules and lessons.++## Behavior++- Resolve references from the normalized maps and preserve reference order.+ Exclude orphan records, deduplicate repeated references, and reject dangling+ references or conflicting parent/record IDs instead of silently truncating.+- Preserve the existing nested and legacy content formats, including a `data`+ wrapper. Keep all catalog records and check visible lesson candidates.+ Honor visibility/access restrictions and always use the authoritative+ lesson detail before saving content. A publication flag by itself neither+ grants nor denies access to media returned to the authenticated user.+- Carry the internal course ID into lesson and attachment requests.+- Fall back to the legacy content endpoint only for a missing/unsupported club+ route (404/405). Surface authentication, permission, rate limit, server and+ JSON failures. Do not turn a later pagination failure into a partial success.+- Reuse a validated API client for token login without panicking on an invalid+ header. Use a separate media client without the API bearer token for direct+ CDN requests. Do not include authenticated response bodies in API errors.+- Recheck the catalog on subsequent runs, continue processing attachments when+ a video already exists, and report failed items instead of marking a failed+ batch complete. Write local per-lesson JSON/text reports and return a partial+ result when any catalog entry is unavailable, failed or unprocessed; only a+ fully saved catalog receives `.complete`. Use a deterministic yt-dlp filename while preserving its+ actual container extension and literal percent signs in lesson titles.+- Resolve authentication before registering an active download, avoiding a+ stale active-download entry when no session is available.++## Automated validation++`api_tests.rs` uses synthetic fixtures only, including a 15-module/58-content+graph with mixed publication flags. All 58 accessible catalog candidates must+have their lesson details checked rather than being filtered by publication metadata.+It covers graph membership/order, permissions,+legacy payloads, malformed/dangling/cross-course references, HTTP fallback,+401/403/429/500 responses, invalid JSON, pagination and bearer isolation.+The downloader regression checks that failures remove an old success marker+and a successful retry can write one.++On the Windows validation machine:++- Courses plugin: 43 tests passed, including 20 new regressions.+- Other workspace crates: 1,689 passed; 63 explicitly ignored by the existing+ test configuration.+- Frontend: 142 passed. A local CRLF shebang in `scripts/lint-ui.mjs` caused+ two Vitest import failures until normalized to LF; its Git content is unchanged.+- Documentation verification harness: 60 passed.+- Clippy baseline gate passed: 121 existing workspace warnings, no new warnings.+- Windows executable compiled with the embedded production frontend.++The old catalog-dispatch test executed real logout/session handlers against the+developer's AppData. It is replaced with a download-payload boundary test that+fails before authentication, filesystem or network work; catalog support is+still checked separately. The full plugin suite was rerun and an existing local+session's hash was unchanged.++The repository's Windows CI excludes the Courses test executable because Tauri+requires the Common Controls v6 activation manifest. For this local run, the+Windows SDK `mt.exe` embedded that manifest into the generated test executable+before execution. No compiler, test assertion or platform security setting was+disabled.++## Opt-in live validation++Use the normal OmniGet interface to sign in personally. The example reads only+the session already saved by OmniGet and runs the same downloader as the desktop+command. It does not print account identifiers, course names, raw responses or+signed URLs.++From `src-tauri`:++```text+cargo run -p omniget-plugin-courses --example kiwify_validate -- --catalog+cargo run -p omniget-plugin-courses --example kiwify_validate -- --one OUTPUT_DIR+cargo run -p omniget-plugin-courses --example kiwify_validate -- --batch OUTPUT_DIR+```++Downloads require exactly one accessible candidate. If there are several, set+`OMNIGET_KIWIFY_COURSE_ID` locally to the intended listing ID. The `--one` mode+stops after processing the first lesson without marking the course complete;+check the resulting media separately with FFprobe and a full FFmpeg decode.+On Windows the standalone example needs the same Common Controls manifest as+the test executable. Batch validation exits with code 2 for a partial result+and writes `download-report.json` and `download-report.txt` inside the course+directory. Exit code 0 means the entire catalog was saved; other failures exit 1.++Live validation confirmed authenticated listing, the normalized catalog and a+successfully downloaded and fully decoded H.264/AAC MP4. Follow-up auditing checked+every catalog lesson: some returned `locked=true` without media. The revised runner+processed the entire catalog, reused saved media and wrote a partial report with+zero unprocessed entries; it removed the previous success marker. A completed+available subset is not described as a complete course. Private course files,+credentials, response fixtures and signed media URLs are not part of this change.++The user subsequently confirmed in the browser that the missing lessons are+scheduled for future release. This matches the authoritative locked responses+and closes the reported discrepancy: currently available content was saved,+while unreleased lessons remain correctly unavailable.++## Limits++This change does not renew expired sessions or grant access to scheduled,+locked, expired or DRM-protected content. The platform remains the+authority for access. Existing nonempty local files are reused as before; the+runtime does not perform a full decode of every existing file. The API is+undocumented, so further incompatible schema changes will require new evidence+and corresponding regression fixtures.diff --git a/src-tauri/plugins/courses/examples/kiwify_validate.rs b/src-tauri/plugins/courses/examples/kiwify_validate.rsnew file mode 100644index 00000000..292830b6--- /dev/null+++ b/src-tauri/plugins/courses/examples/kiwify_validate.rs@@ -0,0 +1,109 @@+//! Opt-in live validation using only the session already saved by OmniGet.+//! No credentials, course names, identifiers, content or signed URLs are printed.+//! Run with --catalog, --one OUTPUT_DIR, or --batch OUTPUT_DIR.+//! If several courses are accessible, select one with OMNIGET_KIWIFY_COURSE_ID.+use libreget_plugin_courses::platforms::kiwify::{api, downloader};+use tokio_util::sync::CancellationToken;++#[tokio::main]+async fn main() -> std::process::ExitCode {+ match validate().await {+ Ok(()) => std::process::ExitCode::SUCCESS,+ Err(error) if error.to_string().starts_with("Partial Kiwify download:") => {+ // This locally generated summary contains counts and a report filename only.+ eprintln!("{}", error);+ std::process::ExitCode::from(2)+ }+ Err(_) => {+ // Download engine errors may contain signed URLs. Keep them private.+ eprintln!("Kiwify validation failed. Check sign-in, course access and the local output directory.");+ std::process::ExitCode::FAILURE+ }+ }+}++async fn validate() -> anyhow::Result<()> {+ let args: Vec<_> = std::env::args().skip(1).collect();+ let mode = args.first().map(String::as_str).unwrap_or("--catalog");+ anyhow::ensure!(+ ["--catalog", "--one", "--batch"].contains(&mode),+ "Use --catalog, --one OUTPUT_DIR, or --batch OUTPUT_DIR"+ );+ let session = api::load_session()+ .await?+ .ok_or_else(|| anyhow::anyhow!("No saved Kiwify session. Sign in using OmniGet first."))?;+ anyhow::ensure!(+ api::validate_token(&session).await?,+ "Saved session has expired. Sign in using OmniGet first."+ );+ let courses = api::list_courses(&session).await?;+ println!("session_valid=true listed_courses={}", courses.len());+ let mut selected = None;+ let mut candidates = 0;+ let requested_id = std::env::var("OMNIGET_KIWIFY_COURSE_ID").ok();+ for (index, course) in courses.iter().enumerate() {+ let modules = api::get_course_content(&session, &course.id).await?;+ let contents = modules.iter().map(|m| m.lessons.len()).sum::<usize>();+ let available = modules+ .iter()+ .flat_map(|m| &m.lessons)+ .filter(|l| l.available)+ .count();+ println!(+ "course_index={} modules={} contents={} candidates={} catalog_restricted={}",+ index,+ modules.len(),+ contents,+ available,+ contents - available+ );+ if available > 0 && requested_id.as_ref().is_none_or(|id| id == &course.id) {+ candidates += 1;+ selected = Some(course);+ }+ }+ if mode == "--catalog" {+ return Ok(());+ }+ anyhow::ensure!(+ candidates == 1,+ "Select exactly one accessible course using OMNIGET_KIWIFY_COURSE_ID"+ );+ let output = args+ .get(1)+ .ok_or_else(|| anyhow::anyhow!("Output directory required"))?;+ let course =+ selected.ok_or_else(|| anyhow::anyhow!("No course has accessible published lessons"))?;+ let cancel = CancellationToken::new();+ let mut processed = 0;+ let mut failed_items = 0;+ let result = downloader::download_course(&session, course, output, cancel.clone(), |p| {+ processed = p.completed_lessons;+ failed_items = p.failed_items;+ println!(+ "progress processed={} total={} modules={} bytes={}",+ p.completed_lessons, p.total_lessons, p.total_modules, p.downloaded_bytes+ );+ if mode == "--one" && processed == 1 {+ cancel.cancel();+ }+ })+ .await;+ if mode == "--one" && processed == 1 && cancel.is_cancelled() {+ anyhow::ensure!(+ failed_items == 0,+ "The first lesson failed; single lesson validation unsuccessful"+ );+ anyhow::ensure!(+ result+ .as_ref()+ .is_err_and(|e| e.to_string().contains("cancelled")),+ "Single lesson validation did not stop as expected"+ );+ println!("single_lesson_processed=true cancelled_before_next=true");+ return Ok(());+ }+ result?;+ println!("batch_success=true processed={}", processed);+ Ok(())+}diff --git a/src-tauri/plugins/courses/src/commands/kiwify.rs b/src-tauri/plugins/courses/src/commands/kiwify.rsindex df8970cd..1f49204a 100644--- a/src-tauri/plugins/courses/src/commands/kiwify.rs+++ b/src-tauri/plugins/courses/src/commands/kiwify.rs@@ -60,24 +60,7 @@ pub async fn kiwify_login_token(let session = KiwifySession {token: parsed_token.clone(),email: String::new(),- client: libreget_core::core::http_client::apply_global_proxy(reqwest::Client::builder())- .user_agent(- "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0",- )- .default_headers({- let mut h = reqwest::header::HeaderMap::new();- h.insert(- "Authorization",- format!("Bearer {}", parsed_token).parse().unwrap(),- );- h.insert("Accept", "application/json".parse().unwrap());- h.insert("Origin", "https://admin.kiwify.com.br".parse().unwrap());- h.insert("Referer", "https://admin.kiwify.com.br/".parse().unwrap());- h- })- .connect_timeout(Duration::from_secs(30))- .timeout(Duration::from_secs(120))- .build()+ client: api::build_client(&parsed_token).map_err(|e| format!("Failed to build client: {}", e))?,};@@ -231,6 +214,14 @@ pub async fn start_kiwify_course_download(};let active = state.active_downloads.clone();+ let session = {+ let guard = state.kiwify_session.lock().await;+ guard+ .as_ref()+ .ok_or_else(|| "Not authenticated. Please log in first.".to_string())?+ .clone()+ };+let cancel_token = CancellationToken::new();{@@ -241,14 +232,6 @@ pub async fn start_kiwify_course_download(map.insert(course_id, cancel_token.clone());}- let session = {- let guard = state.kiwify_session.lock().await;- guard- .as_ref()- .ok_or_else(|| "Not authenticated. Please log in first.".to_string())?- .clone()- };-tokio::spawn(async move {let result =downloader::download_full_course(&app, &session, &course, &output_dir, cancel_token)diff --git a/src-tauri/plugins/courses/src/lib.rs b/src-tauri/plugins/courses/src/lib.rsindex 4f64eb23..37396cd9 100644--- a/src-tauri/plugins/courses/src/lib.rs+++ b/src-tauri/plugins/courses/src/lib.rs@@ -2293,47 +2293,36 @@ mod tests {}#[tokio::test]- async fn test_all_catalog_commands_dispatched_without_unknown_command() {+ async fn test_catalog_download_commands_reject_empty_payload_without_auth_side_effects() {let plugin = CoursesPlugin::new();let platforms = catalog::all_platforms();let mut unknown_cmds = Vec::new();for p in &platforms {- let mut all_cmds = Vec::new();- for m in &p.login_methods {- all_cmds.push(m.command.clone());- }- all_cmds.push(p.commands.check_session.clone());- all_cmds.push(p.commands.logout.clone());- all_cmds.push(p.commands.list.clone());- all_cmds.push(p.commands.refresh.clone());- all_cmds.push(p.commands.download.clone());- if let Some(ref c) = p.commands.cancel {- all_cmds.push(c.clone());- }- if let Some(ref s) = p.commands.search {- all_cmds.push(s.clone());- }- if let Some(ref cu) = p.commands.curriculum {- all_cmds.push(cu.clone());- }-- for cmd in all_cmds {- let res = plugin- .handle_command(cmd.clone(), serde_json::json!({}))- .await;- if let Err(ref e) = res {- if e.contains("Unknown command") {- unknown_cmds.push(format!("[{}] {}", p.id, cmd));- }- }+ // Calling every catalog handler also calls real logout and session+ // loading functions against the developer's AppData. Only exercise+ // the download boundary here: an absent payload must fail before+ // authentication, filesystem work, or network requests.+ let cmd = &p.commands.download;+ let error = plugin+ .handle_command(cmd.clone(), serde_json::json!({}))+ .await+ .expect_err("empty download payload must be rejected");+ if error.contains("Unknown command") {+ unknown_cmds.push(format!("[{}] {}", p.id, cmd));}+ assert!(+ error.contains("missing 'course_json'"),+ "[{}] download reached past the payload boundary: {}",+ p.id,+ error+ );}assert!(unknown_cmds.is_empty(),- "Catalog commands not dispatched in handle_command (returned Unknown command):\n{}",+ "Catalog download commands not dispatched in handle_command:\n{}",unknown_cmds.join("\n"));}diff --git a/src-tauri/plugins/courses/src/platforms/kiwify/api.rs b/src-tauri/plugins/courses/src/platforms/kiwify/api.rsindex 71ef94fb..ebd98101 100644--- a/src-tauri/plugins/courses/src/platforms/kiwify/api.rs+++ b/src-tauri/plugins/courses/src/platforms/kiwify/api.rs@@ -45,6 +45,12 @@ pub struct KiwifyLesson {pub id: String,pub name: String,pub order: i64,+ /// A club can contain several internal courses. Lesson/file endpoints use this ID.+ #[serde(default)]+ pub course_id: Option<String>,+ /// A catalog candidate; the lesson-detail response makes the final access decision.+ #[serde(default = "default_available")]+ pub available: bool,}#[derive(Debug, Clone, Serialize, Deserialize)]@@ -54,6 +60,23 @@ pub struct KiwifyLessonDetail {pub description: Option<String>,pub video_url: Option<String>,pub files: Vec<KiwifyFile>,+ #[serde(default = "default_available")]+ pub available: bool,+}++fn default_available() -> bool {+ true+}++fn content_is_available(value: &serde_json::Value) -> bool {+ let user = value.get("user_data").unwrap_or(value);+ !["locked", "expired"].iter().any(|key| {+ value.get(*key).and_then(|v| v.as_bool()) == Some(true)+ || user.get(*key).and_then(|v| v.as_bool()) == Some(true)+ }) && ["active", "has_access"]+ .iter()+ .all(|key| value.get(*key).and_then(|v| v.as_bool()) != Some(false))+ && user.get("visible").and_then(|v| v.as_bool()) != Some(false)}#[derive(Debug, Clone, Serialize, Deserialize)]@@ -63,12 +86,12 @@ pub struct KiwifyFile {pub url: Option<String>,}-fn build_client(token: &str) -> anyhow::Result<reqwest::Client> {+pub(crate) fn build_client(token: &str) -> anyhow::Result<reqwest::Client> {let mut headers = HeaderMap::new();- headers.insert(- "Authorization",- HeaderValue::from_str(&format!("Bearer {}", token))?,- );+ let mut authorization = HeaderValue::from_str(&format!("Bearer {}", token))+ .map_err(|_| anyhow!("Invalid Kiwify token header"))?;+ authorization.set_sensitive(true);+ headers.insert("Authorization", authorization);headers.insert("Accept", HeaderValue::from_static("application/json"));headers.insert("Origin",@@ -90,6 +113,44 @@ fn build_client(token: &str) -> anyhow::Result<reqwest::Client> {Ok(client)}+/// CDN requests must never inherit the API bearer token.+pub(crate) fn build_media_client() -> anyhow::Result<reqwest::Client> {+ Ok(+ libreget_core::core::http_client::apply_global_proxy(reqwest::Client::builder())+ .user_agent(USER_AGENT)+ .referer(true)+ .default_headers({+ let mut headers = HeaderMap::new();+ headers.insert(+ "Referer",+ HeaderValue::from_static("https://admin.kiwify.com.br/"),+ );+ headers+ })+ .connect_timeout(Duration::from_secs(30))+ .timeout(Duration::from_secs(120))+ .build()?,+ )+}++async fn checked_json(+ resp: reqwest::Response,+ operation: &str,+) -> anyhow::Result<serde_json::Value> {+ let status = resp.status();+ if !status.is_success() {+ // Response bodies and request URLs may contain private data or signed links.+ return Err(anyhow!(+ "Kiwify {} failed (HTTP {})",+ operation,+ status.as_u16()+ ));+ }+ resp.json()+ .await+ .map_err(|_| anyhow!("Invalid JSON in Kiwify {} response", operation))+}+fn session_file_path() -> anyhow::Result<PathBuf> {crate::platforms::session_file("kiwify_session.json")}@@ -118,11 +179,7 @@ pub async fn authenticate(email: &str, password: &str) -> anyhow::Result<KiwifySlet body_text = resp.text().await?;if !status.is_success() {- return Err(anyhow!(- "Authentication failed (status {}): {}",- status,- &body_text[..body_text.len().min(300)]- ));+ return Err(anyhow!("Authentication failed (HTTP {})", status.as_u16()));}let body: serde_json::Value = serde_json::from_str(&body_text)?;@@ -149,50 +206,43 @@ pub async fn validate_token(session: &KiwifySession) -> anyhow::Result<bool> {.send().await?;- Ok(resp.status().is_success())+ match resp.status().as_u16() {+ 200..=299 => Ok(true),+ 401 | 403 => Ok(false),+ status => Err(anyhow!("Kiwify session check failed (HTTP {})", status)),+ }}pub async fn list_courses(session: &KiwifySession) -> anyhow::Result<Vec<KiwifyCourse>> {+ list_courses_at(session, "https://admin-api.kiwify.com.br/v1/viewer").await+}++async fn list_courses_at(session: &KiwifySession, base: &str) -> anyhow::Result<Vec<KiwifyCourse>> {let mut all_courses = Vec::new();+ let mut seen = std::collections::HashSet::new();let mut page = 1u32;loop {- let url = format!(- "https://admin-api.kiwify.com.br/v1/viewer/schools/courses?page={}&archived=false",- page- );+ let url = format!("{}/schools/courses?page={}&archived=false", base, page);tracing::info!("[kiwify] fetching courses page {}", page);- let resp = session.client.get(&url).send().await?;-- let status = resp.status();- let body_text = resp.text().await?;-- tracing::info!(- "[kiwify] page {} status={} body_len={}",- page,- status,- body_text.len()- );-- if !status.is_success() {- if all_courses.is_empty() {- return Err(anyhow!(- "list_courses returned status {}: {}",- status,- &body_text[..body_text.len().min(300)]- ));- }- break;+ let resp = session+ .client+ .get(&url)+ .send()+ .await+ .map_err(|e| e.without_url())?;+ let body = checked_json(resp, "course list").await?;+ let body = body.get("data").unwrap_or(&body);+ if !body.get("courses").is_some_and(|v| v.is_array()) {+ return Err(anyhow!("Invalid Kiwify course list: missing courses array"));}- let body: serde_json::Value = serde_json::from_str(&body_text)?;-let total_count = body.get("count").and_then(|v| v.as_i64()).unwrap_or(0);let page_size = body.get("page_size").and_then(|v| v.as_i64()).unwrap_or(10);- let page_courses = parse_courses_page(&body);+ let page_courses = parse_courses_page(body);tracing::info!("[kiwify] page {} returned {} courses (total={}, page_size={})",page,@@ -202,17 +252,33 @@ pub async fn list_courses(session: &KiwifySession) -> anyhow::Result<Vec<KiwifyC);if page_courses.is_empty() {+ if total_count > all_courses.len() as i64 {+ return Err(anyhow!(+ "Kiwify course list ended before the reported total"+ ));+ }break;}- all_courses.extend(page_courses);+ let before = all_courses.len();+ all_courses.extend(+ page_courses+ .into_iter()+ .filter(|c| !c.id.is_empty() && seen.insert(c.id.clone())),+ );+ if all_courses.len() == before {+ return Err(anyhow!(+ "Kiwify course list repeated a page without new course IDs"+ ));+ }- if total_count > 0 && (page as i64 * page_size) >= total_count {+ if total_count > 0 && all_courses.len() as i64 >= total_count {break;}if page >= 50 {- tracing::warn!("[kiwify] safety limit reached at page 50");- break;+ return Err(anyhow!(+ "Kiwify course list exceeded the 50-page safety limit"+ ));}page += 1;@@ -240,6 +306,7 @@ fn extract_id_string(obj: &serde_json::Value) -> Option<String> {}pub fn parse_courses_page(body: &serde_json::Value) -> Vec<KiwifyCourse> {+ let body = body.get("data").unwrap_or(body);let Some(courses_arr) = body.get("courses").and_then(|v| v.as_array()) else {return Vec::new();};@@ -295,39 +362,178 @@ pub async fn get_course_content(session: &KiwifySession,course_id: &str,) -> anyhow::Result<Vec<KiwifyModule>> {- let club_url = format!(- "https://admin-api.kiwify.com.br/v1/viewer/clubs/{}/content?caipirinha=true",- course_id- );+ get_course_content_at(+ session,+ course_id,+ "https://admin-api.kiwify.com.br/v1/viewer",+ )+ .await+}- let body = match session.client.get(&club_url).send().await {- Ok(resp) if resp.status().is_success() => {- let text = resp.text().await?;- serde_json::from_str::<serde_json::Value>(&text)?- }- _ => {- let fallback_url = format!(- "https://admin-api.kiwify.com.br/v1/viewer/courses/{}",- course_id- );- let resp = session.client.get(&fallback_url).send().await?;- let status = resp.status();- let text = resp.text().await?;- if !status.is_success() {- return Err(anyhow!(- "get_course_content returned status {}: {}",- status,- &text[..text.len().min(300)]- ));- }- serde_json::from_str::<serde_json::Value>(&text)?+async fn get_course_content_at(+ session: &KiwifySession,+ course_id: &str,+ base: &str,+) -> anyhow::Result<Vec<KiwifyModule>> {+ let course_id = urlencoding::encode(course_id);+ let club_url = format!("{}/clubs/{}/content?caipirinha=true", base, course_id);++ let resp = session+ .client+ .get(&club_url)+ .send()+ .await+ .map_err(|e| e.without_url())?;+ let body = match resp.status().as_u16() {+ 404 | 405 => {+ let fallback_url = format!("{}/courses/{}", base, course_id);+ let resp = session+ .client+ .get(&fallback_url)+ .send()+ .await+ .map_err(|e| e.without_url())?;+ checked_json(resp, "course content").await?}+ _ => checked_json(resp, "club content").await?,};parse_course_modules(&body)}+/// Caipirinha/v3 is a graph, not a nested list. The reference arrays define+/// membership and display order; map iteration would include orphaned records+/// and reorder UUIDs alphabetically.+fn parse_normalized_modules(body: &serde_json::Value) -> anyhow::Result<Vec<KiwifyModule>> {+ use std::collections::HashSet;++ fn map<'a>(+ body: &'a serde_json::Value,+ field: &str,+ ) -> anyhow::Result<&'a serde_json::Map<String, serde_json::Value>> {+ body.get(field).and_then(|v| v.as_object()).ok_or_else(|| {+ anyhow!(+ "Invalid Kiwify normalized content: {} must be an object",+ field+ )+ })+ }++ fn refs<'a>(record: &'a serde_json::Value, field: &str) -> anyhow::Result<Vec<&'a str>> {+ record+ .get(field)+ .and_then(|v| v.as_array())+ .ok_or_else(|| {+ anyhow!(+ "Invalid Kiwify normalized content: missing {} references",+ field+ )+ })?+ .iter()+ .map(|v| {+ v.as_str().filter(|s| !s.trim().is_empty()).ok_or_else(|| {+ anyhow!(+ "Invalid Kiwify normalized content: invalid {} reference",+ field+ )+ })+ })+ .collect()+ }++ fn record<'a>(+ map: &'a serde_json::Map<String, serde_json::Value>,+ id: &str,+ kind: &str,+ ) -> anyhow::Result<&'a serde_json::Value> {+ let value = map.get(id).filter(|v| v.is_object()).ok_or_else(|| {+ anyhow!(+ "Invalid Kiwify normalized content: unresolved {} reference",+ kind+ )+ })?;+ if value+ .get("id")+ .and_then(|v| v.as_str())+ .is_some_and(|v| v != id)+ {+ return Err(anyhow!(+ "Invalid Kiwify normalized content: mismatched {} ID",+ kind+ ));+ }+ Ok(value)+ }++ fn check_parent(value: &serde_json::Value, field: &str, parent: &str) -> anyhow::Result<()> {+ if value+ .get(field)+ .and_then(|v| v.as_str())+ .is_some_and(|v| v != parent)+ {+ return Err(anyhow!(+ "Invalid Kiwify normalized content: mismatched {}",+ field+ ));+ }+ Ok(())+ }++ let courses = map(body, "all_courses")?;+ let module_map = map(body, "all_modules")?;+ let lesson_map = map(body, "all_lessons")?;+ let mut course_entries: Vec<_> = courses.iter().collect();+ course_entries.sort_by_key(|(_, c)| c.get("order").and_then(|v| v.as_i64()).unwrap_or(0));+ let mut modules = Vec::new();+ let mut seen_modules = HashSet::new();++ for (course_id, _) in course_entries {+ let course = record(courses, course_id, "course")?;+ for module_id in refs(course, "modules")? {+ let module = record(module_map, module_id, "module")?;+ check_parent(module, "course_id", course_id)?;+ if !seen_modules.insert(module_id) {+ continue;+ }+ let mut lessons = Vec::new();+ let mut seen_lessons = HashSet::new();+ for lesson_id in refs(module, "lessons")? {+ if !seen_lessons.insert(lesson_id) {+ continue;+ }+ let lesson = record(lesson_map, lesson_id, "lesson")?;+ check_parent(lesson, "module_id", module_id)?;+ check_parent(lesson, "course_id", course_id)?;+ lessons.push(KiwifyLesson {+ id: lesson_id.to_string(),+ name: first_non_empty_str(lesson, &["name", "title", "ref"])+ .unwrap_or(lesson_id)+ .to_string(),+ order: lessons.len() as i64,+ course_id: Some(course_id.clone()),+ available: content_is_available(course)+ && content_is_available(module)+ && content_is_available(lesson),+ });+ }+ modules.push(KiwifyModule {+ id: module_id.to_string(),+ name: first_non_empty_str(module, &["name", "title"])+ .unwrap_or(module_id)+ .to_string(),+ order: modules.len() as i64,+ lessons,+ });+ }+ }+ Ok(modules)+}+pub fn parse_course_modules(body: &serde_json::Value) -> anyhow::Result<Vec<KiwifyModule>> {+ let body = body.get("data").unwrap_or(body);+ if body.get("all_modules").is_some() || body.get("all_courses").is_some() {+ return parse_normalized_modules(body);+ }let modules_obj = body.get("course").and_then(|c| c.get("modules"))@@ -385,6 +591,9 @@ pub fn parse_course_modules(body: &serde_json::Value) -> anyhow::Result<Vec<Kiwiid: lesson_key.clone(),name: lesson_name,order: lesson_order,+ course_id: extract_id_string(body.get("course").unwrap_or(body)),+ available: content_is_available(module_val)+ && content_is_available(lesson_val),});}} else if let Some(serde_json::Value::Array(lessons_arr)) = lessons_obj {@@ -415,6 +624,9 @@ pub fn parse_course_modules(body: &serde_json::Value) -> anyhow::Result<Vec<Kiwi},name: lesson_name,order: lesson_order,+ course_id: extract_id_string(body.get("course").unwrap_or(body)),+ available: content_is_available(module_val)+ && content_is_available(lesson_val),});}}@@ -480,6 +692,9 @@ pub fn parse_course_modules(body: &serde_json::Value) -> anyhow::Result<Vec<Kiwi},name: lesson_name,order: lesson_order,+ course_id: extract_id_string(body.get("course").unwrap_or(body)),+ available: content_is_available(module_val)+ && content_is_available(lesson_val),});}}@@ -519,24 +734,30 @@ pub async fn get_lesson_detail(course_id, lesson_id);- let resp = session.client.get(&url).send().await?;-- let status = resp.status();- let body_text = resp.text().await?;-- if !status.is_success() {+ let resp = session+ .client+ .get(&url)+ .send()+ .await+ .map_err(|e| e.without_url())?;+ let body = checked_json(resp, "lesson detail").await?;+ let lesson_body = body.get("data").unwrap_or(&body);+ if !lesson_body.get("lesson").unwrap_or(lesson_body).is_object()+ || !lesson_body+ .get("lesson")+ .unwrap_or(lesson_body)+ .get("id")+ .is_some_and(|v| v.is_string())+ {return Err(anyhow!(- "get_lesson_detail returned status {}: {}",- status,- &body_text[..body_text.len().min(300)]+ "Invalid Kiwify lesson detail: missing lesson object or ID"));}-- let body: serde_json::Value = serde_json::from_str(&body_text)?;Ok(parse_lesson_detail(&body, lesson_id))}pub fn parse_lesson_detail(body: &serde_json::Value, fallback_id: &str) -> KiwifyLessonDetail {+ let body = body.get("data").unwrap_or(body);let lesson = body.get("lesson").unwrap_or(body);let id = first_non_empty_str(lesson, &["id"])@@ -605,6 +826,7 @@ pub fn parse_lesson_detail(body: &serde_json::Value, fallback_id: &str) -> Kiwifdescription,video_url,files,+ available: content_is_available(lesson),}}@@ -618,20 +840,14 @@ pub async fn get_file_download_url(course_id, file_id);- let resp = session.client.get(&url).send().await?;-- let status = resp.status();- let body_text = resp.text().await?;-- if !status.is_success() {- return Err(anyhow!(- "get_file_download_url returned status {}: {}",- status,- &body_text[..body_text.len().min(300)]- ));- }-- let body: serde_json::Value = serde_json::from_str(&body_text)?;+ let resp = session+ .client+ .get(&url)+ .send()+ .await+ .map_err(|e| e.without_url())?;+ let body = checked_json(resp, "file URL").await?;+ let body = body.get("data").unwrap_or(&body);let download_url = body.get("url")@@ -660,7 +876,7 @@ pub async fn save_session(session: &KiwifySession) -> anyhow::Result<()> {let json = serde_json::to_string_pretty(&saved)?;tokio::fs::write(&path, json).await?;- tracing::info!("[kiwify] session saved for {}", session.email);+ tracing::info!("[kiwify] session saved");Ok(())}@@ -674,7 +890,7 @@ pub async fn load_session() -> anyhow::Result<Option<KiwifySession>> {let saved: SavedSession = serde_json::from_str(&json)?;let client = build_client(&saved.token)?;- tracing::info!("[kiwify] session loaded for {}", saved.email);+ tracing::info!("[kiwify] session loaded");Ok(Some(KiwifySession {token: saved.token,@@ -691,6 +907,10 @@ pub async fn delete_saved_session() -> anyhow::Result<()> {Ok(())}+#[cfg(test)]+#[path = "api_tests.rs"]+mod regression_tests;+#[cfg(test)]mod tests {use super::*;diff --git a/src-tauri/plugins/courses/src/platforms/kiwify/api_tests.rs b/src-tauri/plugins/courses/src/platforms/kiwify/api_tests.rsnew file mode 100644index 00000000..2cd7928b--- /dev/null+++ b/src-tauri/plugins/courses/src/platforms/kiwify/api_tests.rs@@ -0,0 +1,355 @@+use super::*;+use serde_json::{json, Value};+use tokio::io::{AsyncReadExt, AsyncWriteExt};++// Entirely synthetic: no authenticated response, account or course data.+fn normalized_fixture() -> Value {+ let mut modules = serde_json::Map::new();+ let mut lessons = serde_json::Map::new();+ let mut module_refs = Vec::new();+ let mut content_index = 0;+ for mi in 0..15 {+ let module_id = format!("module-{}", 15 - mi);+ module_refs.push(module_id.clone());+ let mut refs = Vec::new();+ for li in 0..if mi == 14 { 2 } else { 4 } {+ let lesson_id = format!("lesson-{}-{}", mi, li);+ refs.push(lesson_id.clone());+ lessons.insert(+ lesson_id.clone(),+ json!({+ "id": lesson_id, "name": format!("Synthetic lesson {}", content_index),+ "course_id": "internal-course", "module_id": module_id,+ "published": content_index < 21,+ "user_data": {"visible": true, "expired": false}+ }),+ );+ content_index += 1;+ }+ modules.insert(+ module_id.clone(),+ json!({+ "id": module_id, "name": format!("Synthetic module {}", mi),+ "course_id": "internal-course", "lessons": refs,+ "user_data": {"visible": true}+ }),+ );+ }+ json!({"data": {+ "all_courses": {"internal-course": {"id": "internal-course", "modules": module_refs}},+ "all_modules": modules, "all_lessons": lessons+ }})+}++#[test]+fn normalized_graph_resolves_15_modules_58_contents_in_reference_order() {+ let payload = normalized_fixture();+ let modules = parse_course_modules(&payload).unwrap();+ assert_eq!(modules.len(), 15);+ assert_eq!(modules.iter().map(|m| m.lessons.len()).sum::<usize>(), 58);+ assert_eq!(+ modules+ .iter()+ .flat_map(|m| &m.lessons)+ .filter(|l| l.available)+ .count(),+ 58+ );+ assert_eq!(modules[0].id, "module-15");+ assert_eq!(modules[14].id, "module-1");+ assert_eq!(modules[0].lessons[0].id, "lesson-0-0");+ assert!(modules+ .iter()+ .flat_map(|m| &m.lessons)+ .all(|l| l.course_id.as_deref() == Some("internal-course")));+ assert_eq!(parse_course_modules(&payload["data"]).unwrap().len(), 15);+}++#[test]+fn normalized_graph_ignores_orphans_and_deduplicates_references() {+ let mut payload = normalized_fixture();+ payload["data"]["all_modules"]["orphan"] = json!({"id": "orphan", "lessons": []});+ payload["data"]["all_courses"]["internal-course"]["modules"]+ .as_array_mut()+ .unwrap()+ .push(json!("module-15"));+ payload["data"]["all_modules"]["module-15"]["lessons"]+ .as_array_mut()+ .unwrap()+ .push(json!("lesson-0-0"));+ let modules = parse_course_modules(&payload).unwrap();+ assert_eq!(modules.len(), 15);+ assert_eq!(modules[0].lessons.len(), 4);+}++#[test]+fn normalized_graph_rejects_dangling_and_cross_course_references() {+ for (field, value) in [+ ("module_id", "wrong-module"),+ ("course_id", "wrong-course"),+ ("id", "wrong-id"),+ ] {+ let mut payload = normalized_fixture();+ payload["data"]["all_lessons"]["lesson-0-0"][field] = json!(value);+ assert!(parse_course_modules(&payload)+ .unwrap_err()+ .to_string()+ .contains("mismatched"));+ }+ let mut payload = normalized_fixture();+ payload["data"]["all_lessons"]+ .as_object_mut()+ .unwrap()+ .remove("lesson-0-0");+ assert!(parse_course_modules(&payload)+ .unwrap_err()+ .to_string()+ .contains("unresolved lesson"));+}++#[test]+fn duplicate_module_in_another_course_cannot_bypass_parent_validation() {+ let mut payload = normalized_fixture();+ payload["data"]["all_courses"]["second-course"] = json!({+ "id": "second-course", "modules": ["module-15"]+ });+ assert!(parse_course_modules(&payload)+ .unwrap_err()+ .to_string()+ .contains("mismatched course_id"));+}++#[test]+fn normalized_graph_rejects_wrong_shapes_and_accepts_empty_catalog() {+ for field in ["all_courses", "all_modules", "all_lessons"] {+ let mut payload = normalized_fixture();+ payload["data"][field] = json!([]);+ assert!(parse_course_modules(&payload).is_err());+ }+ assert!(parse_course_modules(+ &json!({"data": {"all_courses": {}, "all_modules": {}, "all_lessons": {}}})+ )+ .unwrap()+ .is_empty());+ assert!(+ parse_course_modules(&json!({"error": "private response must not be echoed"})).is_err()+ );+}++#[test]+fn permission_flags_propagate_without_losing_catalog_entries() {+ for (path, value) in [+ (+ vec![+ "data",+ "all_courses",+ "internal-course",+ "user_data",+ "visible",+ ],+ json!(false),+ ),+ (+ vec!["data", "all_modules", "module-15", "user_data", "visible"],+ json!(false),+ ),+ (+ vec!["data", "all_lessons", "lesson-0-0", "locked"],+ json!(true),+ ),+ (+ vec!["data", "all_lessons", "lesson-0-0", "user_data", "expired"],+ json!(true),+ ),+ ] {+ let mut payload = normalized_fixture();+ let mut target = &mut payload;+ for key in path {+ target = &mut target[key];+ }+ *target = value;+ let modules = parse_course_modules(&payload).unwrap();+ assert_eq!(modules.len(), 15);+ assert!(!modules[0].lessons[0].available);+ }+}++#[test]+fn legacy_maps_and_wrappers_keep_ids_order_and_permissions() {+ let payload = json!({"data": {"modules": {+ "module-b": {"name": "Later", "order": 2, "lessons": {}},+ "module-a": {"name": "First", "order": 1, "classes": {+ "lesson-b": {"title": "Later", "order": 2, "expired": true},+ "lesson-a": {"title": "First", "order": 1}+ }}+ }}});+ let modules = parse_course_modules(&payload).unwrap();+ assert_eq!(modules[0].id, "module-a");+ assert_eq!(modules[0].lessons[0].id, "lesson-a");+ assert!(modules[0].lessons[0].available);+ assert!(!modules[0].lessons[1].available);+}++#[test]+fn locked_lesson_detail_stays_unavailable_even_with_media_fields() {+ let detail = parse_lesson_detail(+ &json!({"data": {"lesson": {+ "id": "lesson", "locked": true, "video": {"stream_link": "/synthetic/master.m3u8"}+ }}}),+ "fallback",+ );+ assert!(!detail.available);+ assert_eq!(detail.id, "lesson");+}++#[test]+fn publication_flag_alone_does_not_replace_authoritative_lesson_access() {+ let payload = json!({"lesson": {"id": "lesson", "published": false,+ "locked": false, "expired": false, "video": {"stream_link": "/synthetic/master.m3u8"}}});+ let detail = parse_lesson_detail(&payload, "fallback");+ assert!(detail.available);+ let denied = parse_lesson_detail(+ &json!({"lesson": {"id":"lesson","published":true,"locked":true}}),+ "fallback",+ );+ assert!(!denied.available);+}++async fn mock_server(+ responses: Vec<(u16, String)>,+) -> (String, tokio::task::JoinHandle<Vec<String>>) {+ let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();+ let base = format!("http://{}", listener.local_addr().unwrap());+ let task = tokio::spawn(async move {+ let mut requests = Vec::new();+ for (status, body) in responses {+ let (mut socket, _) = tokio::time::timeout(Duration::from_secs(10), listener.accept())+ .await+ .unwrap()+ .unwrap();+ let mut data = Vec::new();+ while !data.ends_with(b"\r\n\r\n") {+ let mut byte = [0u8; 1];+ socket.read_exact(&mut byte).await.unwrap();+ data.push(byte[0]);+ assert!(data.len() < 16384);+ }+ requests.push(String::from_utf8(data).unwrap());+ let reply = format!("HTTP/1.1 {} Test\r\nContent-Type: application/json\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{}", status, body.len(), body);+ socket.write_all(reply.as_bytes()).await.unwrap();+ }+ requests+ });+ (base, task)+}++fn mock_session() -> KiwifySession {+ KiwifySession {+ token: "synthetic-token".into(),+ email: String::new(),+ client: build_client("synthetic-token").unwrap(),+ }+}++#[tokio::test]+async fn http_content_to_download_plan_resolves_normalized_club_graph() {+ let (base, task) = mock_server(vec![(200, normalized_fixture().to_string())]).await;+ let modules = get_course_content_at(&mock_session(), "club-id", &base)+ .await+ .unwrap();+ assert_eq!(modules.len(), 15);+ assert_eq!(+ modules+ .iter()+ .flat_map(|m| &m.lessons)+ .filter(|l| l.available)+ .count(),+ 58+ );+ let requests = task.await.unwrap();+ assert!(requests[0].starts_with("GET /clubs/club-id/content?caipirinha=true "));+}++#[tokio::test]+async fn http_legacy_fallback_only_for_missing_route() {+ let payload = json!({"course": {"modules": []}});+ let (base, task) = mock_server(vec![(404, "{}".into()), (200, payload.to_string())]).await;+ assert!(get_course_content_at(&mock_session(), "course", &base)+ .await+ .unwrap()+ .is_empty());+ let requests = task.await.unwrap();+ assert!(requests[1].starts_with("GET /courses/course "));+}++#[tokio::test]+async fn http_auth_permission_rate_limit_and_server_errors_do_not_fallback_or_leak_body() {+ for status in [401, 403, 429, 500] {+ let (base, task) = mock_server(vec![(status, "SECRET-RESPONSE".into())]).await;+ let error = get_course_content_at(&mock_session(), "course", &base)+ .await+ .unwrap_err()+ .to_string();+ assert!(error.contains(&status.to_string()));+ assert!(!error.contains("SECRET"));+ assert!(!error.contains(&base));+ assert_eq!(task.await.unwrap().len(), 1);+ }+}++#[tokio::test]+async fn http_malformed_success_response_is_not_retried_as_legacy() {+ let (base, task) = mock_server(vec![(200, "not json".into())]).await;+ assert!(get_course_content_at(&mock_session(), "course", &base)+ .await+ .unwrap_err()+ .to_string()+ .contains("Invalid JSON"));+ assert_eq!(task.await.unwrap().len(), 1);+}++#[tokio::test]+async fn http_pagination_loads_all_pages_and_rejects_partial_success() {+ let first = json!({"count": 2, "page_size": 1, "courses": [{"course_info": {"id": "course-a", "name": "A"}}]});+ let second = json!({"count": 2, "page_size": 1, "courses": [{"course_info": {"id": "course-b", "name": "B"}}]});+ let (base, task) = mock_server(vec![(200, first.to_string()), (200, second.to_string())]).await;+ assert_eq!(+ list_courses_at(&mock_session(), &base).await.unwrap().len(),+ 2+ );+ assert!(task.await.unwrap()[1].contains("page=2&archived=false"));+ let (base, task) = mock_server(vec![(200, first.to_string()), (503, "private".into())]).await;+ assert!(list_courses_at(&mock_session(), &base).await.is_err());+ task.await.unwrap();+}++#[tokio::test]+async fn http_repeated_pagination_page_is_an_error_instead_of_silent_truncation() {+ let page = json!({"count": 2, "page_size": 1, "courses": [{"id": "a"}]}).to_string();+ let (base, task) = mock_server(vec![(200, page.clone()), (200, page)]).await;+ assert!(list_courses_at(&mock_session(), &base)+ .await+ .unwrap_err()+ .to_string()+ .contains("repeated"));+ task.await.unwrap();+}++#[tokio::test]+async fn media_client_never_sends_api_authorization() {+ let (base, task) = mock_server(vec![(200, "{}".into())]).await;+ build_media_client()+ .unwrap()+ .get(base)+ .send()+ .await+ .unwrap();+ let requests = task.await.unwrap();+ assert!(!requests[0].to_ascii_lowercase().contains("authorization:"));+ assert!(requests[0].contains("referer: https://admin.kiwify.com.br/"));+}++#[test]+fn invalid_token_header_returns_error_without_panicking() {+ assert!(build_client("invalid\nheader").is_err());+}diff --git a/src-tauri/plugins/courses/src/platforms/kiwify/downloader.rs b/src-tauri/plugins/courses/src/platforms/kiwify/downloader.rsindex 7782fa73..65fc21a5 100644--- a/src-tauri/plugins/courses/src/platforms/kiwify/downloader.rs+++ b/src-tauri/plugins/courses/src/platforms/kiwify/downloader.rs@@ -11,6 +11,36 @@ use libreget_core::core::filename;use super::api::{self, KiwifyCourse, KiwifySession};+#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)]+#[serde(rename_all = "snake_case")]+enum LessonStatus {+ Saved,+ Unavailable,+ Failed,+}++#[derive(Debug, serde::Serialize)]+struct LessonReport {+ module: String,+ lesson: String,+ status: LessonStatus,+ reason: Option<String>,+}++fn report_item(+ module: &str,+ lesson: &str,+ status: LessonStatus,+ reason: Option<&str>,+) -> LessonReport {+ LessonReport {+ module: module.into(),+ lesson: lesson.into(),+ status,+ reason: reason.map(String::from),+ }+}+#[derive(Debug, Clone, serde::Serialize)]pub struct KiwifyCourseDownloadProgress {pub course_id: String,@@ -26,6 +56,7 @@ pub struct KiwifyCourseDownloadProgress {pub completed_lessons: u32,pub total_modules: u32,pub current_module_index: u32,+ pub failed_items: u32,}pub async fn download_full_course(@@ -34,6 +65,20 @@ pub async fn download_full_course(course: &KiwifyCourse,output_dir: &str,cancel_token: CancellationToken,+) -> anyhow::Result<()> {+ download_course(session, course, output_dir, cancel_token, |progress| {+ let _ = app.emit("download-progress", progress);+ })+ .await+}++/// Shared by the desktop command and the opt-in live integration example.+pub async fn download_course(+ session: &KiwifySession,+ course: &KiwifyCourse,+ output_dir: &str,+ cancel_token: CancellationToken,+ mut on_progress: impl FnMut(&KiwifyCourseDownloadProgress),) -> anyhow::Result<()> {let modules = api::get_course_content(session, &course.id).await?;@@ -50,31 +95,47 @@ pub async fn download_full_course(filename::sanitize_path_component(&course.name));tokio::fs::create_dir_all(&course_dir).await?;-- if libreget_core::core::course_utils::is_course_complete(&course_dir) {- return Ok(());+ match tokio::fs::remove_file(Path::new(&course_dir).join(".complete")).await {+ Ok(()) => {}+ Err(e) if e.kind() == std::io::ErrorKind::NotFound => {}+ Err(e) => return Err(e.into()),}- let total_lessons: usize = modules.iter().map(|m| m.lessons.len()).sum();+ // Recheck the catalog even when an earlier run wrote a completion marker:+ // new lessons and changed permissions must not be hidden by a stale marker.+ let discovered: usize = modules.iter().map(|m| m.lessons.len()).sum();+ let total_lessons = modules+ .iter()+ .flat_map(|m| &m.lessons)+ .filter(|l| l.available)+ .count();+ tracing::info!(+ "[kiwify] catalog: {} modules, {} contents, {} candidates, {} catalog-restricted",+ modules.len(),+ discovered,+ total_lessons,+ discovered - total_lessons+ );+ let mut report = Vec::new();+ let media_client = api::build_media_client()?;+ let mut failures = 0usize;let total_modules = modules.len();let total_bytes = Arc::new(AtomicU64::new(0));let completed = Arc::new(AtomicUsize::new(0));- let _ = app.emit(- "download-progress",- &KiwifyCourseDownloadProgress {- course_id: course.id.clone(),- course_name: course.name.clone(),- percent: 0.0,- current_module: "Starting...".to_string(),- current_lesson: String::new(),- downloaded_bytes: 0,- total_lessons: total_lessons as u32,- completed_lessons: 0,- total_modules: total_modules as u32,- current_module_index: 0,- },- );+ on_progress(&KiwifyCourseDownloadProgress {+ course_id: course.id.clone(),+ course_name: course.name.clone(),+ percent: 0.0,+ current_module: "Starting...".to_string(),+ current_lesson: String::new(),+ downloaded_bytes: 0,+ total_lessons: total_lessons as u32,+ completed_lessons: 0,+ total_modules: total_modules as u32,+ current_module_index: 0,+ failed_items: 0,+ });for (mi, module) in modules.iter().enumerate() {if cancel_token.is_cancelled() {@@ -89,203 +150,246 @@ pub async fn download_full_course(if cancel_token.is_cancelled() {return Err(anyhow!("Download cancelled by user"));}+ if !lesson.available {+ report.push(report_item(+ &module.name,+ &lesson.name,+ LessonStatus::Unavailable,+ Some("catalog_access_restricted"),+ ));+ continue;+ }let lesson_name = filename::sanitize_path_component(&lesson.name);let lesson_dir = format!("{}/{}. {}", mod_dir, li + 1, lesson_name);- tokio::fs::create_dir_all(&lesson_dir).await?;- let detail = match api::get_lesson_detail(session, &course.id, &lesson.id).await {+ let lesson_course_id = lesson.course_id.as_deref().unwrap_or(&course.id);+ let detail = match api::get_lesson_detail(session, lesson_course_id, &lesson.id).await {Ok(d) => d,Err(e) => {+ failures += 1;+ report.push(report_item(+ &module.name,+ &lesson.name,+ LessonStatus::Failed,+ Some("lesson_detail_request_failed"),+ ));tracing::error!("[kiwify] Failed to get lesson detail '{}': {}. Continuing...",lesson.name,e);let done = completed.fetch_add(1, Ordering::Relaxed) + 1;- let _ = app.emit(- "download-progress",- &KiwifyCourseDownloadProgress {- course_id: course.id.clone(),- course_name: course.name.clone(),- percent: done as f64 / total_lessons as f64 * 100.0,- current_module: module.name.clone(),- current_lesson: lesson.name.clone(),- downloaded_bytes: total_bytes.load(Ordering::Relaxed),- total_lessons: total_lessons as u32,- completed_lessons: done as u32,- total_modules: total_modules as u32,- current_module_index: (mi + 1) as u32,- },- );+ on_progress(&KiwifyCourseDownloadProgress {+ course_id: course.id.clone(),+ course_name: course.name.clone(),+ percent: done as f64 / total_lessons as f64 * 100.0,+ current_module: module.name.clone(),+ current_lesson: lesson.name.clone(),+ downloaded_bytes: total_bytes.load(Ordering::Relaxed),+ total_lessons: total_lessons as u32,+ completed_lessons: done as u32,+ total_modules: total_modules as u32,+ current_module_index: (mi + 1) as u32,+ failed_items: failures as u32,+ });continue;}};- if let Some(ref desc) = detail.description {- libreget_core::core::course_utils::save_description(&lesson_dir, desc, "html")- .await- .ok();- }+ if detail.available {+ // Publication metadata alone is not an access decision. The server's+ // lesson response must authorize the actual content before saving it.+ tokio::fs::create_dir_all(&lesson_dir).await?;+ let failures_before = failures;- if let Some(ref video_url) = detail.video_url {- let video_ext = if video_url.contains(".m3u8") {- "mp4"- } else {- video_url- .rsplit('.')- .next()- .and_then(|e| {- let e = e.split('?').next().unwrap_or(e);- if e.len() <= 4 {- Some(e)- } else {- None- }- })- .unwrap_or("mp4")- };-- let video_path =- format!("{}/{}. {}.{}", lesson_dir, li + 1, lesson_name, video_ext);-- if tokio::fs::try_exists(&video_path).await.unwrap_or(false) {- let meta = tokio::fs::metadata(&video_path).await;- if meta.map(|m| m.len() > 0).unwrap_or(false) {- tracing::info!("[kiwify] Skipping existing: {}", video_path);- let done = completed.fetch_add(1, Ordering::Relaxed) + 1;- let _ = app.emit(- "download-progress",- &KiwifyCourseDownloadProgress {- course_id: course.id.clone(),- course_name: course.name.clone(),- percent: done as f64 / total_lessons as f64 * 100.0,- current_module: module.name.clone(),- current_lesson: lesson.name.clone(),- downloaded_bytes: total_bytes.load(Ordering::Relaxed),- total_lessons: total_lessons as u32,- completed_lessons: done as u32,- total_modules: total_modules as u32,- current_module_index: (mi + 1) as u32,- },- );- continue;- }+ if detail.video_url.is_none()+ && detail.files.is_empty()+ && detail.description.is_none()+ {+ failures += 1;}- if video_url.contains(".m3u8") {- match download_hls_video(video_url, &video_path, &cancel_token).await {- Ok(size) => {- total_bytes.fetch_add(size, Ordering::Relaxed);- }- Err(e) => {- tracing::error!(- "[kiwify] HLS download failed for '{}': {}",- lesson.name,- e- );- let _ = tokio::fs::remove_file(&video_path).await;- }+ if let Some(ref desc) = detail.description {+ if libreget_core::core::course_utils::save_description(+ &lesson_dir,+ desc,+ "html",+ )+ .await+ .is_err()+ {+ failures += 1;}- } else {- match download_with_ytdlp(video_url, &lesson_dir, &cancel_token).await {- Ok(size) => {- total_bytes.fetch_add(size, Ordering::Relaxed);+ }++ if let Some(ref video_url) = detail.video_url {+ let video_ext = if video_url.contains(".m3u8") {+ "mp4"+ } else {+ video_url+ .rsplit('.')+ .next()+ .and_then(|e| {+ let e = e.split('?').next().unwrap_or(e);+ if e.len() <= 4 {+ Some(e)+ } else {+ None+ }+ })+ .unwrap_or("mp4")+ };++ let video_path =+ format!("{}/{}. {}.{}", lesson_dir, li + 1, lesson_name, video_ext);++ if nonempty_file(&video_path).await {+ // Attachments below still need to run when the video already exists.+ tracing::debug!("[kiwify] reusing existing video");+ } else if video_url.contains(".m3u8") {+ match download_hls_video(video_url, &video_path, &cancel_token).await {+ Ok(size) => {+ total_bytes.fetch_add(size, Ordering::Relaxed);+ }+ Err(e) => {+ failures += 1;+ tracing::error!(+ "[kiwify] HLS download failed for '{}': {}",+ lesson.name,+ e+ );+ let _ = tokio::fs::remove_file(&video_path).await;+ }}- Err(e) => {- tracing::error!(+ } else {+ match download_with_ytdlp(video_url, &video_path, &cancel_token).await {+ Ok(size) => {+ total_bytes.fetch_add(size, Ordering::Relaxed);+ }+ Err(e) => {+ tracing::error!("[kiwify] yt-dlp download failed for '{}': {}, trying direct download",lesson.name,e);- match download_file_direct(- &session.client,- video_url,- &video_path,- &cancel_token,- )- .await- {- Ok(size) => {- total_bytes.fetch_add(size, Ordering::Relaxed);- }- Err(e2) => {- tracing::error!(- "[kiwify] Direct download also failed for '{}': {}",- lesson.name,- e2- );+ match download_file_direct(+ &media_client,+ video_url,+ &video_path,+ &cancel_token,+ )+ .await+ {+ Ok(size) => {+ total_bytes.fetch_add(size, Ordering::Relaxed);+ }+ Err(e2) => {+ failures += 1;+ tracing::error!(+ "[kiwify] Direct download also failed for '{}': {}",+ lesson.name,+ e2+ );+ }}}}}}- }- for file in &detail.files {- if cancel_token.is_cancelled() {- return Err(anyhow!("Download cancelled by user"));- }+ for file in &detail.files {+ if cancel_token.is_cancelled() {+ return Err(anyhow!("Download cancelled by user"));+ }- let file_name = filename::sanitize_path_component(&file.name);- let file_path = format!("{}/{}", lesson_dir, file_name);+ let file_name = filename::sanitize_path_component(&file.name);+ let file_path = format!("{}/{}", lesson_dir, file_name);- if tokio::fs::try_exists(&file_path).await.unwrap_or(false) {- let meta = tokio::fs::metadata(&file_path).await;- if meta.map(|m| m.len() > 0).unwrap_or(false) {- continue;+ if tokio::fs::try_exists(&file_path).await.unwrap_or(false) {+ let meta = tokio::fs::metadata(&file_path).await;+ if meta.map(|m| m.len() > 0).unwrap_or(false) {+ continue;+ }}- }- let download_url = if let Some(ref url) = file.url {- url.clone()- } else {- match api::get_file_download_url(session, &course.id, &file.id).await {- Ok(url) => url,+ let download_url = if let Some(ref url) = file.url {+ url.clone()+ } else {+ match api::get_file_download_url(session, lesson_course_id, &file.id).await+ {+ Ok(url) => url,+ Err(e) => {+ failures += 1;+ tracing::error!(+ "[kiwify] Failed to get download URL for file '{}': {}",+ file.name,+ e+ );+ continue;+ }+ }+ };++ match download_file_direct(+ &media_client,+ &download_url,+ &file_path,+ &cancel_token,+ )+ .await+ {+ Ok(size) => {+ total_bytes.fetch_add(size, Ordering::Relaxed);+ }Err(e) => {+ failures += 1;tracing::error!(- "[kiwify] Failed to get download URL for file '{}': {}",+ "[kiwify] File download failed for '{}': {}",file.name,e);- continue;}}- };-- match download_file_direct(- &session.client,- &download_url,- &file_path,- &cancel_token,- )- .await- {- Ok(size) => {- total_bytes.fetch_add(size, Ordering::Relaxed);- }- Err(e) => {- tracing::error!("[kiwify] File download failed for '{}': {}", file.name, e);- }}++ report.push(report_item(+ &module.name,+ &lesson.name,+ if failures == failures_before {+ LessonStatus::Saved+ } else {+ LessonStatus::Failed+ },+ if failures == failures_before {+ None+ } else {+ Some("content_save_failed")+ },+ ));+ } else {+ report.push(report_item(+ &module.name,+ &lesson.name,+ LessonStatus::Unavailable,+ Some("lesson_locked_expired_or_access_restricted"),+ ));}let done = completed.fetch_add(1, Ordering::Relaxed) + 1;- let _ = app.emit(- "download-progress",- &KiwifyCourseDownloadProgress {- course_id: course.id.clone(),- course_name: course.name.clone(),- percent: done as f64 / total_lessons as f64 * 100.0,- current_module: module.name.clone(),- current_lesson: lesson.name.clone(),- downloaded_bytes: total_bytes.load(Ordering::Relaxed),- total_lessons: total_lessons as u32,- completed_lessons: done as u32,- total_modules: total_modules as u32,- current_module_index: (mi + 1) as u32,- },- );+ on_progress(&KiwifyCourseDownloadProgress {+ course_id: course.id.clone(),+ course_name: course.name.clone(),+ percent: done as f64 / total_lessons as f64 * 100.0,+ current_module: module.name.clone(),+ current_lesson: lesson.name.clone(),+ downloaded_bytes: total_bytes.load(Ordering::Relaxed),+ total_lessons: total_lessons as u32,+ completed_lessons: done as u32,+ total_modules: total_modules as u32,+ current_module_index: (mi + 1) as u32,+ failed_items: failures as u32,+ });}}@@ -293,13 +397,74 @@ pub async fn download_full_course(return Err(anyhow!("Download cancelled by user"));}- libreget_core::core::course_utils::mark_course_complete(&course_dir)- .await- .ok();+ finish_course(&course_dir, discovered, &report).await?;Ok(())}+async fn nonempty_file(path: &str) -> bool {+ tokio::fs::metadata(path)+ .await+ .map(|m| m.is_file() && m.len() > 0)+ .unwrap_or(false)+}++async fn finish_course(+ course_dir: &str,+ total_contents: usize,+ items: &[LessonReport],+) -> anyhow::Result<()> {+ let saved = items+ .iter()+ .filter(|i| i.status == LessonStatus::Saved)+ .count();+ let unavailable = items+ .iter()+ .filter(|i| i.status == LessonStatus::Unavailable)+ .count();+ let failed = items+ .iter()+ .filter(|i| i.status == LessonStatus::Failed)+ .count();+ let not_processed = total_contents.saturating_sub(items.len());+ let complete = total_contents > 0+ && saved == total_contents+ && unavailable == 0+ && failed == 0+ && not_processed == 0;+ let summary = serde_json::json!({+ "schema_version": 1, "complete": complete, "total_contents": total_contents,+ "saved_contents": saved, "unavailable_contents": unavailable,+ "failed_contents": failed, "not_processed_contents": not_processed, "items": items,+ });+ let root = Path::new(course_dir);+ tokio::fs::write(+ root.join("download-report.json"),+ serde_json::to_vec_pretty(&summary)?,+ )+ .await?;+ let mut text = format!("Kiwify download report\nTotal contents: {}\nSaved: {}\nUnavailable: {}\nFailed: {}\nNot processed: {}\n\n",total_contents,saved,unavailable,failed,not_processed);+ for item in items {+ text.push_str(&format!(+ "{:?}\t{}\t{}\t{}\n",+ item.status,+ item.module,+ item.lesson,+ item.reason.as_deref().unwrap_or("")+ ));+ }+ tokio::fs::write(root.join("download-report.txt"), text).await?;+ if !complete {+ // Old versions could write this marker despite failures.+ let _ = tokio::fs::remove_file(Path::new(course_dir).join(".complete")).await;+ return Err(anyhow!(+ "Partial Kiwify download: {}/{} contents saved; {} unavailable, {} failed, {} not processed. See download-report.txt.",+ saved,total_contents,unavailable,failed,not_processed+ ));+ }+ libreget_core::core::course_utils::mark_course_complete(course_dir).await+}+async fn download_hls_video(m3u8_url: &str,output_path: &str,@@ -325,11 +490,15 @@ async fn download_hls_video(async fn download_with_ytdlp(url: &str,- output_dir: &str,+ output_path: &str,cancel_token: &CancellationToken,) -> anyhow::Result<u64> {let ytdlp_path = libreget_core::core::ytdlp::ensure_ytdlp().await?;- let out_dir = Path::new(output_dir);+ let out_path = Path::new(output_path);+ let out_dir = out_path+ .parent()+ .ok_or_else(|| anyhow!("Invalid video output path"))?;+ let template = video_filename_template(out_path)?;let (tx, _rx) = mpsc::channel(8);let result = libreget_core::core::ytdlp::download_video(@@ -340,7 +509,7 @@ async fn download_with_ytdlp(tx,None,None,- None,+ Some(&template),Some("https://admin.kiwify.com.br/"),cancel_token.clone(),None,@@ -354,6 +523,16 @@ async fn download_with_ytdlp(Ok(result.file_size_bytes)}+fn video_filename_template(output_path: &Path) -> anyhow::Result<String> {+ let stem = output_path+ .file_stem()+ .and_then(|s| s.to_str())+ .ok_or_else(|| anyhow!("Invalid video filename"))?;+ // Keep the extractor's actual container extension (e.g. WebM), and escape+ // literal percent signs in lesson titles for yt-dlp's template language.+ Ok(format!("{}.%(ext)s", stem.replace('%', "%%")))+}+async fn download_file_direct(client: &reqwest::Client,url: &str,@@ -372,3 +551,70 @@ async fn download_file_direct().await}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn extractor_template_preserves_native_format_and_literal_percent_in_titles() {+ let template = video_filename_template(Path::new("1. A 100% lesson.mp4")).unwrap();+ assert_eq!(template, "1. A 100%% lesson.%(ext)s");+ assert!(!template.ends_with(".mp4"));+ }++ #[tokio::test]+ async fn failed_batch_cannot_leave_a_success_marker_and_success_can_resume() {+ let path =+ std::env::temp_dir().join(format!("omniget-kiwify-test-{}", rand::random::<u64>()));+ tokio::fs::create_dir_all(&path).await.unwrap();+ let dir = path.to_str().unwrap();+ tokio::fs::write(path.join(".complete"), "old incorrect marker")+ .await+ .unwrap();+ let failed = [report_item(+ "module",+ "lesson",+ LessonStatus::Failed,+ Some("test_failure"),+ )];+ assert!(finish_course(dir, 1, &failed).await.is_err());+ assert!(!path.join(".complete").exists());+ let saved = [report_item("module", "lesson", LessonStatus::Saved, None)];+ finish_course(dir, 1, &saved).await.unwrap();+ assert!(path.join(".complete").exists());+ tokio::fs::remove_dir_all(path).await.unwrap();+ }++ #[tokio::test]+ async fn skipped_or_unprocessed_content_is_partial_not_complete() {+ let path =+ std::env::temp_dir().join(format!("omniget-kiwify-partial-{}", rand::random::<u64>()));+ tokio::fs::create_dir_all(&path).await.unwrap();+ let items = [+ report_item("module", "saved", LessonStatus::Saved, None),+ report_item(+ "module",+ "blocked",+ LessonStatus::Unavailable,+ Some("server_locked"),+ ),+ ];+ let error = finish_course(path.to_str().unwrap(), 3, &items)+ .await+ .unwrap_err()+ .to_string();+ assert!(error.contains("1/3 contents saved; 1 unavailable, 0 failed, 1 not processed"));+ assert!(!path.join(".complete").exists());+ let report: serde_json::Value = serde_json::from_slice(+ &tokio::fs::read(path.join("download-report.json"))+ .await+ .unwrap(),+ )+ .unwrap();+ assert_eq!(report["complete"], false);+ assert_eq!(report["unavailable_contents"], 1);+ assert_eq!(report["not_processed_contents"], 1);+ tokio::fs::remove_dir_all(path).await.unwrap();+ }+}diff --git a/src-tauri/plugins/courses/src/platforms/skool/api.rs b/src-tauri/plugins/courses/src/platforms/skool/api.rsindex 11dc003c..53e21d62 100644--- a/src-tauri/plugins/courses/src/platforms/skool/api.rs+++ b/src-tauri/plugins/courses/src/platforms/skool/api.rs@@ -313,9 +313,18 @@ pub async fn get_group_courses(.unwrap_or(&course_slug).to_string();- let lessons = get_course_lessons(session, group_slug, &course_slug)- .await- .unwrap_or_default();+ let lessons = match get_course_lessons(session, group_slug, &course_slug).await {+ Ok(l) => l,+ Err(e) => {+ tracing::warn!(+ "[skool] Failed to fetch lessons for course '{}' in group '{}': {}",+ course_slug,+ group_slug,+ e+ );+ Vec::new()+ }+ };modules.push(SkoolModule {id: if course_id.is_empty() {@@ -333,7 +342,10 @@ pub async fn get_group_courses(}pub fn parse_next_redirect_md(body: &serde_json::Value) -> Option<String> {- let redirect = body.get("__N_REDIRECT").and_then(|v| v.as_str())?;+ let redirect = body+ .pointer("/pageProps/__N_REDIRECT")+ .or_else(|| body.get("__N_REDIRECT"))+ .and_then(|v| v.as_str())?;let target = if redirect.starts_with("http") {redirect.to_string()} else {@@ -347,13 +359,14 @@ pub fn parse_next_redirect_md(body: &serde_json::Value) -> Option<String> {}pub fn parse_lesson_detail(child: &serde_json::Value) -> SkoolLessonDetail {- let lesson_id = child+ let effective = child.get("course").unwrap_or(child);+ let lesson_id = effective.get("id").and_then(|v| v.as_str()).unwrap_or("").to_string();- let metadata = child.get("metadata").unwrap_or(child);+ let metadata = effective.get("metadata").unwrap_or(effective);let name = metadata.get("title")@@ -367,6 +380,7 @@ pub fn parse_lesson_detail(child: &serde_json::Value) -> SkoolLessonDetail {.or_else(|| metadata.get("content")).or_else(|| metadata.get("body")).or_else(|| metadata.get("text"))+ .or_else(|| metadata.get("desc")).and_then(|v| {if v.is_string() {v.as_str().map(String::from)@@ -376,17 +390,41 @@ pub fn parse_lesson_detail(child: &serde_json::Value) -> SkoolLessonDetail {}).filter(|s| !s.trim().is_empty());- let video_url = metadata+ let mut video_url = metadata.get("videoLink").or_else(|| metadata.get("video_url")).or_else(|| metadata.get("video")).and_then(|v| v.as_str()).map(String::from);+ if video_url.is_none() {+ let playback_id = metadata+ .get("videoId")+ .or_else(|| metadata.get("playbackId"))+ .or_else(|| effective.pointer("/video/playbackId"))+ .and_then(|v| v.as_str());+ let playback_token = metadata+ .get("playbackToken")+ .or_else(|| effective.pointer("/video/playbackToken"))+ .and_then(|v| v.as_str());++ if let Some(pid) = playback_id {+ if let Some(token) = playback_token {+ video_url = Some(format!(+ "https://stream.mux.com/{}.m3u8?token={}",+ pid, token+ ));+ } else {+ video_url = Some(format!("https://stream.mux.com/{}.m3u8", pid));+ }+ }+ }+let mut files = Vec::new();let raw_attachments = metadata.get("attachments")+ .or_else(|| metadata.get("resources")).or_else(|| metadata.get("files")).and_then(|v| v.as_array());@@ -423,9 +461,10 @@ pub fn parse_lesson_detail(child: &serde_json::Value) -> SkoolLessonDetail {}fn parse_lesson_node(child: &serde_json::Value, order: i64) -> SkoolLesson {- let metadata = child.get("metadata").unwrap_or(child);+ let effective = child.get("course").unwrap_or(child);+ let metadata = effective.get("metadata").unwrap_or(effective);- let lesson_id = child+ let lesson_id = effective.get("id").and_then(|v| v.as_str()).unwrap_or("")@@ -666,6 +705,16 @@ mod tests {}});assert_eq!(parse_next_redirect_md(&normal_json), None);++ let page_props_redirect_json = serde_json::json!({+ "pageProps": {+ "__N_REDIRECT": "/my-group/classroom/intro-course?md=module_pageprops123",+ "__N_REDIRECT_STATUS": 307+ },+ "__N_SSP": true+ });+ let md = parse_next_redirect_md(&page_props_redirect_json);+ assert_eq!(md.as_deref(), Some("module_pageprops123"));}#[test]@@ -744,4 +793,41 @@ mod tests {assert_eq!(lessons[0].id, "les_nested_1");assert_eq!(lessons[0].name, "Nested Lesson 1");}++ #[test]+ fn test_parse_course_lessons_wrapped_course_and_mux_video() {+ let payload = serde_json::json!({+ "pageProps": {+ "course": {+ "children": [+ {+ "course": {+ "id": "les_wrapped_1",+ "unitType": "module",+ "metadata": {+ "title": "Wrapped Mux Lesson",+ "desc": "Lesson description text",+ "videoId": "mux_play_12345",+ "playbackToken": "jwt_token_abc"+ }+ }+ }+ ]+ }+ }+ });++ let lessons = parse_course_lessons(&payload);+ assert_eq!(lessons.len(), 1);+ assert_eq!(lessons[0].id, "les_wrapped_1");+ assert_eq!(lessons[0].name, "Wrapped Mux Lesson");+ assert_eq!(+ lessons[0].detail.video_url.as_deref(),+ Some("https://stream.mux.com/mux_play_12345.m3u8?token=jwt_token_abc")+ );+ assert_eq!(+ lessons[0].detail.description.as_deref(),+ Some("Lesson description text")+ );+ }}diff --git a/src-tauri/src/commands/dependencies.rs b/src-tauri/src/commands/dependencies.rsindex bbb921ec..5c17bb69 100644--- a/src-tauri/src/commands/dependencies.rs+++ b/src-tauri/src/commands/dependencies.rs@@ -27,13 +27,14 @@ pub struct DependencyVariantInfo {#[tauri::command]pub async fn check_dependencies() -> Result<Vec<DependencyStatus>, String> {- let (ytdlp_result, ffmpeg_result) = tokio::join!(+ let (ytdlp_result, ffmpeg_result, gallerydl_result) = tokio::join!(dependencies::find_tool_with_source("yt-dlp"),dependencies::find_tool_with_source("ffmpeg"),+ dependencies::find_tool_with_source("gallery-dl"),);// Extract versions from the already-found paths — no second find required.- let (ytdlp_version, ffmpeg_version) = tokio::join!(+ let (ytdlp_version, ffmpeg_version, gallerydl_version) = tokio::join!(async {match ytdlp_result.as_ref() {Some((path, _)) => dependencies::check_version_at_path(path, "yt-dlp").await,@@ -46,6 +47,12 @@ pub async fn check_dependencies() -> Result<Vec<DependencyStatus>, String> {None => None,}},+ async {+ match gallerydl_result.as_ref() {+ Some((path, _)) => dependencies::check_version_at_path(path, "gallery-dl").await,+ None => None,+ }+ },);let pdfium_resolved = pdfium::resolve_with_source();@@ -68,6 +75,12 @@ pub async fn check_dependencies() -> Result<Vec<DependencyStatus>, String> {.unwrap_or_else(|| "missing".to_string());let ffmpeg_path = ffmpeg_result.map(|(p, _)| p.to_string_lossy().to_string());+ let gallerydl_source = gallerydl_result+ .as_ref()+ .map(|(_, s)| s.to_string())+ .unwrap_or_else(|| "missing".to_string());+ let gallerydl_path = gallerydl_result.map(|(p, _)| p.to_string_lossy().to_string());+let ytdlp_outdated = ytdlp_version.as_deref().and_then(crate::core::ytdlp::ytdlp_version_is_supported)@@ -107,6 +120,14 @@ pub async fn check_dependencies() -> Result<Vec<DependencyStatus>, String> {.map(|(p, _)| p.to_string_lossy().to_string()),outdated: false,},+ DependencyStatus {+ name: "gallery-dl".into(),+ installed: gallerydl_version.is_some(),+ version: gallerydl_version,+ source: gallerydl_source,+ path: gallerydl_path,+ outdated: false,+ },])}@@ -158,6 +179,18 @@ pub async fn install_dependency(.map_err(|e| e.to_string())?;return Ok(pdfium::read_version_marker().unwrap_or_else(|| "installed".to_string()));}+ "gallery-dl" => {+ if force {+ archive_before_update("gallery-dl").await;+ dependencies::update_gallerydl()+ .await+ .map_err(|e| e.to_string())?;+ } else {+ dependencies::download_gallerydl()+ .await+ .map_err(|e| e.to_string())?;+ }+ }_ => return Err(format!("Unknown dependency: {}", name)),}@@ -178,6 +211,11 @@ pub async fn install_dependency(async fn managed_binary_path(name: &str) -> Option<PathBuf> {match name {"yt-dlp" => libreget_core::core::ytdlp::managed_ytdlp_path(),+ "gallery-dl" => {+ let bin_dir = libreget_core::core::dependencies::managed_bin_dir()?;+ let target = bin_dir.join(libreget_core::core::dependencies::bin_name("gallery-dl"));+ target.exists().then_some(target)+ }_ => None,}}@@ -275,7 +313,7 @@ pub fn dependency_variants(name: String) -> Result<Vec<DependencyVariantInfo>, Srecommended: v.recommended,}).collect()),- "yt-dlp" | "FFmpeg" => Ok(Vec::new()),+ "yt-dlp" | "FFmpeg" | "gallery-dl" => Ok(Vec::new()),_ => Err(format!("Unknown dependency: {}", name)),}}@@ -285,7 +323,7 @@ pub fn dependency_install_dir(name: String) -> Result<String, String> {let dir = match name.as_str() {"PDFium" => pdfium::pdfium_target_dir().ok_or_else(|| "could not determine plugin data dir".to_string())?,- "yt-dlp" | "FFmpeg" => crate::core::paths::app_data_dir()+ "yt-dlp" | "FFmpeg" | "gallery-dl" => crate::core::paths::app_data_dir().ok_or_else(|| "could not determine app data dir".to_string())?.join("bin"),_ => return Err(format!("Unknown dependency: {}", name)),diff --git a/src-tauri/src/commands/downloads.rs b/src-tauri/src/commands/downloads.rsindex ab75865e..0258bd62 100644--- a/src-tauri/src/commands/downloads.rs+++ b/src-tauri/src/commands/downloads.rs@@ -1189,6 +1189,10 @@ pub async fn cancel_generic_download(emit_queue_state_from_state(&app, s);queue::try_start_next(app, state.download_queue.clone()).await;Ok("Download cancelled".to_string())+ } else if crate::commands::nami::dispatcher::cancel_running_download(&download_id.to_string())+ .is_ok()+ {+ Ok("Download cancelled".to_string())} else {Err("No active download for this ID".to_string())}@@ -1319,15 +1323,70 @@ fn delete_downloaded_path(path: &str) {}}+#[tauri::command]+pub async fn failed_download_leftovers(+ state: tauri::State<'_, AppState>,+ download_id: u64,+) -> Result<Vec<libreget_core::core::leftovers::LeftoverFile>, String> {+ let q = state.download_queue.lock().await;+ let Some(item) = q+ .items+ .iter()+ .find(|i| i.id == download_id && matches!(i.status, queue::QueueStatus::Error { .. }))+ else {+ return Ok(Vec::new());+ };+ let finished = item.file_path.as_deref().map(std::path::Path::new);+ let mut files = libreget_core::core::leftovers::task_leftovers(download_id, finished);+ if files.is_empty() {+ if let Some(fp) = item.file_path.as_deref() {+ files = libreget_core::core::leftovers::find_leftovers(+ &[std::path::PathBuf::from(fp)],+ finished,+ )+ .into_iter()+ .map(|p| libreget_core::core::leftovers::LeftoverFile {+ size_bytes: std::fs::metadata(&p).map(|m| m.len()).unwrap_or(0),+ name: p+ .file_name()+ .map(|n| n.to_string_lossy().into_owned())+ .unwrap_or_else(|| p.to_string_lossy().into_owned()),+ path: p.to_string_lossy().into_owned(),+ })+ .collect();+ }+ }+ Ok(files)+}+#[tauri::command]pub async fn remove_download(app: tauri::AppHandle,state: tauri::State<'_, AppState>,download_id: u64,delete_file: Option<bool>,+ delete_partials: Option<bool>,) -> Result<String, String> {let (state_to_emit, seeding_torrent_id, file_path) = {let mut q = state.download_queue.lock().await;+ if delete_partials.unwrap_or(false) {+ if let Some(item) = q.items.iter().find(|i| {+ i.id == download_id && matches!(i.status, queue::QueueStatus::Error { .. })+ }) {+ let finished = item.file_path.as_deref().map(std::path::Path::new);+ libreget_core::core::leftovers::delete_task_leftovers(download_id, finished);+ if let Some(fp) = item.file_path.as_deref() {+ let orphans = libreget_core::core::leftovers::find_leftovers(+ &[std::path::PathBuf::from(fp)],+ finished,+ );+ for o in orphans {+ let _ = std::fs::remove_file(o);+ }+ }+ }+ }+ libreget_core::core::leftovers::forget_task_destinations(download_id);let path = if delete_file.unwrap_or(false) {q.items.iter()@@ -1698,6 +1757,9 @@ pub async fn reveal_file(path: String) -> Result<(), String> {#[cfg(not(target_os = "android"))]#[tauri::command]pub async fn open_path_default(path: String) -> Result<(), String> {+ if !std::path::Path::new(&path).exists() {+ return Err(format!("File or directory does not exist: {}", path));+ }open::that_detached(&path).map_err(|e| e.to_string())}diff --git a/src-tauri/src/commands/nami/args.rs b/src-tauri/src/commands/nami/args.rsindex 0f777c6b..295e725d 100644--- a/src-tauri/src/commands/nami/args.rs+++ b/src-tauri/src/commands/nami/args.rs@@ -67,8 +67,8 @@ pub fn build_gallery_dl_args(options: &GalleryDlArgsOptions) -> Vec<String> {"3".to_string(),"--sleep-429".to_string(),"10".to_string(),- "--Print".to_string(),- "after:FILE_OK:{filename}.{extension}".to_string(),+ "--exec".to_string(),+ "echo FILE_OK:{_path}".to_string(),];if let Some(threshold) = options.abort_after_duplicates {@@ -249,11 +249,6 @@ pub fn build_yt_dlp_args(options: &YtDlpArgsOptions) -> Vec<String> {}}- if options.platform.eq_ignore_ascii_case("x") && options.skip_replies == Some(true) {- args.push("--filter".to_string());- args.push("not reply or in_reply_to_user_id == user_id".to_string());- }-// Guard against CLI argument injectionargs.push("--".to_string());args.push(options.clean_url.to_string());diff --git a/src-tauri/src/commands/nami/dispatcher.rs b/src-tauri/src/commands/nami/dispatcher.rsindex 67f72499..56cf2afc 100644--- a/src-tauri/src/commands/nami/dispatcher.rs+++ b/src-tauri/src/commands/nami/dispatcher.rs@@ -621,19 +621,49 @@ fn run_process_stream(let download_id = reg.id.clone();let files_downloaded = files_downloaded.clone();let stage_label = stage_label.to_string();+ let numeric_queue_id: Option<u64> = download_id+ .chars()+ .filter(|c| c.is_ascii_digit())+ .collect::<String>()+ .parse::<u64>()+ .ok();thread::spawn(move || {let reader = BufReader::new(stdout);for line in reader.lines().map_while(Result::ok) {+ let trimmed_line = line.trim();+ if !trimmed_line.is_empty() {+ crate::core::flight_recorder::record(trimmed_line);+ if let Some(qid) = numeric_queue_id {+ let should_emit = crate::core::download_log::push_line(qid, trimmed_line);+ if should_emit {+ let _ = tauri::Emitter::emit(+ &app,+ "download-log-update",+ serde_json::json!({ "id": qid, "line": trimmed_line }),+ );+ }+ }+ }+if let Some(pos) = line.find("FILE_OK:") {- let filename = line[pos + "FILE_OK:".len()..].trim();+ let raw_target = line[pos + "FILE_OK:".len()..].trim();let count = files_downloaded.fetch_add(1, Ordering::SeqCst) + 1;if let Some((ref dest, ref plat, ref author, ref page_url)) = target_context {- let full_path = dest.join(filename);+ let candidate = PathBuf::from(raw_target);+ let full_path = if candidate.is_absolute() {+ candidate+ } else {+ dest.join(&candidate)+ };+ let file_name = full_path+ .file_name()+ .and_then(|n| n.to_str())+ .unwrap_or(raw_target);let size = fs::metadata(&full_path).ok().map(|m| m.len());- let stem = Path::new(filename)+ let stem = Path::new(file_name).file_stem().and_then(|s| s.to_str())- .unwrap_or(filename);+ .unwrap_or(file_name);let post_id = stem.split(['_', '-', ' ']).last()@@ -652,10 +682,14 @@ fn run_process_stream(};let _ = crate::commands::nami::ledger::record_media(&record);}+ let short_name = Path::new(raw_target)+ .file_name()+ .and_then(|n| n.to_str())+ .unwrap_or(raw_target);let _ = app.emit(&format!("download_{}", download_id),DownloadProgress {- message: format!("Downloaded: {}", filename),+ message: format!("Downloaded: {}", short_name),files_downloaded: base_count + count,stage: Some(stage_label.clone()),stage_index: Some(stage_index),@@ -718,6 +752,12 @@ fn run_process_stream(let files_downloaded = files_downloaded.clone();let stderr_tail = stderr_tail.clone();let stage_label = stage_label.to_string();+ let numeric_queue_id: Option<u64> = download_id+ .chars()+ .filter(|c| c.is_ascii_digit())+ .collect::<String>()+ .parse::<u64>()+ .ok();thread::spawn(move || {let reader = BufReader::new(stderr);for line in reader.lines().map_while(Result::ok) {@@ -725,6 +765,17 @@ fn run_process_stream(if trimmed.is_empty() {continue;}+ crate::core::flight_recorder::record(trimmed);+ if let Some(qid) = numeric_queue_id {+ let should_emit = crate::core::download_log::push_line(qid, trimmed);+ if should_emit {+ let _ = tauri::Emitter::emit(+ &app,+ "download-log-update",+ serde_json::json!({ "id": qid, "line": trimmed }),+ );+ }+ }{let mut tail = stderr_tail.lock().unwrap_or_else(|p| p.into_inner());if tail.len() >= 30 {@@ -770,10 +821,16 @@ fn run_process_stream(});}- if status.success() || final_count > 0 {+ let is_up_to_date = status.code() == Some(4);++ if status.success() || final_count > 0 || is_up_to_date {Ok(DownloadResult {success: true,- message: format!("Successfully downloaded {} files", final_count),+ message: if is_up_to_date && final_count == 0 {+ "Already up to date (no new files)".to_string()+ } else {+ format!("Successfully downloaded {} files", final_count)+ },files_count: final_count,cancelled: false,})diff --git a/src-tauri/src/commands/nami/fetcher.rs b/src-tauri/src/commands/nami/fetcher.rsindex 098c4572..3261afae 100644--- a/src-tauri/src/commands/nami/fetcher.rs+++ b/src-tauri/src/commands/nami/fetcher.rs@@ -83,6 +83,31 @@ pub fn resolve_gallery_dl(app_data_dir: &Path) -> Option<PathBuf> {return Some(p);}+ #[cfg(unix)]+ {+ let common = [+ PathBuf::from("/home/linuxbrew/.linuxbrew/bin/gallery-dl"),+ PathBuf::from("/usr/local/bin/gallery-dl"),+ PathBuf::from("/usr/bin/gallery-dl"),+ ];+ for p in &common {+ if p.exists() {+ return Some(p.clone());+ }+ }+ if let Some(h) = dirs::home_dir() {+ let user_bins = [+ h.join(".linuxbrew/bin/gallery-dl"),+ h.join(".local/bin/gallery-dl"),+ ];+ for p in &user_bins {+ if p.exists() {+ return Some(p.clone());+ }+ }+ }+ }+None}@@ -101,6 +126,28 @@ pub fn resolve_yt_dlp(app_data_dir: &Path) -> Option<PathBuf> {return Some(p);}+ #[cfg(unix)]+ {+ let common = [+ PathBuf::from("/home/linuxbrew/.linuxbrew/bin/yt-dlp"),+ PathBuf::from("/usr/local/bin/yt-dlp"),+ PathBuf::from("/usr/bin/yt-dlp"),+ ];+ for p in &common {+ if p.exists() {+ return Some(p.clone());+ }+ }+ if let Some(h) = dirs::home_dir() {+ let user_bins = [h.join(".linuxbrew/bin/yt-dlp"), h.join(".local/bin/yt-dlp")];+ for p in &user_bins {+ if p.exists() {+ return Some(p.clone());+ }+ }+ }+ }+None}diff --git a/src-tauri/src/commands/nami/http.rs b/src-tauri/src/commands/nami/http.rsindex b8e8b9e0..e2e22c43 100644--- a/src-tauri/src/commands/nami/http.rs+++ b/src-tauri/src/commands/nami/http.rs@@ -5,6 +5,8 @@ use reqwest::header::{HeaderMap, HeaderName, HeaderValue};use serde::{Deserialize, Serialize};use std::collections::HashMap;use std::fs;+use std::path::{Path, PathBuf};+use std::process::{Command, Stdio};use std::str::FromStr;use std::time::Duration;use tauri::command;@@ -145,6 +147,263 @@ pub async fn nami_http_fetch(options: HttpRequestOptions) -> Result<HttpResponse})}+#[derive(Debug, Serialize, Deserialize, Clone)]+pub struct CachedAvatar {+ pub file_path: String,+ pub data_url: String,+}++#[command]+pub async fn nami_cache_avatar(url: String) -> Result<CachedAvatar, String> {+ let trimmed = url.trim();+ if trimmed.is_empty() {+ return Err("Avatar URL cannot be empty".to_string());+ }++ if trimmed.starts_with("data:") {+ return Ok(CachedAvatar {+ file_path: String::new(),+ data_url: trimmed.to_string(),+ });+ }++ if trimmed.starts_with("asset://") || trimmed.starts_with("http://asset.localhost") {+ return Ok(CachedAvatar {+ file_path: trimmed.to_string(),+ data_url: trimmed.to_string(),+ });+ }++ let nami_dir = crate::commands::nami::libreget_nami_dir()?;+ let avatars_dir = nami_dir.join("avatars");+ fs::create_dir_all(&avatars_dir)+ .map_err(|e| format!("Failed to create avatars directory: {}", e))?;++ use base64::Engine;+ use sha2::{Digest, Sha256};++ let ext_to_mime = |extension: &str| -> &'static str {+ match extension {+ "png" => "image/png",+ "webp" => "image/webp",+ "gif" => "image/gif",+ "svg" => "image/svg+xml",+ _ => "image/jpeg",+ }+ };++ let mut hasher = Sha256::new();+ hasher.update(trimmed.as_bytes());+ let hash = format!("{:x}", hasher.finalize());++ if let Ok(entries) = fs::read_dir(&avatars_dir) {+ for entry in entries.flatten() {+ if let Ok(ft) = entry.file_type() {+ if ft.is_file() {+ if let Some(name) = entry.file_name().to_str() {+ if name.starts_with(&hash) {+ let path = entry.path();+ if let Ok(bytes) = fs::read(&path) {+ if !bytes.is_empty() {+ let ext =+ path.extension().and_then(|e| e.to_str()).unwrap_or("jpg");+ let mime = ext_to_mime(ext);+ let b64 =+ base64::engine::general_purpose::STANDARD.encode(&bytes);+ let data_url = format!("data:{};base64,{}", mime, b64);+ return Ok(CachedAvatar {+ file_path: path.to_string_lossy().to_string(),+ data_url,+ });+ }+ }+ }+ }+ }+ }+ }+ }++ let client = crate::core::http_client::apply_global_proxy(reqwest::Client::builder())+ .timeout(Duration::from_millis(12_000))+ .build()+ .map_err(|e| format!("Failed to build HTTP client for avatar: {}", e))?;++ let user_agent = if trimmed.contains("fbsbx.com")+ || trimmed.contains("facebook.com")+ || trimmed.contains("instagram.com")+ {+ "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"+ } else {+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"+ };++ let resp = client+ .get(trimmed)+ .header(reqwest::header::USER_AGENT, user_agent)+ .header(+ reqwest::header::ACCEPT,+ "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8",+ )+ .header(reqwest::header::ACCEPT_LANGUAGE, "en-US,en;q=0.9")+ .send()+ .await+ .map_err(|e| format!("Network request failed for avatar: {}", e))?;++ if !resp.status().is_success() {+ return Err(format!(+ "Avatar download failed with status {}",+ resp.status()+ ));+ }++ let content_type = resp+ .headers()+ .get(reqwest::header::CONTENT_TYPE)+ .and_then(|v| v.to_str().ok())+ .unwrap_or("")+ .to_lowercase();++ if content_type.starts_with("text/html") {+ return Err("Avatar request returned HTML instead of an image".to_string());+ }++ let ext = if content_type.contains("png") {+ "png"+ } else if content_type.contains("webp") {+ "webp"+ } else if content_type.contains("gif") {+ "gif"+ } else if content_type.contains("svg") {+ "svg"+ } else {+ "jpg"+ };++ let bytes = resp+ .bytes()+ .await+ .map_err(|e| format!("Failed to read avatar bytes: {}", e))?;++ if bytes.is_empty() {+ return Err("Received empty avatar response".to_string());+ }++ let target_path = avatars_dir.join(format!("{}.{}", hash, ext));+ let temp_path = avatars_dir.join(format!("{}.tmp.{}", hash, std::process::id()));++ fs::write(&temp_path, &bytes)+ .map_err(|e| format!("Failed to write temporary avatar file: {}", e))?;+ fs::rename(&temp_path, &target_path)+ .map_err(|e| format!("Failed to persist avatar file: {}", e))?;++ let mime = ext_to_mime(ext);+ let b64 = base64::engine::general_purpose::STANDARD.encode(&bytes);+ let data_url = format!("data:{};base64,{}", mime, b64);++ Ok(CachedAvatar {+ file_path: target_path.to_string_lossy().to_string(),+ data_url,+ })+}++#[derive(Debug, Serialize, Deserialize, Clone)]+pub struct ResolvedProfileAvatar {+ pub data_url: String,+ pub name: Option<String>,+}++#[command]+pub async fn nami_resolve_facebook_avatar(+ url: String,+) -> Result<Option<ResolvedProfileAvatar>, String> {+ let clean = url.trim().trim_end_matches('/');+ if clean.is_empty() {+ return Ok(None);+ }++ let target_url = if clean.ends_with("/avatar") {+ clean.to_string()+ } else {+ format!("{}/avatar", clean)+ };++ let app_dir = crate::commands::nami::libreget_nami_dir().unwrap_or_else(|_| PathBuf::from("."));+ let gallery_bin = crate::commands::nami::fetcher::resolve_gallery_dl(&app_dir);++ if let Some(bin) = gallery_bin {+ let mut cmd = Command::new(&bin);+ cmd.args(["-j", &target_url, "--range", "1"]);+ cmd.stdin(Stdio::null());+ cmd.stdout(Stdio::piped());+ cmd.stderr(Stdio::null());++ #[cfg(target_os = "windows")]+ {+ use std::os::windows::process::CommandExt;+ cmd.creation_flags(0x08000000);+ }++ if let Ok(output) = cmd.output() {+ if output.status.success() {+ let stdout_str = String::from_utf8_lossy(&output.stdout);+ if let Ok(json_val) = serde_json::from_str::<serde_json::Value>(&stdout_str) {+ let mut author_name: Option<String> = None;+ let mut direct_image_url: Option<String> = None;++ if let Some(arr) = json_val.as_array() {+ for item in arr {+ if let Some(sub_arr) = item.as_array() {+ if sub_arr.len() >= 2 && sub_arr[0] == 2 {+ if let Some(obj) = sub_arr[1].as_object() {+ if let Some(u) =+ obj.get("username").and_then(|v| v.as_str())+ {+ if !u.is_empty() {+ author_name = Some(u.to_string());+ }+ }+ }+ } else if sub_arr.len() >= 3 && sub_arr[0] == 3 {+ if let Some(img_url) = sub_arr[1].as_str() {+ if img_url.starts_with("http") {+ direct_image_url = Some(img_url.to_string());+ }+ }+ }+ }+ }+ }++ if let Some(img_url) = direct_image_url {+ if let Ok(cached) = nami_cache_avatar(img_url).await {+ return Ok(Some(ResolvedProfileAvatar {+ data_url: cached.data_url,+ name: author_name,+ }));+ }+ }+ }+ }+ }+ }++ // Fallback: Check Graph API for public Pages+ let clean_user = clean.rsplit('/').next().unwrap_or(clean);+ let graph_url = format!(+ "https://graph.facebook.com/{}/picture?type=large",+ clean_user+ );+ if let Ok(cached) = nami_cache_avatar(graph_url).await {+ return Ok(Some(ResolvedProfileAvatar {+ data_url: cached.data_url,+ name: None,+ }));+ }++ Ok(None)+}+#[cfg(test)]mod tests {use super::*;diff --git a/src-tauri/src/commands/nami/ledger.rs b/src-tauri/src/commands/nami/ledger.rsindex 2fdd6370..fdff1fc1 100644--- a/src-tauri/src/commands/nami/ledger.rs+++ b/src-tauri/src/commands/nami/ledger.rs@@ -1,6 +1,7 @@use rusqlite::{params, Connection};use serde::{Deserialize, Serialize};-use std::path::Path;+use std::fs;+use std::path::{Path, PathBuf};use crate::core::db;@@ -140,6 +141,102 @@ pub fn delete_record(id: &str) -> Result<bool, String> {.ok_or_else(|| "Failed to delete record from database".to_string())}+fn scan_and_index_nami_dir(conn: &Connection, base_dir: &Path) -> rusqlite::Result<usize> {+ if !base_dir.exists() {+ return Ok(0);+ }++ let mut added = 0;+ let mut exists_stmt =+ conn.prepare_cached("SELECT 1 FROM nami_media WHERE file_path = ?1 LIMIT 1")?;+ let mut insert_stmt = conn.prepare_cached(+ "INSERT OR IGNORE INTO nami_media (id, platform, post_id, author, url, file_path, file_size, sha256, downloaded_at)+ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9)",+ )?;++ let mut stack = vec![(base_dir.to_path_buf(), 0)];+ while let Some((dir, depth)) = stack.pop() {+ if depth > 4 {+ continue;+ }+ let entries = match fs::read_dir(&dir) {+ Ok(e) => e,+ Err(_) => continue,+ };+ for entry in entries.flatten() {+ let path = entry.path();+ if path.is_dir() {+ stack.push((path, depth + 1));+ } else if path.is_file() {+ let ext = path+ .extension()+ .and_then(|e| e.to_str())+ .unwrap_or("")+ .to_lowercase();+ if matches!(+ ext.as_str(),+ "jpg" | "jpeg" | "png" | "webp" | "gif" | "mp4" | "mov" | "webm"+ ) {+ let path_str = path.to_string_lossy().to_string();+ if !exists_stmt.exists(params![&path_str])? {+ let meta = fs::metadata(&path).ok();+ let size = meta.as_ref().map(|m| m.len() as i64);+ let downloaded_at = meta+ .as_ref()+ .and_then(|m| m.modified().ok())+ .and_then(|t| t.duration_since(std::time::UNIX_EPOCH).ok())+ .map(|d| d.as_secs() as i64)+ .unwrap_or_else(|| chrono::Utc::now().timestamp());++ let file_name = path.file_name().and_then(|n| n.to_str()).unwrap_or("");+ let stem = path+ .file_stem()+ .and_then(|s| s.to_str())+ .unwrap_or(file_name);+ let post_id = stem+ .split(['_', '-', ' '])+ .last()+ .unwrap_or(stem)+ .to_string();++ let mut platform = "nami".to_string();+ let mut author = None;++ if let Ok(rel) = path.strip_prefix(base_dir) {+ let comps: Vec<_> = rel+ .components()+ .map(|c| c.as_os_str().to_string_lossy().to_string())+ .collect();+ if comps.len() >= 2 {+ platform = comps[0].clone();+ author = Some(comps[1].clone());+ } else if comps.len() == 1 {+ platform = comps[0].clone();+ }+ }++ let id = format!("{}_{}", platform.to_lowercase(), stem);+ insert_stmt.execute(params![+ id,+ platform.to_lowercase(),+ post_id,+ author,+ "",+ path_str,+ size,+ Option::<String>::None,+ downloaded_at,+ ])?;+ added += 1;+ }+ }+ }+ }+ }++ Ok(added)+}+pub fn reconcile_disk_on(conn: &Connection) -> rusqlite::Result<ReconcileResult> {init_schema_on(conn)?;let mut stmt = conn.prepare_cached("SELECT id, file_path FROM nami_media")?;@@ -154,10 +251,8 @@ pub fn reconcile_disk_on(conn: &Connection) -> rusqlite::Result<ReconcileResult>let (id, file_path) = row?;checked += 1;let p = Path::new(&file_path);- if let Some(parent) = p.parent() {- if parent.exists() && !p.exists() {- to_delete.push(id);- }+ if !p.exists() {+ to_delete.push(id);}}@@ -166,6 +261,30 @@ pub fn reconcile_disk_on(conn: &Connection) -> rusqlite::Result<ReconcileResult>conn.execute("DELETE FROM nami_media WHERE id = ?1", params![id])?;}+ #[cfg(not(test))]+ {+ let mut candidate_dirs = Vec::new();+ if let Some(down) = dirs::download_dir() {+ candidate_dirs.push(down.join("Nami"));+ }+ if let Ok(home) = std::env::var("HOME").or_else(|_| std::env::var("USERPROFILE")) {+ let p = PathBuf::from(home).join("Downloads").join("Nami");+ if !candidate_dirs.contains(&p) {+ candidate_dirs.push(p);+ }+ }++ let mut added = 0;+ for dir in candidate_dirs {+ if dir.exists() {+ if let Ok(n) = scan_and_index_nami_dir(conn, &dir) {+ added += n;+ }+ }+ }+ checked += added;+ }+Ok(ReconcileResult { checked, removed })}diff --git a/src-tauri/src/commands/nami/mod.rs b/src-tauri/src/commands/nami/mod.rsindex cba59571..4755c58b 100644--- a/src-tauri/src/commands/nami/mod.rs+++ b/src-tauri/src/commands/nami/mod.rs@@ -121,6 +121,21 @@ fn normalize_profile_url(platform: &str, raw_input: &str) -> String {return format!("https://www.tiktok.com/@{}", user.to_lowercase());}+ if platform == "facebook" && path.eq_ignore_ascii_case("profile.php") {+ if let Some((_, query_and_frag)) = without_scheme.split_once('?') {+ let (query, _) = query_and_frag+ .split_once('#')+ .unwrap_or((query_and_frag, ""));+ for pair in query.split('&') {+ if let Some((k, v)) = pair.split_once('=') {+ if k.eq_ignore_ascii_case("id") && !v.is_empty() {+ return format!("https://www.facebook.com/profile.php?id={}", v);+ }+ }+ }+ }+ }+if platform == "x" {if path.starts_with("i/history/likes") {return "https://x.com/i/history/likes".to_string();@@ -216,14 +231,28 @@ pub fn nami_save_app_settings(Ok("Settings saved successfully".to_string())}+fn default_nami_output_dir() -> Option<String> {+ dirs::download_dir()+ .map(|d| d.join("Nami").to_string_lossy().to_string())+ .or_else(|| {+ dirs::home_dir().map(|h| {+ h.join("Downloads")+ .join("Nami")+ .to_string_lossy()+ .to_string()+ })+ })+}+#[command]pub fn nami_load_app_settings() -> Result<AppSettings, String> {let _storage_guard = NAMI_STORAGE_LOCK.lock().unwrap_or_else(|p| p.into_inner());+ let default_out = default_nami_output_dir();let settings_file = libreget_nami_dir()?.join("app_settings.json");if !settings_file.exists() {return Ok(AppSettings {- output_directory: None,+ output_directory: default_out,cookies_file: None,browser_cookies: None,});@@ -231,8 +260,15 @@ pub fn nami_load_app_settings() -> Result<AppSettings, String> {let content = fs::read_to_string(&settings_file).map_err(|e| format!("Failed to read settings: {}", e))?;- let settings: AppSettings =+ let mut settings: AppSettings =serde_json::from_str(&content).map_err(|e| format!("Failed to parse settings: {}", e))?;+ if settings+ .output_directory+ .as_ref()+ .map_or(true, |d| d.trim().is_empty())+ {+ settings.output_directory = default_out;+ }Ok(settings)}@@ -574,5 +610,16 @@ mod tests {normalize_profile_url("x", "OpenSelena"),"https://x.com/openselena");+ assert_eq!(+ normalize_profile_url(+ "facebook",+ "https://www.facebook.com/profile.php?id=1000123456789&mibextid=kFxxjd"+ ),+ "https://www.facebook.com/profile.php?id=1000123456789"+ );+ assert_eq!(+ normalize_profile_url("facebook", "zuck"),+ "https://www.facebook.com/zuck"+ );}}diff --git a/src-tauri/src/commands/tools/documents.rs b/src-tauri/src/commands/tools/documents.rsindex 5d680b02..52422e6e 100644--- a/src-tauri/src/commands/tools/documents.rs+++ b/src-tauri/src/commands/tools/documents.rs@@ -1,4 +1,4 @@-use libreget_core::core::tools::{calameo, gallery, gdocs, slides};+use libreget_core::core::tools::{calameo, gallery, gdocs, gslides, slides};use super::{err, progress};@@ -30,6 +30,22 @@ pub async fn tool_gdocs_download(.map_err(err)}+#[tauri::command]+pub async fn tool_gslides_compile_dir(+ app: tauri::AppHandle,+ svg_dir: String,+ output_pdf: Option<String>,+) -> Result<gslides::GslidesDownloadResult, String> {+ gslides::compile_svg_dir_to_pdf(&svg_dir, output_pdf.as_deref(), progress(&app))+ .await+ .map_err(err)+}++#[tauri::command]+pub fn tool_gslides_bridge_info() -> crate::local_bridge::SlidesBridgeStatus {+ crate::local_bridge::slides_bridge_status()+}+#[tauri::command]pub async fn tool_calameo(app: tauri::AppHandle,diff --git a/src-tauri/src/core/url_parser.rs b/src-tauri/src/core/url_parser.rsindex 88648462..1a307b14 100644--- a/src-tauri/src/core/url_parser.rs+++ b/src-tauri/src/core/url_parser.rs@@ -48,6 +48,13 @@ pub fn parse_url(url_str: &str) -> Option<ParsedUrl> {"douyin" => parse_douyin(&segments),"tencentvideo" => parse_tencent(&segments),"xiaohongshu" => parse_xiaohongshu(&segments),+ "gdocs" => {+ if let Some(info) = libreget_core::core::tools::gdocs::parse(url_str) {+ (Some(info.id), ParsedContentType::Post)+ } else {+ (None, ParsedContentType::Unknown)+ }+ }_ => (None, ParsedContentType::Unknown),},};diff --git a/src-tauri/src/extension_storage.rs b/src-tauri/src/extension_storage.rsindex 550b1828..80a1e66f 100644--- a/src-tauri/src/extension_storage.rs+++ b/src-tauri/src/extension_storage.rs@@ -115,7 +115,7 @@ fn format_cookie_line(c: &ExtensionCookie, session_ttl: u64) -> String {(format!(".{}", raw_domain), "TRUE")};let secure = if c.secure { "TRUE" } else { "FALSE" };- let expires = if c.expires == 0 {+ let expires = if c.expires <= 0 {session_ttl} else {c.expires as u64@@ -332,12 +332,15 @@ pub fn read_extension_metadata(url: &str) -> Option<ExtensionMetadata> {let path = extension_metadata_path();let now = current_unix_timestamp();let mut map = load_metadata_map(&path);+ let original_len = map.len();prune_expired_metadata(&mut map, now);- let entry = map.remove(url)?;- let result = parse_metadata_entry(&entry);+ let entry = map.get(url)?;+ let result = parse_metadata_entry(entry);- let _ = write_metadata_map(&path, &map);+ if map.len() != original_len {+ let _ = write_metadata_map(&path, &map);+ }Some(result)}diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rsindex c7a0a6aa..0e571795 100644--- a/src-tauri/src/lib.rs+++ b/src-tauri/src/lib.rs@@ -250,6 +250,7 @@ pub fn run() {torrent_session.clone(),)));registry.register(Arc::new(libreget_core::platforms::P2pDownloader::new()));+ registry.register(Arc::new(libreget_core::platforms::GdocsDownloader::new()));registry.register(Arc::new(libreget_core::platforms::DirectFileDownloader::new(),));@@ -963,6 +964,7 @@ pub fn run() {commands::downloads::reorder_queue,commands::downloads::retry_download,commands::downloads::remove_download,+ commands::downloads::failed_download_leftovers,commands::downloads::update_max_concurrent,commands::downloads::clear_finished_downloads,commands::downloads::get_download_log,@@ -1012,6 +1014,8 @@ pub fn run() {commands::tools::documents::tool_slideshare,commands::tools::documents::tool_gdocs_parse,commands::tools::documents::tool_gdocs_download,+ commands::tools::documents::tool_gslides_compile_dir,+ commands::tools::documents::tool_gslides_bridge_info,commands::tools::documents::tool_calameo,commands::tools::documents::tool_gallery_status,commands::tools::documents::tool_gallery_install,@@ -1294,6 +1298,8 @@ pub fn run() {commands::tools::linkedin::tool_li_checklist,commands::nami::nami_check_python_dependencies,commands::nami::http::nami_http_fetch,+ commands::nami::http::nami_cache_avatar,+ commands::nami::http::nami_resolve_facebook_avatar,commands::nami::nami_run_gallery_dl_download,commands::nami::nami_cancel_download,commands::nami::nami_save_app_settings,diff --git a/src-tauri/src/local_bridge.rs b/src-tauri/src/local_bridge.rsindex b5a2282a..2a0e6184 100644--- a/src-tauri/src/local_bridge.rs+++ b/src-tauri/src/local_bridge.rs@@ -517,6 +517,12 @@ pub async fn spawn(app: AppHandle) {.route("/v1/log/{id}", get(download_log)).route("/v1/cookies", post(cookies_export)).route("/mcp", post(mcp_post).get(mcp_get).delete(mcp_get))+ .route("/api/reset", post(slides_reset))+ .route(+ "/api/slide",+ post(slides_receive).layer(DefaultBodyLimit::max(32 * 1024 * 1024)),+ )+ .route("/api/compile", post(slides_compile)).with_state(state).layer(cors);@@ -598,13 +604,19 @@ struct PairResponse {fn is_allowed_pair_origin(origin: &str) -> bool {let o = origin.trim();- o.starts_with("chrome-extension://")+ if o.starts_with("chrome-extension://")|| o.starts_with("moz-extension://")|| o.starts_with("safari-web-extension://")|| o.starts_with("tauri://")- || o.starts_with("http://localhost")- || o.starts_with("http://127.0.0.1")- || o.starts_with("https://localhost")+ {+ return true;+ }+ if let Ok(parsed) = url::Url::parse(o) {+ if matches!(parsed.scheme(), "http" | "https") {+ return matches!(parsed.host_str(), Some("localhost" | "127.0.0.1"));+ }+ }+ false}async fn pair(State(state): State<BridgeState>, headers: HeaderMap) -> Response {@@ -912,6 +924,222 @@ async fn mcp_get() -> Response {StatusCode::METHOD_NOT_ALLOWED.into_response()}+// ── Receptor local de diapositivas Google Slides (/api/reset, /api/slide, /api/compile) ──++#[derive(Default)]+struct SlidesSession {+ title: Option<String>,+ slides: Vec<(usize, String)>,+ last_output: Option<String>,+}++static SLIDES_BUFFER: OnceLock<Mutex<SlidesSession>> = OnceLock::new();++fn slides_buffer() -> &'static Mutex<SlidesSession> {+ SLIDES_BUFFER.get_or_init(|| Mutex::new(SlidesSession::default()))+}++#[derive(Debug, Clone, Serialize)]+pub struct SlidesBridgeStatus {+ pub port: u16,+ pub slide_count: usize,+ pub last_output: Option<String>,+ pub script: String,+}++pub fn slides_bridge_status() -> SlidesBridgeStatus {+ let port = BOUND_PORT.load(Ordering::SeqCst);+ let effective_port = if port == 0 { 47720 } else { port };+ let token = active_token().unwrap_or_default();+ let (slide_count, last_output) = slides_buffer()+ .lock()+ .ok()+ .map(|s| (s.slides.len(), s.last_output.clone()))+ .unwrap_or((0, None));+ SlidesBridgeStatus {+ port: effective_port,+ slide_count,+ last_output,+ script: libreget_core::core::tools::gslides::browser_extractor_script(+ effective_port,+ &token,+ ),+ }+}++#[derive(Debug, Deserialize, Default)]+struct SlideResetBody {+ #[serde(default)]+ title: Option<String>,+}++#[derive(Debug, Deserialize)]+struct SlideReceiveBody {+ index: usize,+ svg_content: String,+ #[serde(default)]+ title: Option<String>,+}++async fn slides_reset(+ State(state): State<BridgeState>,+ headers: HeaderMap,+ body: Option<Json<SlideResetBody>>,+) -> Response {+ if !check_bearer(&headers, &state.token) {+ return unauthorized();+ }+ if let Ok(mut guard) = slides_buffer().lock() {+ guard.slides.clear();+ guard.title = body+ .and_then(|b| b.0.title)+ .filter(|t| !t.trim().is_empty());+ }+ let _ = state.app.emit(+ "gslides-bridge-progress",+ serde_json::json!({ "slide_count": 0 }),+ );+ (+ StatusCode::OK,+ Json(serde_json::json!({ "status": "reset_successful" })),+ )+ .into_response()+}++async fn slides_receive(+ State(state): State<BridgeState>,+ headers: HeaderMap,+ Json(data): Json<SlideReceiveBody>,+) -> Response {+ if !check_bearer(&headers, &state.token) {+ return unauthorized();+ }+ let count = if let Ok(mut guard) = slides_buffer().lock() {+ if let Some(t) = data.title.filter(|t| !t.trim().is_empty()) {+ guard.title = Some(t);+ }+ if let Some(existing) = guard.slides.iter_mut().find(|(idx, _)| *idx == data.index) {+ existing.1 = data.svg_content;+ } else {+ guard.slides.push((data.index, data.svg_content));+ }+ guard.slides.len()+ } else {+ 0+ };+ let _ = state.app.emit(+ "gslides-bridge-progress",+ serde_json::json!({ "slide_count": count, "index": data.index }),+ );+ (+ StatusCode::OK,+ Json(serde_json::json!({ "status": "ok", "slide_count": count })),+ )+ .into_response()+}++async fn slides_compile(+ State(state): State<BridgeState>,+ headers: HeaderMap,+ body: Option<Json<SlideResetBody>>,+) -> Response {+ if !check_bearer(&headers, &state.token) {+ return unauthorized();+ }+ let (mut indexed_svgs, title) = match slides_buffer().lock() {+ Ok(mut guard) => {+ if let Some(t) = body+ .and_then(|b| b.0.title)+ .filter(|t| !t.trim().is_empty())+ {+ guard.title = Some(t);+ }+ (+ guard.slides.clone(),+ guard+ .title+ .clone()+ .unwrap_or_else(|| "presentacion_compilada".to_string()),+ )+ }+ Err(_) => (Vec::new(), "presentacion_compilada".to_string()),+ };++ if indexed_svgs.is_empty() {+ return (+ StatusCode::BAD_REQUEST,+ Json(serde_json::json!({ "status": "error", "detail": "No hay diapositivas acumuladas." })),+ )+ .into_response();+ }++ indexed_svgs.sort_by_key(|(idx, _)| *idx);+ let svgs: Vec<String> = indexed_svgs.into_iter().map(|(_, s)| s).collect();+ let pages = svgs.len();++ let settings = config::load_settings(&state.app);+ let out_dir = if !settings.download.default_output_dir.as_os_str().is_empty() {+ settings.download.default_output_dir.clone()+ } else {+ dirs::download_dir().unwrap_or_else(|| PathBuf::from("."))+ };+ let _ = std::fs::create_dir_all(&out_dir);+ let safe_title = libreget_core::core::tools::sanitize_name(&title);+ let out_file = out_dir.join(format!("{}.pdf", safe_title));++ let compile_res = tokio::task::spawn_blocking(move || {+ libreget_core::core::tools::gslides::compile_svgs_to_pdf(+ &svgs,+ &libreget_core::core::tools::noop_progress(),+ "bridge-compile",+ )+ })+ .await;++ let pdf_bytes = match compile_res {+ Ok(Ok(b)) => b,+ Ok(Err(e)) => {+ return (+ StatusCode::INTERNAL_SERVER_ERROR,+ Json(serde_json::json!({ "status": "error", "detail": e.to_string() })),+ )+ .into_response();+ }+ Err(e) => {+ return (+ StatusCode::INTERNAL_SERVER_ERROR,+ Json(serde_json::json!({ "status": "error", "detail": e.to_string() })),+ )+ .into_response();+ }+ };++ if let Err(e) = tokio::fs::write(&out_file, &pdf_bytes).await {+ return (+ StatusCode::INTERNAL_SERVER_ERROR,+ Json(serde_json::json!({ "status": "error", "detail": e.to_string() })),+ )+ .into_response();+ }++ let file_str = out_file.to_string_lossy().to_string();+ if let Ok(mut guard) = slides_buffer().lock() {+ guard.last_output = Some(file_str.clone());+ guard.slides.clear();+ }++ let _ = state.app.emit(+ "gslides-bridge-complete",+ serde_json::json!({ "file": file_str, "pages": pages }),+ );++ (+ StatusCode::OK,+ Json(serde_json::json!({ "status": "success", "file": file_str, "pages": pages })),+ )+ .into_response()+}+#[cfg(test)]mod tests {use super::*;@@ -970,6 +1198,24 @@ mod tests {assert_eq!(build_pairing_url(47720), "http://127.0.0.1:47720");}+ #[test]+ fn allowed_pair_origin_rejects_spoofed_subdomains() {+ assert!(is_allowed_pair_origin(+ "chrome-extension://abcdefghijklmnop"+ ));+ assert!(is_allowed_pair_origin("moz-extension://1234-5678"));+ assert!(is_allowed_pair_origin("tauri://localhost"));+ assert!(is_allowed_pair_origin("http://localhost:1420"));+ assert!(is_allowed_pair_origin("https://localhost:47720"));+ assert!(is_allowed_pair_origin("http://127.0.0.1:47720"));+ assert!(!is_allowed_pair_origin("https://localhost.evil.com"));+ assert!(!is_allowed_pair_origin(+ "http://localhost.attacker.tld:8080"+ ));+ assert!(!is_allowed_pair_origin("http://127.0.0.1.evil.com"));+ assert!(!is_allowed_pair_origin("https://evil.com"));+ }+#[test]fn byte_ranges_parse_into_specs() {use ByteRange::*;diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rsindex 42306ff2..e1b785f0 100644--- a/src-tauri/src/main.rs+++ b/src-tauri/src/main.rs@@ -53,13 +53,6 @@ fn setup_environment() {#[cfg(target_os = "linux")]{- if std::env::var("WEBKIT_DISABLE_DMABUF_RENDERER").is_err() {- std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");- }- if std::env::var("WEBKIT_DISABLE_COMPOSITING_MODE").is_err() {- std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1");- }-let is_wayland = std::env::var("XDG_SESSION_TYPE").as_deref() == Ok("wayland")|| std::env::var_os("WAYLAND_DISPLAY").is_some();diff --git a/src-tauri/src/platforms/mod.rs b/src-tauri/src/platforms/mod.rsindex 7c29b113..2668b653 100644--- a/src-tauri/src/platforms/mod.rs+++ b/src-tauri/src/platforms/mod.rs@@ -3,6 +3,7 @@ pub use libreget_core::platforms::traits;pub use libreget_core::platforms::BlueskyDownloader;pub use libreget_core::platforms::DirectFileDownloader;pub use libreget_core::platforms::DouyinDownloader;+pub use libreget_core::platforms::GdocsDownloader;pub use libreget_core::platforms::GenericYtdlpDownloader;pub use libreget_core::platforms::InstagramDownloader;pub use libreget_core::platforms::P2pDownloader;diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.jsonindex 4137b494..64303c0a 100644--- a/src-tauri/tauri.conf.json+++ b/src-tauri/tauri.conf.json@@ -1,7 +1,7 @@{"$schema": "https://schema.tauri.app/config/2","productName": "LibreGet",- "version": "0.16.10",+ "version": "1.0.0","identifier": "com.openselena.libreget","build": {"beforeDevCommand": "pnpm dev",@@ -30,7 +30,10 @@"enable": true,"scope": {"allow": [- "$APPDATA/libreget/**",+ "$APPDATA/**",+ "$APPLOCALDATA/**",+ "$DATA/**",+ "$LOCALDATA/**","$DOWNLOAD/**","$TEMP/**"],diff --git a/src/components/download/GlobalDownloadBar.svelte b/src/components/download/GlobalDownloadBar.svelteindex bfb8fe2b..150b8a85 100644--- a/src/components/download/GlobalDownloadBar.svelte+++ b/src/components/download/GlobalDownloadBar.svelte@@ -25,6 +25,14 @@activeItems.length > 0 && page.url.pathname !== "/downloads",);+ const hasIndeterminate = $derived(+ activeItems.some(+ (item) =>+ item.status === "downloading" &&+ (item.percent <= 0 || item.queueKind === "image"),+ ),+ );+const avgPercent = $derived.by(() => {if (activeItems.length === 0) return 0;let sum = 0;@@ -106,7 +114,11 @@{#if visible}<div class="global-download-dock" role="status" aria-live="polite"><div class="dock-progress-track" aria-hidden="true">- <div class="dock-progress-fill" style="width: {avgPercent.toFixed(1)}%"></div>+ <div+ class="dock-progress-fill"+ class:indeterminate={hasIndeterminate && avgPercent <= 0}+ style="width: {hasIndeterminate && avgPercent <= 0 ? '30%' : avgPercent.toFixed(1) + '%'}"+ ></div></div><div class="dock-left">@@ -122,7 +134,11 @@<div class="dock-right"><span class="dock-metrics">- <strong>{Math.round(avgPercent)}%</strong>+ {#if hasIndeterminate && avgPercent <= 0}+ <strong>…</strong>+ {:else}+ <strong>{Math.round(avgPercent)}%</strong>+ {/if}<span class="dock-sep">·</span><span>{bytesSummary}</span><span class="dock-speed">{formatSpeed(totalSpeed)}</span>@@ -187,6 +203,23 @@transition: width var(--duration-base) var(--ease-out);}+ .dock-progress-fill.indeterminate {+ width: 30% !important;+ animation: dock-indeterminate 1.4s ease-in-out infinite;+ }++ @keyframes dock-indeterminate {+ 0% { transform: translateX(-100%); }+ 100% { transform: translateX(340%); }+ }++ @media (prefers-reduced-motion: reduce) {+ .dock-progress-fill.indeterminate {+ animation: none;+ width: 15% !important;+ }+ }+.dock-left {display: flex;align-items: center;diff --git a/src/components/downloads/FailedLeftoversDialog.svelte b/src/components/downloads/FailedLeftoversDialog.sveltenew file mode 100644index 00000000..0aec8062--- /dev/null+++ b/src/components/downloads/FailedLeftoversDialog.svelte@@ -0,0 +1,170 @@+<script lang="ts">+ import { t } from "$lib/i18n";+ import { formatBytes } from "$lib/download-format";+ import DialogContainer from "$components/dialog/DialogContainer.svelte";++ export type LeftoverFile = { path: string; name: string; size_bytes: number };++ let {+ open = $bindable(false),+ files = [],+ onRemove,+ }: {+ open?: boolean;+ files: LeftoverFile[];+ onRemove?: (deletePartials: boolean) => void;+ } = $props();++ let total = $derived(files.reduce((sum, f) => sum + f.size_bytes, 0));++ function finish(deletePartials: boolean) {+ open = false;+ onRemove?.(deletePartials);+ }++ function cancel() {+ open = false;+ }+</script>++<DialogContainer bind:isOpen={open} titleId="leftovers-dialog-title" onClose={cancel}>+ <div class="leftovers-content">+ <h3 id="leftovers-dialog-title" class="leftovers-title">+ {$t("downloads.leftovers_title")}+ </h3>+ <p class="leftovers-desc">+ {$t("downloads.leftovers_body", { count: files.length, size: formatBytes(total) })}+ </p>++ <ul class="leftovers-list" role="list">+ {#each files as file (file.path)}+ <li class="leftovers-item" title={file.path}>+ <span class="file-name" dir="ltr">{file.name}</span>+ <span class="file-size">{formatBytes(file.size_bytes)}</span>+ </li>+ {/each}+ </ul>++ <div class="leftovers-actions">+ <button type="button" class="btn btn-secondary" onclick={cancel}>+ {$t("common.cancel")}+ </button>+ <button type="button" class="btn btn-secondary" onclick={() => finish(false)}>+ {$t("downloads.leftovers_keep")}+ </button>+ <button type="button" class="btn btn-destructive" onclick={() => finish(true)}>+ {$t("downloads.leftovers_delete")}+ </button>+ </div>+ </div>+</DialogContainer>++<style>+ .leftovers-content {+ display: flex;+ flex-direction: column;+ padding: var(--space-4, 16px);+ gap: var(--space-3, 12px);+ }++ .leftovers-title {+ margin: 0;+ font-size: 15px;+ font-weight: 600;+ color: var(--text, #fff);+ }++ .leftovers-desc {+ margin: 0;+ font-size: 13px;+ line-height: 1.5;+ color: var(--text-dim, rgba(255, 255, 255, 0.7));+ }++ .leftovers-list {+ list-style: none;+ margin: 0;+ padding: var(--space-2, 8px);+ max-height: 180px;+ overflow-y: auto;+ display: flex;+ flex-direction: column;+ gap: var(--space-1, 4px);+ font-size: 12px;+ background: var(--surface, rgba(255, 255, 255, 0.04));+ border: 1px solid var(--border, rgba(255, 255, 255, 0.1));+ border-radius: var(--radius-md, 8px);+ }++ .leftovers-item {+ display: flex;+ justify-content: space-between;+ align-items: center;+ gap: var(--space-3, 12px);+ padding: 4px 6px;+ border-radius: 4px;+ }++ .leftovers-item:hover {+ background: var(--fill-2, rgba(255, 255, 255, 0.06));+ }++ .file-name {+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ color: var(--text, #fff);+ }++ .file-size {+ flex-shrink: 0;+ font-variant-numeric: tabular-nums;+ color: var(--text-dim, rgba(255, 255, 255, 0.6));+ }++ .leftovers-actions {+ display: flex;+ flex-wrap: wrap;+ justify-content: flex-end;+ gap: var(--space-2, 8px);+ margin-top: var(--space-2, 8px);+ }++ .btn {+ min-height: 32px;+ padding: 0 var(--space-3, 12px);+ border: none;+ border-radius: var(--radius-md, 8px);+ font: inherit;+ font-size: 13px;+ font-weight: 500;+ cursor: pointer;+ transition: background var(--duration-fast, 120ms) ease;+ }++ .btn:focus-visible {+ outline: var(--focus-ring, 2px solid var(--accent));+ outline-offset: var(--focus-ring-offset, 2px);+ }++ .btn-secondary {+ background: var(--surface, rgba(255, 255, 255, 0.06));+ box-shadow: inset 0 0 0 var(--hairline, 1px) var(--border, rgba(255, 255, 255, 0.12));+ color: var(--text, #fff);+ }++ .btn-secondary:hover {+ background: var(--fill-2, rgba(255, 255, 255, 0.12));+ }++ .btn-destructive {+ background: var(--danger, #e53935);+ color: #fff;+ font-weight: 600;+ }++ .btn-destructive:hover {+ filter: brightness(1.1);+ }+</style>diff --git a/src/components/home/HomeMoreMenu.svelte b/src/components/home/HomeMoreMenu.sveltenew file mode 100644index 00000000..c68df320--- /dev/null+++ b/src/components/home/HomeMoreMenu.svelte@@ -0,0 +1,239 @@+<script lang="ts">+ import { tick } from "svelte";+ import { t } from "$lib/i18n";+ import type { MoreAction } from "$lib/home/librebox-controller";++ let { onPick }: { onPick: (action: MoreAction) => void } = $props();++ const items: { action: MoreAction; key: string; icon: string }[] = [+ { action: "batch", key: "home.action_batch", icon: "M4 6h16M4 12h16M4 18h10" },+ { action: "torrent", key: "home.action_torrent", icon: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8zM14 3v5h5" },+ { action: "advanced", key: "home.action_advanced", icon: "m4 17 6-6-6-6M12 19h8" },+ { action: "p2p", key: "home.action_p2p", icon: "M22 2 11 13M22 2l-7 20-4-9-9-4z" },+ ];++ let open = $state(false);+ let trigger = $state<HTMLButtonElement | null>(null);+ let menu = $state<HTMLDivElement | null>(null);+ const menuId = "home-more-menu";++ async function show(focusIndex = 0) {+ open = true;+ await tick();+ menuItems()[focusIndex]?.focus();+ }++ function hide(returnFocus = true) {+ open = false;+ if (returnFocus) trigger?.focus();+ }++ function menuItems(): HTMLButtonElement[] {+ return menu ? [...menu.querySelectorAll<HTMLButtonElement>("[role=menuitem]")] : [];+ }++ function onTriggerKey(e: KeyboardEvent) {+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {+ e.preventDefault();+ void show(e.key === "ArrowUp" ? items.length - 1 : 0);+ }+ }++ function onMenuKey(e: KeyboardEvent) {+ const list = menuItems();+ const i = list.indexOf(document.activeElement as HTMLButtonElement);+ if (e.key === "ArrowDown") {+ e.preventDefault();+ list[(i + 1) % list.length]?.focus();+ } else if (e.key === "ArrowUp") {+ e.preventDefault();+ list[(i - 1 + list.length) % list.length]?.focus();+ } else if (e.key === "Home") {+ e.preventDefault();+ list[0]?.focus();+ } else if (e.key === "End") {+ e.preventDefault();+ list[list.length - 1]?.focus();+ } else if (e.key === "Escape") {+ e.preventDefault();+ hide();+ } else if (e.key === "Tab") {+ hide(false);+ }+ }++ function pick(action: MoreAction) {+ hide(false);+ onPick(action);+ }++ $effect(() => {+ if (!open) return;+ const onDown = (e: PointerEvent) => {+ const target = e.target as Node;+ if (!menu?.contains(target) && !trigger?.contains(target)) hide(false);+ };+ window.addEventListener("pointerdown", onDown, true);+ return () => window.removeEventListener("pointerdown", onDown, true);+ });+</script>++<div class="more">+ <button+ bind:this={trigger}+ type="button"+ class="more-trigger"+ class:open+ aria-label={$t("home.more")}+ title={$t("home.more")}+ aria-haspopup="menu"+ aria-expanded={open}+ aria-controls={open ? menuId : undefined}+ data-home-more+ onclick={() => (open ? hide() : show())}+ onkeydown={onTriggerKey}+ >+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true">+ <path d="M12 5v14M5 12h14" />+ </svg>+ </button>++ {#if open}+ <div+ bind:this={menu}+ id={menuId}+ class="more-menu"+ role="menu"+ aria-label={$t("home.more")}+ tabindex="-1"+ onkeydown={onMenuKey}+ >+ {#each items as item (item.action)}+ {#if item.action === "p2p"}+ <div class="more-divider" role="separator"></div>+ {/if}+ <button+ type="button"+ role="menuitem"+ class="more-item"+ tabindex="-1"+ onclick={() => pick(item.action)}+ >+ <svg viewBox="0 0 24 24" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <path d={item.icon} />+ </svg>+ <span>{$t(item.key)}</span>+ </button>+ {/each}+ </div>+ {/if}+</div>++<style>+ .more {+ position: relative;+ flex-shrink: 0;+ }++ .more-trigger {+ display: grid;+ place-items: center;+ width: 36px;+ height: 36px;+ border: none;+ border-radius: 50%;+ background: var(--fill-1);+ color: var(--text-muted);+ cursor: pointer;+ transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), transform var(--duration-base) var(--ease-out);+ }++ @media (hover: hover) {+ .more-trigger:hover {+ background: var(--fill-2);+ color: var(--text);+ }+ }++ .more-trigger.open {+ background: var(--fill-2);+ color: var(--text);+ }++ .more-trigger.open svg {+ transform: rotate(45deg);+ }++ .more-trigger svg {+ transition: transform var(--duration-base) var(--ease-out);+ }++ .more-trigger:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+ }++ .more-menu {+ position: absolute;+ top: calc(100% + 10px);+ left: -8px;+ z-index: 30;+ min-width: 232px;+ display: flex;+ flex-direction: column;+ padding: 5px;+ background: var(--popup-bg, var(--surface));+ border-radius: 14px;+ box-shadow: var(--elev-2);+ transform-origin: 26px 0;+ animation: menu-in 160ms var(--ease-out);+ }++ .more-item {+ display: flex;+ align-items: center;+ gap: 10px;+ min-height: 34px;+ padding: 0 10px;+ border: none;+ border-radius: 9px;+ background: transparent;+ color: var(--text);+ font: inherit;+ font-size: var(--text-sm);+ text-align: left;+ cursor: pointer;+ }++ .more-divider {+ height: var(--hairline);+ margin: 5px 10px;+ background: var(--separator);+ }++ .more-item svg {+ color: var(--text-dim);+ flex-shrink: 0;+ }++ .more-item:hover,+ .more-item:focus-visible {+ background: var(--accent-soft);+ outline: none;+ }++ .more-item:hover svg,+ .more-item:focus-visible svg {+ color: var(--accent-hi);+ }++ @keyframes menu-in {+ from { opacity: 0; transform: scale(0.94) translateY(-4px); }+ to { opacity: 1; transform: scale(1) translateY(0); }+ }++ @media (prefers-reduced-motion: reduce) {+ .more-menu { animation: none; }+ .more-trigger, .more-trigger svg { transition: none; }+ }+</style>diff --git a/src/components/home/HomeUrlBar.svelte b/src/components/home/HomeUrlBar.svelteindex 43500105..2c223c3e 100644--- a/src/components/home/HomeUrlBar.svelte+++ b/src/components/home/HomeUrlBar.svelte@@ -1,54 +1,355 @@<script lang="ts">- import LibreboxInput from "$components/librebox/LibreboxInput.svelte";- import type { HomeInputMode } from "$lib/home/librebox-controller";+ import { readText } from "@tauri-apps/plugin-clipboard-manager";+ import HomeMoreMenu from "$components/home/HomeMoreMenu.svelte";+ import type { MoreAction, HomeInputMode } from "$lib/home/librebox-controller";+ import { isUrl } from "$lib/home/librebox-controller";+ import { shortcut } from "$lib/platform";+ import { showToast } from "$lib/stores/toast-store.svelte";+ import { t } from "$lib/i18n";let {url = $bindable(""),mode = $bindable<HomeInputMode>("url"),- variant = "bar",- advanced = false,+ busy = false,+ busyLabel = "",+ showSubmit = true,+ inputEl = $bindable(null),onInput,+ onSubmit,+ onMore,onModeChange,onAdvanced,}: {url?: string;mode?: HomeInputMode;- variant?: "bar" | "stage";- advanced?: boolean;- onInput: () => void;+ busy?: boolean;+ busyLabel?: string;+ showSubmit?: boolean;+ inputEl?: HTMLInputElement | null;+ onInput?: () => void;+ onSubmit?: () => void;+ onMore?: (action: MoreAction) => void;onModeChange?: (mode: HomeInputMode) => void;onAdvanced?: () => void;} = $props();- function pick(next: HomeInputMode) {- mode = next;- onModeChange?.(next);+ let hasText = $derived(url.trim().length > 0);++ async function pasteFromClipboard() {+ let text = "";+ try {+ text = (await readText()) ?? "";+ } catch {+ try {+ text = await navigator.clipboard.readText();+ } catch {}+ }+ const trimmed = text.trim();+ if (!trimmed || !trimmed.split(/\s+/).some(isUrl)) {+ showToast("info", $t("home.paste_empty") as string);+ inputEl?.focus();+ return;+ }+ url = trimmed;+ onInput?.();+ inputEl?.focus();+ }++ function onKey(e: KeyboardEvent) {+ if (e.key === "Enter" && hasText) {+ e.preventDefault();+ onSubmit?.();+ } else if (e.key === "Escape" && hasText) {+ url = "";+ onInput?.();+ }+ }++ function handleMore(action: MoreAction) {+ if (onMore) {+ onMore(action);+ } else if (action === "advanced") {+ onAdvanced?.();+ } else {+ mode = action;+ onModeChange?.(action);+ }}</script>-<div class="home-url-bar" class:stage={variant === "stage"}>- {#if mode === "url"}- <LibreboxInput- bind:url- onInput={onInput}- prominent={variant === "stage"}- {advanced}- onModeSelect={pick}- {onAdvanced}- />+<div class="url-bar" class:busy class:filled={hasText}>+ <HomeMoreMenu onPick={handleMore} />+ <input+ bind:this={inputEl}+ class="url-input"+ type="text"+ placeholder={$t("librebox.placeholder")}+ aria-label={$t("librebox.placeholder")}+ aria-busy={busy}+ bind:value={url}+ oninput={onInput}+ onkeydown={onKey}+ autocomplete="off"+ autocorrect="off"+ autocapitalize="off"+ spellcheck="false"+ enterkeyhint="go"+ />+ {#if hasText}+ <button+ type="button"+ class="clear"+ onclick={() => {+ url = "";+ onInput?.();+ inputEl?.focus();+ }}+ aria-label={$t("common.clear")}+ >+ <svg viewBox="0 0 16 16" width="14" height="14" fill="currentColor" aria-hidden="true">+ <path d="M8 1.4a6.6 6.6 0 1 0 0 13.2A6.6 6.6 0 0 0 8 1.4zm2.35 3.5a.75.75 0 0 1 1.06 1.06L9.06 8l2.35 2.35a.75.75 0 1 1-1.06 1.06L8 9.06 5.65 11.4a.75.75 0 1 1-1.06-1.06L6.94 8 4.6 5.65A.75.75 0 0 1 5.65 4.6L8 6.94l2.35-2.04z" />+ </svg>+ </button>+ {#if showSubmit}+ <button+ type="button"+ class="go"+ onclick={onSubmit}+ aria-label={$t("home.submit")}+ title={$t("home.submit")}+ >+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <path class="go-arrow" d="M12 5v14M6 13l6 6 6-6" />+ </svg>+ </button>+ {/if}+ {:else}+ <button type="button" class="paste" onclick={pasteFromClipboard}>+ <span>{$t("home.paste")}</span>+ <kbd>{shortcut("V")}</kbd>+ </button>+ {/if}+ {#if busy}+ <span class="beam" aria-hidden="true"></span>{/if}</div>+{#if busy && busyLabel}+ <p class="busy-label" role="status">{busyLabel}</p>+{/if}<style>- .home-url-bar {+ .url-bar {+ position: relative;display: flex;- flex-direction: column;- gap: var(--space-2);+ align-items: center;+ gap: 8px;width: 100%;+ height: 58px;+ padding: 0 10px 0 11px;+ border-radius: 20px;+ background: var(--surface);+ box-shadow:+ inset 0 0 0 var(--hairline) var(--border-hi),+ 0 12px 32px rgba(var(--shadow-ink), var(--elev-alpha-1)),+ 0 2px 6px rgba(var(--shadow-ink), calc(var(--elev-alpha-1) * 0.6));+ transition: box-shadow var(--duration-base) var(--ease-out);+ }++ .url-bar:focus-within {+ box-shadow:+ inset 0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent),+ 0 0 0 5px var(--accent-soft),+ 0 12px 32px rgba(var(--shadow-ink), var(--elev-alpha-1));+ }++ .url-input {+ flex: 1;+ min-width: 0;+ height: 100%;+ border: none;+ background: transparent;+ color: var(--text);+ font: inherit;+ font-size: 17px;+ letter-spacing: -0.01em;+ outline: none;+ }++ .url-input:focus-visible {+ outline: none;+ }++ .url-input::placeholder {+ color: var(--text-dim);+ }++ .clear {+ display: grid;+ place-items: center;+ width: 28px;+ height: 28px;+ border: none;+ border-radius: 50%;+ background: transparent;+ color: var(--text-faint);+ cursor: pointer;+ }++ .clear:hover {+ color: var(--text-muted);+ }++ .go {+ display: grid;+ place-items: center;+ width: 40px;+ height: 40px;+ flex-shrink: 0;+ border: none;+ border-radius: 50%;+ background: var(--cta);+ color: var(--on-cta);+ cursor: pointer;+ box-shadow: 0 4px 14px var(--accent-glow);+ animation: pop-in 180ms var(--ease-out);+ transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);+ }++ .go:hover {+ background: var(--cta-hover);+ }++ .go:active {+ background: var(--cta-press);+ transform: scale(0.95);}- .home-url-bar.stage {+ .go-arrow {+ stroke-dasharray: 40;+ stroke-dashoffset: 40;+ animation: draw 260ms 60ms var(--ease-out) forwards;+ }++ .paste {+ display: inline-flex;align-items: center;- max-width: 560px;+ gap: 8px;+ height: 36px;+ padding: 0 8px 0 14px;+ flex-shrink: 0;+ border: none;+ border-radius: 999px;+ background: var(--fill-1);+ color: var(--text);+ font: inherit;+ font-size: var(--text-sm);+ font-weight: 600;+ cursor: pointer;+ transition: background var(--duration-fast) var(--ease-out);+ }++ .paste:hover {+ background: var(--fill-2);+ }++ .paste kbd {+ font: inherit;+ font-size: 11px;+ font-weight: 600;+ padding: 2px 6px;+ border-radius: 6px;+ background: var(--surface);+ color: var(--text-dim);+ box-shadow: inset 0 0 0 var(--hairline) var(--border);+ }++ .go:focus-visible,+ .paste:focus-visible,+ .clear:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+ }++ .beam {+ position: absolute;+ inset: 0;+ border-radius: inherit;+ padding: 1.5px;+ pointer-events: none;+ background: conic-gradient(from var(--beam-angle, 0deg), transparent 0 70%, var(--accent) 85%, transparent 100%);+ -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);+ mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);+ -webkit-mask-composite: xor;+ mask-composite: exclude;+ animation: beam 1.4s linear infinite;+ }++ @property --beam-angle {+ syntax: "<angle>";+ initial-value: 0deg;+ inherits: false;+ }++ .busy-label {+ margin: 10px 0 0;+ text-align: center;+ font-size: var(--text-sm);+ font-weight: 500;+ color: transparent;+ background: linear-gradient(90deg, var(--text-dim) 0%, var(--text-dim) 40%, var(--text) 50%, var(--text-dim) 60%, var(--text-dim) 100%);+ background-size: 250% 100%;+ -webkit-background-clip: text;+ background-clip: text;+ animation: shimmer 1.6s linear infinite;+ }++ @keyframes beam {+ to {+ --beam-angle: 360deg;+ }+ }++ @keyframes shimmer {+ from {+ background-position: 100% 0;+ }+ to {+ background-position: -150% 0;+ }+ }++ @keyframes draw {+ to {+ stroke-dashoffset: 0;+ }+ }++ @keyframes pop-in {+ from {+ transform: scale(0.6);+ opacity: 0;+ }+ to {+ transform: scale(1);+ opacity: 1;+ }+ }++ @media (prefers-reduced-motion: reduce) {+ .beam {+ animation: none;+ background: none;+ box-shadow: inset 0 0 0 1.5px var(--accent);+ }+ .busy-label {+ animation: none;+ color: var(--text-dim);+ background: none;+ }+ .go,+ .go-arrow {+ animation: none;+ stroke-dashoffset: 0;+ }}</style>diff --git a/src/components/home/VideoOrListChoice.svelte b/src/components/home/VideoOrListChoice.sveltenew file mode 100644index 00000000..90232703--- /dev/null+++ b/src/components/home/VideoOrListChoice.svelte@@ -0,0 +1,97 @@+<script lang="ts">+ import { t } from "$lib/i18n";++ let {+ choice = $bindable("video"),+ isMix = false,+ onChoose,+ }: {+ choice?: "video" | "list";+ isMix?: boolean;+ onChoose?: (next: "video" | "list") => void;+ } = $props();++ function select(next: "video" | "list") {+ choice = next;+ onChoose?.(next);+ }+</script>++<fieldset class="video-or-list">+ <legend>{$t(isMix ? "librebox.video_or_list_mix" : "librebox.video_or_list")}</legend>+ <div class="options">+ <button+ type="button"+ aria-pressed={choice === "video"}+ class:active={choice === "video"}+ onclick={() => select("video")}+ >+ {$t("librebox.video_or_list_video")}+ </button>+ <button+ type="button"+ aria-pressed={choice === "list"}+ class:active={choice === "list"}+ onclick={() => select("list")}+ >+ {$t(isMix ? "librebox.video_or_list_mix_list" : "librebox.video_or_list_list")}+ </button>+ </div>+</fieldset>++<style>+ .video-or-list {+ border: none;+ margin: 0;+ padding: 0;+ display: flex;+ flex-direction: column;+ gap: var(--space-2, 8px);+ }++ legend {+ padding: 0;+ margin-block-end: var(--space-2, 8px);+ font-size: 13px;+ font-weight: 500;+ color: var(--text);+ }++ .options {+ display: flex;+ flex-wrap: wrap;+ gap: var(--space-2, 8px);+ }++ button {+ flex: 1 1 140px;+ min-height: 34px;+ padding: 0 var(--space-3, 12px);+ border: none;+ border-radius: var(--radius-md, 8px);+ background: var(--surface, rgba(255, 255, 255, 0.04));+ box-shadow: inset 0 0 0 var(--hairline, 1px) var(--border, rgba(255, 255, 255, 0.1));+ color: var(--text);+ font: inherit;+ font-size: 13px;+ font-weight: 500;+ cursor: pointer;+ transition: background var(--duration-fast, 120ms) ease, color var(--duration-fast, 120ms) ease;+ }++ button:hover {+ background: var(--fill-2, rgba(255, 255, 255, 0.08));+ }++ button.active {+ background: var(--accent);+ box-shadow: none;+ color: var(--on-accent, #fff);+ font-weight: 600;+ }++ button:focus-visible {+ outline: var(--focus-ring, 2px solid var(--accent));+ outline-offset: var(--focus-ring-offset, 2px);+ }+</style>diff --git a/src/components/icons/PlatformIcon.svelte b/src/components/icons/PlatformIcon.svelteindex 4b43d958..e9278118 100644--- a/src/components/icons/PlatformIcon.svelte+++ b/src/components/icons/PlatformIcon.svelte@@ -95,6 +95,12 @@<path d="M2 8h3l3 8 3-8h3" /><path d="M18 8v4c0 3-1 4-2 5l3 3" /></svg>+{:else if platform === "gdocs"}+ <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />+ <path d="M14 2v6h6" />+ <rect x="8" y="12" width="8" height="6" rx="1" />+ </svg>{:else if platform === "generic"}<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 15l6 -6" />diff --git a/src/components/librebox/OutputLocationPicker.svelte b/src/components/librebox/OutputLocationPicker.sveltenew file mode 100644index 00000000..ed903f9b--- /dev/null+++ b/src/components/librebox/OutputLocationPicker.svelte@@ -0,0 +1,296 @@+<script lang="ts">+ import { open } from "@tauri-apps/plugin-dialog";+ import { t } from "$lib/i18n";+ import { getSettings, updateSettings } from "$lib/stores/settings-store.svelte";++ let {+ selectedOutputDir = $bindable<string>(""),+ } = $props();++ let settings = $derived(getSettings());+ let savedDirs = $derived(settings?.download.saved_output_dirs ?? []);+ let defaultDir = $derived(settings?.download.default_output_dir ?? "");++ let isDropdownOpen = $state(false);+ let mutating = $state(false);+ let pendingWrites = 0;+ let writeChain: Promise<void> = Promise.resolve();++ function enqueueSavedDirsUpdate(mutator: (dirs: string[]) => string[]) {+ pendingWrites += 1;+ mutating = true;+ const run = writeChain+ .then(async () => {+ const current = getSettings()?.download.saved_output_dirs ?? [];+ const next = mutator(current);+ if (next.length === current.length && next.every((dir, i) => dir === current[i])) {+ return;+ }+ await updateSettings({ download: { saved_output_dirs: next } });+ })+ .finally(() => {+ pendingWrites -= 1;+ if (pendingWrites === 0) mutating = false;+ });+ writeChain = run.catch(() => {});+ return run;+ }++ async function handleBrowse() {+ isDropdownOpen = false;+ const picked = await open({+ directory: true,+ title: $t("settings.download.choose_folder"),+ });+ if (!picked || typeof picked !== "string") return;++ selectedOutputDir = picked;++ if (picked === defaultDir) return;+ await enqueueSavedDirsUpdate((dirs) =>+ dirs.includes(picked) ? dirs : [...dirs, picked],+ );+ }++ function pickDir(path: string) {+ selectedOutputDir = path;+ isDropdownOpen = false;+ }++ async function removeDir(e: MouseEvent, path: string) {+ e.stopPropagation();+ if (selectedOutputDir === path) {+ selectedOutputDir = defaultDir;+ }+ await enqueueSavedDirsUpdate((dirs) => dirs.filter((d) => d !== path));+ }+</script>++<div class="location-picker">+ <button+ type="button"+ class="location-picker-trigger"+ onclick={() => { isDropdownOpen = !isDropdownOpen; }}+ aria-haspopup="listbox"+ aria-expanded={isDropdownOpen}+ >+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>+ </svg>+ <span class="location-picker-label">{$t('settings.download.section_output')}:</span>+ <span class="location-picker-value" title={selectedOutputDir || defaultDir}>{selectedOutputDir || defaultDir}</span>+ <svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <polyline points="6 9 12 15 18 9" />+ </svg>+ </button>++ {#if isDropdownOpen}+ <ul class="location-picker-menu" role="listbox">+ <li class="location-picker-item-wrapper">+ <button+ type="button"+ class="location-picker-option"+ class:active={selectedOutputDir === defaultDir || !selectedOutputDir}+ role="option"+ aria-selected={selectedOutputDir === defaultDir || !selectedOutputDir}+ onclick={() => pickDir(defaultDir)}+ >+ <span class="location-picker-option-alias">{$t('settings.download.default_output_dir')}</span>+ <span class="location-picker-option-meta" title={defaultDir}>{defaultDir}</span>+ </button>+ </li>++ {#each savedDirs as dir}+ <li class="location-picker-item-wrapper">+ <button+ type="button"+ class="location-picker-option"+ class:active={selectedOutputDir === dir}+ role="option"+ aria-selected={selectedOutputDir === dir}+ onclick={() => pickDir(dir)}+ >+ <span class="location-picker-option-meta" title={dir}>{dir}</span>+ </button>+ <button+ type="button"+ class="location-picker-remove"+ onclick={(e) => removeDir(e, dir)}+ disabled={mutating}+ aria-label={$t("settings.download.remove_saved_dir")}+ title={$t("settings.download.remove_saved_dir")}+ >+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <line x1="18" y1="6" x2="6" y2="18"></line>+ <line x1="6" y1="6" x2="18" y2="18"></line>+ </svg>+ </button>+ </li>+ {/each}++ <li class="location-picker-item-wrapper">+ <button+ type="button"+ class="location-picker-option browse-btn"+ role="option"+ aria-selected="false"+ disabled={mutating}+ onclick={handleBrowse}+ >+ <span class="location-picker-option-alias">{$t('settings.download.choose_folder')}...</span>+ </button>+ </li>+ </ul>+ {/if}+</div>++<style>+ .location-picker {+ position: relative;+ display: inline-flex;+ width: 100%;+ max-width: 100%;+ }++ .location-picker-trigger {+ display: inline-flex;+ align-items: center;+ gap: 8px;+ padding: 6px 12px;+ font-size: var(--text-sm, 13px);+ font-weight: 500;+ color: var(--text-dim, rgba(255, 255, 255, 0.7));+ background: var(--surface, rgba(255, 255, 255, 0.04));+ border: none;+ border-radius: var(--radius-md, 8px);+ box-shadow: inset 0 0 0 var(--hairline, 1px) var(--border, rgba(255, 255, 255, 0.1));+ cursor: pointer;+ width: 100%;+ text-align: left;+ overflow: hidden;+ transition: background var(--duration-fast, 120ms) ease;+ }++ .location-picker-trigger:focus-visible {+ outline: var(--focus-ring, 2px solid var(--accent));+ outline-offset: var(--focus-ring-offset, 2px);+ }++ .location-picker-trigger:hover {+ background: var(--fill-2, rgba(255, 255, 255, 0.08));+ color: var(--text, #fff);+ }++ .location-picker-label {+ white-space: nowrap;+ }++ .location-picker-value {+ color: var(--text, #fff);+ font-weight: 600;+ flex-grow: 1;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ direction: rtl;+ text-align: left;+ }++ .location-picker-menu {+ position: absolute;+ top: calc(100% + 4px);+ left: 0;+ right: 0;+ z-index: 30;+ margin: 0;+ padding: 6px;+ list-style: none;+ background: var(--surface-elevated, var(--surface, #1e1e24));+ border: 1px solid var(--border, rgba(255, 255, 255, 0.12));+ border-radius: var(--radius-md, 8px);+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);+ max-height: 250px;+ overflow-y: auto;+ }++ .location-picker-item-wrapper {+ display: flex;+ align-items: stretch;+ width: 100%;+ }++ .location-picker-option {+ display: flex;+ flex-direction: column;+ align-items: flex-start;+ justify-content: center;+ gap: 2px;+ flex-grow: 1;+ padding: 8px 10px;+ font-size: var(--text-sm, 13px);+ color: var(--text, #fff);+ background: transparent;+ border: none;+ border-radius: calc(var(--radius-md, 8px) - 2px);+ text-align: left;+ cursor: pointer;+ overflow: hidden;+ transition: background var(--duration-fast, 120ms) ease;+ }++ .location-picker-remove {+ background: transparent;+ border: none;+ color: var(--text-dim, rgba(255, 255, 255, 0.5));+ cursor: pointer;+ padding: 0 10px;+ display: flex;+ align-items: center;+ justify-content: center;+ border-radius: calc(var(--radius-md, 8px) - 2px);+ transition: color var(--duration-fast, 120ms) ease;+ }++ .location-picker-remove:disabled {+ opacity: 0.4;+ cursor: not-allowed;+ }++ .location-picker-remove:hover {+ color: var(--danger, #ff4d4f);+ }++ .location-picker-option:hover {+ background: var(--fill-2, rgba(255, 255, 255, 0.08));+ }++ .location-picker-option.active {+ background: var(--fill-1, rgba(255, 255, 255, 0.12));+ }++ .location-picker-option-alias {+ color: var(--text, #fff);+ font-weight: 500;+ }++ .location-picker-option-meta {+ color: var(--text-dim, rgba(255, 255, 255, 0.6));+ font-size: 11px;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ width: 100%;+ direction: rtl;+ text-align: left;+ }++ .browse-btn {+ align-items: center;+ flex-direction: row;+ color: var(--accent, #3b82f6);+ }++ .browse-btn .location-picker-option-alias {+ color: var(--accent, #3b82f6);+ }+</style>diff --git a/src/components/nami/DownloadManager.svelte b/src/components/nami/DownloadManager.svelteindex 21dd5861..4b328d68 100644--- a/src/components/nami/DownloadManager.svelte+++ b/src/components/nami/DownloadManager.svelte@@ -1,5 +1,11 @@<script lang="ts">- import { loadProfiles, type Profile } from '$lib/api/nami';+ import {+ loadProfiles,+ saveProfile,+ deleteProfile,+ httpFetch,+ type Profile,+ } from '$lib/api/nami';import {isActive,isCancelling,@@ -20,6 +26,7 @@import {getOutputDir,getCookiesFile,+ getBrowserCookies,loadSettings,} from '$lib/stores/nami_settings_store.svelte';import {@@ -27,8 +34,12 @@getDependencyStatus,isCheckingDependencies,} from '$lib/stores/nami_deps_store.svelte';+ import { showToast } from '$lib/stores/toast-store.svelte';+ import { parseProfileUrl, type ParsedProfile } from '$lib/utils/nami_parser';import { namiStageLabel, namiStatusMessage, type NamiTranslate } from '$lib/nami/i18n';+ import { resolveCreatorMetadata, getCachedCreator } from '$lib/nami/metadata';import { onMount, onDestroy } from 'svelte';+ import { goto } from '$app/navigation';import { t } from '$lib/i18n';interface Props {@@ -40,28 +51,32 @@const tr: NamiTranslate = (key, values) => $t(key, values) as string;- const RING_RADIUS = 44;- const RING_CIRCUMFERENCE = 2 * Math.PI * RING_RADIUS;-const initialDraft = getDraft();let url = $state(initialDraft.url);- let contentType = $state(initialDraft.contentType);+ let contentType = $state(initialDraft.contentType || 'all');let selectedProfileUrl = $state<string | null>(initialDraft.selectedProfileUrl);onDestroy(() => {setDraft({ url, contentType, selectedProfileUrl });});- function detectPlatform(u: string): string {- const low = u.toLowerCase();- if (low.includes('instagram.com')) return 'Instagram';- if (low.includes('tiktok.com')) return 'TikTok';- if (low.includes('facebook.com')) return 'Facebook';- if (low.includes('x.com') || low.includes('twitter.com')) return 'X';- return 'Other';+ interface CreatorInfo {+ platform: string;+ platformName: string;+ name: string;+ handle: string;+ meta: string;+ avatar: string;+ url: string;}let savedProfiles = $state<Array<Profile & { _platformLabel?: string }>>([]);+ let currentCreator = $state<CreatorInfo | null>(null);+ let avatarError = $state(false);+ let failedAvatars = $state<Record<string, boolean>>({});+ let isResolvingMeta = $state(false);+ let profileAvatars = $state<Record<string, string>>({});+ let urlInputEl = $state<HTMLInputElement | null>(null);let downloading = $derived(isActive());let cancelling = $derived(isCancelling());@@ -76,13 +91,16 @@let outputDir = $derived(getOutputDir());let cookiesFile = $derived(getCookiesFile());+ let browserCookies = $derived(getBrowserCookies());+ let hasCookies = $derived(Boolean(cookiesFile.trim() || (browserCookies && browserCookies !== 'none')));let missingOutputDir = $derived(!outputDir.trim());let needsCookiesWarning = $derived(- (contentType === 'stories' || contentType === 'highlights') && !cookiesFile.trim()+ (contentType === 'stories' || contentType === 'highlights') && !hasCookies);- let currentPlatform = $derived(detectPlatform(getDownloadUrl() ?? ''));- let isInstagram = $derived(currentPlatform === 'Instagram');+ let parsed = $derived(parseProfileUrl(url.trim()));+ let isSupported = $derived(parsed.platform !== 'unknown');+ let isInstagram = $derived(parsed.platform === 'instagram');let platformMismatch = $derived((contentType === 'stories' || contentType === 'highlights') && !isInstagram);@@ -90,21 +108,19 @@let depStatus = $derived(getDependencyStatus());let depChecking = $derived(isCheckingDependencies());- let ringFraction = $derived.by(() => {- if (!stageTotal || stageTotal <= 1) return null;- const idx = stageIndex ?? 1;- const raw = (idx - 0.5) / stageTotal;- return Math.min(1, Math.max(0, raw));+ let isSaved = $derived.by(() => {+ if (!currentCreator) return false;+ const clean = currentCreator.url.toLowerCase().trim();+ return savedProfiles.some((p) => p.url.toLowerCase().trim() === clean);});- let ringDashoffset = $derived(- ringFraction === null ? 0 : RING_CIRCUMFERENCE * (1 - ringFraction)- );-onMount(async () => {await loadSettings();await loadSavedProfiles();await ensureDependenciesChecked();+ if (url.trim()) {+ handleUrlChange(url.trim());+ }});async function loadSavedProfiles() {@@ -122,33 +138,200 @@}));savedProfiles = results.flat();-- if (savedProfiles.length > 0 && !selectedProfileUrl && !url.trim()) {- selectedProfileUrl = savedProfiles[0]?.url ?? null;- }+ savedProfiles.forEach(async (profile) => {+ const target = profile.username || profile.url;+ const cached = getCachedCreator(profile.platform, target);+ if (cached?.avatar) {+ profileAvatars[profile.url] = cached.avatar;+ } else {+ const parsed = parseProfileUrl(profile.url);+ if (parsed.platform !== 'unknown' && parsed.cleanUrl) {+ try {+ const meta = await resolveCreatorMetadata(parsed);+ if (meta?.avatar) {+ profileAvatars[profile.url] = meta.avatar;+ }+ } catch {}+ }+ }+ });} catch (error) {console.error('Failed to load profiles:', error);}}- function getDownloadUrl(): string | null {- if (url.trim()) {- return url.trim();+ function handleUrlChange(val: string) {+ url = val;+ avatarError = false;+ const trimmed = val.trim();++ if (!trimmed) {+ currentCreator = null;+ setDraft({ url: '', contentType, selectedProfileUrl: null });+ return;+ }++ const p = parseProfileUrl(trimmed);+ if (p.platform === 'unknown' || !p.cleanUrl) {+ currentCreator = null;+ return;+ }++ const platformLabels: Record<string, string> = {+ instagram: 'Instagram',+ tiktok: 'TikTok',+ facebook: 'Facebook',+ x: 'X',+ };+ const platName = platformLabels[p.platform] || p.platform;+ const handle = p.username ? `@${p.username}` : p.cleanUrl;+ let name = p.username ? p.username : platName;+ let meta = `${handle} • ${platName}`;+ let avatar = '';++ const target = p.username || p.cleanUrl;+ const cached = getCachedCreator(p.platform, target);+ if (cached) {+ if (cached.name) name = cached.name;+ if (cached.meta) meta = cached.meta;+ if (cached.avatar) avatar = cached.avatar;}- if (selectedProfileUrl) {- return selectedProfileUrl;++ currentCreator = {+ platform: p.platform,+ platformName: platName,+ name,+ handle,+ meta,+ avatar,+ url: p.cleanUrl,+ };++ setDraft({ url: p.cleanUrl, contentType, selectedProfileUrl: p.cleanUrl });++ // Asynchronously enrich metadata & real avatar without blocking+ enrichCreatorInfo(p);+ }++ async function enrichCreatorInfo(p: ParsedProfile) {+ if (!currentCreator?.avatar) {+ isResolvingMeta = true;+ }+ try {+ const meta = await resolveCreatorMetadata(p);+ if (meta && currentCreator && currentCreator.url === p.cleanUrl) {+ currentCreator = {+ ...currentCreator,+ name: meta.name || currentCreator.name,+ meta: meta.meta || currentCreator.meta,+ avatar: meta.avatar || currentCreator.avatar,+ };+ }+ } catch {+ // Fallback remains active+ } finally {+ isResolvingMeta = false;+ }+ }++ async function handlePaste() {+ try {+ const text = await navigator.clipboard.readText();+ if (text && text.trim()) {+ handleUrlChange(text.trim());+ }+ } catch {+ showToast('error', 'Clipboard permission was not granted');+ }+ }++ function clearUrl() {+ url = '';+ selectedProfileUrl = null;+ currentCreator = null;+ handleUrlChange('');+ urlInputEl?.focus();+ }++ async function toggleSaveProfile() {+ if (!currentCreator) return;+ const targetUrl = currentCreator.url;+ const platform = currentCreator.platform;++ try {+ if (isSaved) {+ await deleteProfile(platform, targetUrl);+ showToast('info', `Profile removed: ${currentCreator.name}`);+ } else {+ await saveProfile(platform, targetUrl);+ showToast('success', `Profile saved: ${currentCreator.name}`);+ }+ await loadSavedProfiles();+ } catch (err: unknown) {+ const msg = err instanceof Error ? err.message : String(err);+ showToast('error', `Failed to update profile: ${msg}`);+ }+ }++ async function handleDeleteSavedProfile(p: Profile) {+ try {+ await deleteProfile(p.platform, p.url);+ showToast('info', `Removed ${p.username || p.url}`);+ await loadSavedProfiles();+ } catch (err: unknown) {+ const msg = err instanceof Error ? err.message : String(err);+ showToast('error', `Failed to delete profile: ${msg}`);+ }+ }++ function loadProfileDirectly(profileUrl: string) {+ handleUrlChange(profileUrl);+ }++ async function triggerDownloadForProfile(p: Profile & { _platformLabel?: string }) {+ if (missingOutputDir) {+ showToast('error', 'Output directory is not set. Please configure in Settings.');+ return;+ }+ const cached = getCachedCreator(p.platform, p.username || p.url);+ const creatorMeta = cached+ ? {+ name: cached.name,+ handle: cached.handle,+ avatar: cached.avatar,+ platform: cached.platform,+ platformName: cached.platformName,+ }+ : {+ name: p.username || p.url,+ handle: p.username ? `@${p.username}` : p.url,+ platform: p.platform,+ platformName: p._platformLabel || p.platform,+ };++ try {+ void startStoreDownload(p.url, outputDir, cookiesFile, contentType, creatorMeta);+ showToast('info', `Added ${p.username || p.url} to downloads`);+ } catch (err: unknown) {+ const msg = err instanceof Error ? err.message : String(err);+ showToast('error', `Failed to start download: ${msg}`);}- return null;}async function startDownload() {- const downloadUrl = getDownloadUrl();+ const downloadUrl = currentCreator?.url || url.trim();if (!downloadUrl || missingOutputDir || needsCookiesWarning || platformMismatch) {return;}+ const creatorSnapshot = currentCreator ? { ...currentCreator } : null;+try {- await startStoreDownload(downloadUrl, outputDir, cookiesFile, contentType);+ void startStoreDownload(downloadUrl, outputDir, cookiesFile, contentType, creatorSnapshot);+ showToast('info', $t('librebox.added_to_downloads') || 'Added to downloads');+ url = '';+ currentCreator = null;+ setDraft({ url: '', contentType, selectedProfileUrl: null });} catch (error) {console.error('Failed to start download:', error);}@@ -162,547 +345,709 @@clearStoreStatus();}- function selectProfile(profileUrl: string) {- selectedProfileUrl = profileUrl;- url = '';- if ((contentType === 'stories' || contentType === 'highlights') && detectPlatform(profileUrl) !== 'Instagram') {- contentType = 'photos';- }- setDraft({ url: '', contentType, selectedProfileUrl: profileUrl });- }-- function handleUrlInput() {- if (url.trim()) {- selectedProfileUrl = null;- }- if ((contentType === 'stories' || contentType === 'highlights') && detectPlatform(url) !== 'Instagram') {- contentType = 'photos';- }- setDraft({ url, contentType, selectedProfileUrl });- }-- const CONTENT_TYPES: Array<{ key: string; labelKey: string }> = [- { key: 'all', labelKey: 'nami.content_all' },- { key: 'photos', labelKey: 'nami.content_photos' },- { key: 'videos', labelKey: 'nami.content_videos' },- { key: 'stories', labelKey: 'nami.content_stories' },- { key: 'highlights', labelKey: 'nami.content_highlights' },+ const CONTENT_TYPES: Array<{ key: string; label: string }> = [+ { key: 'all', label: 'All Posts' },+ { key: 'photos', label: 'Photos' },+ { key: 'videos', label: 'Videos' },+ { key: 'stories', label: 'Stories' },+ { key: 'highlights', label: 'Highlights' },];</script>-<div class="dl">- {#if depStatus && !depStatus.ok}- <div class="dl-alert error" role="alert">- <span>{namiStatusMessage(depStatus.message, tr)}</span>+<div class="nami-home-stage">+ <!-- Centered Mascot Logo with warm light halo -->+ <div class="nami-mascot-wrapper">+ <div class="nami-mascot-glow"></div>+ <div class="nami-mascot-icon">+ <img src="/icons/nav/nami.svg" alt="Nami" width="84" height="84" class="mascot-img" /></div>- {/if}+ </div>- <div class="dl-live" aria-live="polite" aria-atomic="true">- {#if status}- <div- class="dl-alert"- class:success={statusType === 'success'}- class:error={statusType === 'error'}- class:info={statusType === 'info'}- role={statusType === 'error' ? 'alert' : 'status'}+ <!-- Canonical LibreGet HomeUrlBar -->+ <div class="url-bar">+ <input+ id="nami-url-input"+ class="url-input"+ type="text"+ aria-label="Creator profile or media URL"+ bind:this={urlInputEl}+ bind:value={url}+ oninput={(e) => handleUrlChange((e.target as HTMLInputElement).value)}+ onkeydown={(e) => {+ if (e.key === 'Enter') startDownload();+ }}+ placeholder="Paste creator profile or media URL..."+ autocomplete="off"+ spellcheck="false"+ />++ {#if url.trim()}+ <button+ type="button"+ class="clear-btn"+ onmousedown={(e) => e.preventDefault()}+ onclick={clearUrl}+ title="Clear URL"+ aria-label="Clear URL">- <div class="dl-alert-body">- <span>{namiStatusMessage(status, tr)}</span>- {#if statusDetail}- <details class="dl-alert-details">- <summary>{$t('nami.view_log')}</summary>- <pre>{statusDetail}</pre>- </details>- {/if}- </div>- <button class="dl-alert-close" onclick={clearStatus} aria-label={$t('common.dismiss')}>×</button>- </div>- {/if}- </div>+ <svg viewBox="0 0 16 16" width="14" height="14" fill="currentColor">+ <path d="M8 1.4a6.6 6.6 0 1 0 0 13.2A6.6 6.6 0 0 0 8 1.4zm2.35 3.5a.75.75 0 0 1 1.06 1.06L9.06 8l2.35 2.35a.75.75 0 1 1-1.06 1.06L8 9.06 5.65 11.4a.75.75 0 1 1-1.06-1.06L6.94 8 4.6 5.65A.75.75 0 0 1 5.65 4.6L8 6.94l2.35-2.04z" />+ </svg>+ </button>- {#if !url.trim() && savedProfiles.length > 0}- <div class="dl-quicklist" role="group" aria-label={$t('nami.saved_profiles_aria')}>- {#each savedProfiles as profile (profile.url)}+ {#if downloading}<buttontype="button"- class="dl-chip"- class:on={selectedProfileUrl === profile.url}- onclick={() => selectProfile(profile.url)}- disabled={downloading}- aria-pressed={selectedProfileUrl === profile.url}+ class="go-btn stop-btn"+ onclick={handleStop}+ disabled={cancelling}+ title={cancelling ? "Stopping..." : "Stop download"}+ aria-label="Stop download">- <span>{profile.username || profile.url}</span>- {#if profile._platformLabel}- <span class="dl-chip-sub">{profile._platformLabel}</span>- {/if}+ <svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor">+ <rect x="6" y="6" width="12" height="12" rx="1" />+ </svg></button>- {/each}- </div>- {:else if !url.trim() && savedProfiles.length === 0}- <p class="dl-hint">- {$t('nami.no_saved_profiles')}- <button type="button" class="dl-link" onclick={() => onSwitchToProfiles?.()}- >{$t('nami.add_one')}</button- >- </p>- {/if}-- <div class="dl-group">- <div class="dl-row">- <svg class="dl-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" aria-hidden="true">- <path d="M5.5 10.5c-.8.8-2.2.8-3 0-.8-.8-.8-2.2 0-3L4 6" />- <path d="M10.5 5.5c.8-.8 2.2-.8 3 0 .8.8.8 2.2 0 3L12 10" />- <path d="M6.3 9.7 9.7 6.3" />- </svg>- <input- id="profile-url"- aria-label={$t('nami.profile_url_aria')}- type="text"- bind:value={url}- oninput={handleUrlInput}- placeholder="https://instagram.com/username"- disabled={downloading}- autocomplete="off"- spellcheck="false"- />- </div>- </div>-- <div class="dl-segmented" role="group" aria-label={$t('nami.content_type_aria')}>- {#each CONTENT_TYPES as type (type.key)}+ {:else}+ <button+ type="button"+ class="go-btn"+ onclick={startDownload}+ title="Download"+ disabled={missingOutputDir || needsCookiesWarning || platformMismatch}+ aria-label="Start download"+ >+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">+ <path d="M12 5v14M6 13l6 6 6-6" />+ </svg>+ </button>+ {/if}+ {:else}<buttontype="button"- class:on={contentType === type.key}- onclick={() => {- contentType = type.key;- setDraft({ contentType: type.key });- }}- disabled={downloading || ((type.key === 'stories' || type.key === 'highlights') && !isInstagram)}- title={(type.key === 'stories' || type.key === 'highlights') && !isInstagram- ? $t('nami.instagram_only')- : ''}- aria-pressed={contentType === type.key}+ class="paste-btn"+ onclick={handlePaste}>- {$t(type.labelKey)}+ <span>Paste</span>+ <kbd>Ctrl+V</kbd></button>- {/each}+ {/if}</div>- {#if missingOutputDir}- <p class="dl-warning" role="alert">- {$t('nami.missing_output_dir_prefix')}- <button type="button" class="dl-link" onclick={() => onSwitchToSettings?.()}>{$t('nav.settings')}</button>- {$t('nami.missing_output_dir_suffix')}- </p>+ <!-- Detected Platform Feedback -->+ {#if currentCreator}+ <div class="feedback feedback-enter" data-supported="true">+ <span class="feedback-text">{currentCreator.platformName} detected</span>+ </div>{/if}- {#if needsCookiesWarning}- <p class="dl-warning" role="alert">- {$t('nami.cookies_required_prefix')}- <button type="button" class="dl-link" onclick={() => onSwitchToSettings?.()}>{$t('nav.settings')}</button>.- </p>+ <!-- Dependency Notice if missing -->+ {#if depStatus && !depStatus.ok}+ <div class="notice notice-danger" role="alert">+ <span>{namiStatusMessage(depStatus.message, tr)}</span>+ </div>{/if}- {#if platformMismatch}- <p class="dl-warning" role="alert">{$t('nami.stories_instagram_only')}</p>+ {#if missingOutputDir}+ <div class="notice notice-warning" role="alert">+ <span>Output directory is not set.</span>+ <button type="button" class="btn btn-sm btn-secondary" onclick={() => onSwitchToSettings?.()}>+ Configure Settings+ </button>+ </div>{/if}- <div class="dl-actions">- {#if downloading}- <button class="dl-btn stop" onclick={handleStop} disabled={cancelling}>- {cancelling ? $t('nami.cancelling') : $t('nami.stop_download')}- </button>- {:else}- <button- class="dl-btn primary"- onclick={startDownload}- disabled={!getDownloadUrl() || missingOutputDir || needsCookiesWarning || platformMismatch || (depStatus !== null && !depStatus.ok)}- >- {$t('nami.start_download')}+ {#if needsCookiesWarning}+ <div class="notice notice-warning" role="alert">+ <span>Stories & Highlights require active cookies. Please connect a browser bridge in Settings.</span>+ <button type="button" class="btn btn-sm btn-secondary" onclick={() => onSwitchToSettings?.()}>+ Settings</button>- {/if}- </div>+ </div>+ {/if}- {#if downloading}- <div class="dl-progress" role="status" aria-live="polite" aria-atomic="true">- <svg class="dl-ring" class:indeterminate={ringFraction === null} viewBox="0 0 104 104" width="104" height="104" aria-hidden="true">- <circle class="dl-ring-track" cx="52" cy="52" r={RING_RADIUS} />- {#if ringFraction === null}- <circle class="dl-ring-progress" cx="52" cy="52" r={RING_RADIUS} />- {:else}- <circle- class="dl-ring-progress"- cx="52"- cy="52"- r={RING_RADIUS}- stroke-dasharray={RING_CIRCUMFERENCE}- stroke-dashoffset={ringDashoffset}- />- {/if}- <text x="52" y="49" text-anchor="middle" class="dl-ring-count">{filesDownloaded}</text>- <text x="52" y="66" text-anchor="middle" class="dl-ring-label">{$t('nami.files_label')}</text>- </svg>- <p class="dl-progress-stage">- {#if stageTotal && stageTotal > 1}- {$t('nami.stage_of', {- index: stageIndex ?? 1,- total: stageTotal,- stage: namiStageLabel(stage, tr)- })}+ <!-- Creator Inspector Panel (When URL is entered) -->+ {#if currentCreator}+ <section class="home-panel" aria-label="Creator preview">+ <div class="home-panel-body">+ <!-- MediaPreview Row -->+ <div class="preview-container">+ <div class="preview-thumbnail-wrapper">+ {#if !avatarError && currentCreator.avatar}+ <img+ class="preview-thumbnail"+ src={currentCreator.avatar}+ alt={currentCreator.name}+ referrerpolicy="no-referrer"+ onerror={() => (avatarError = true)}+ />+ {:else if isResolvingMeta}+ <div class="preview-shimmer-badge" data-platform={currentCreator.platform}>+ <div class="shimmer-pulse"></div>+ </div>+ {:else}+ <div class="preview-initials-badge" data-platform={currentCreator.platform}>+ <span>{currentCreator.name.slice(0, 2).toUpperCase()}</span>+ </div>+ {/if}+ </div>++ <div class="preview-info">+ <p class="preview-title">{currentCreator.name}</p>+ <p class="preview-author">{currentCreator.meta}</p>+ </div>++ <!-- Save / Saved Toggle Button -->+ <button+ type="button"+ class="btn btn-sm"+ class:btn-primary={isSaved}+ class:btn-secondary={!isSaved}+ onclick={toggleSaveProfile}+ title={isSaved ? 'Remove from Saved' : 'Save Profile'}+ >+ <svg viewBox="0 0 24 24" width="13" height="13" fill={isSaved ? 'currentColor' : 'none'} stroke="currentColor" stroke-width="2">+ <path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z" />+ </svg>+ <span>{isSaved ? 'Saved' : 'Save'}</span>+ </button>+ </div>++ <!-- Scope / Content Type Segmented Selector -->+ <div class="category-block">+ <span class="category-heading">CATEGORY</span>+ <div class="segmented segmented-lg" role="group">+ {#each CONTENT_TYPES as type (type.key)}+ <button+ type="button"+ class="segmented-btn"+ class:active={contentType === type.key}+ disabled={downloading || ((type.key === 'stories' || type.key === 'highlights') && !isInstagram)}+ onclick={() => {+ contentType = type.key;+ setDraft({ contentType: type.key });+ }}+ >+ {type.label}+ </button>+ {/each}+ </div>+ </div>++ <!-- Full-Width Download / Stop Primary Button -->+ {#if downloading}+ <button+ type="button"+ class="download-primary-btn stop-primary-btn"+ onclick={handleStop}+ disabled={cancelling}+ >+ {cancelling ? 'Stopping...' : 'Stop Download'}+ </button>{:else}- {stage- ? $t('nami.downloading_stage', { stage: namiStageLabel(stage, tr) })- : $t('nami.downloading')}+ <button+ type="button"+ class="download-primary-btn"+ onclick={startDownload}+ disabled={missingOutputDir || needsCookiesWarning || platformMismatch}+ >+ Download+ </button>{/if}- </p>- {#if lastMessage}- <p class="dl-progress-msg" title={lastMessage}>{lastMessage}</p>+ </div>+ </section>+ {/if}++ <!-- Clean Saved Profiles Section (When URL bar is empty) -->+ {#if !url.trim()}+ <section class="saved-profiles-section">+ <div class="section-header">+ <span class="section-header-title">Saved Profiles</span>+ <span class="badge badge-neutral">{savedProfiles.length}</span>+ </div>++ {#if savedProfiles.length > 0}+ <div class="surface-card saved-profiles-card">+ {#each savedProfiles as profile (profile.url)}+ <div+ class="list-row interactive"+ role="button"+ tabindex="0"+ onclick={() => loadProfileDirectly(profile.url)}+ onkeydown={(e) => {+ if (e.key === 'Enter') loadProfileDirectly(profile.url);+ }}+ >+ {#if (profileAvatars[profile.url] || getCachedCreator(profile.platform, profile.username || profile.url)?.avatar) && !failedAvatars[profile.url]}+ <img+ src={profileAvatars[profile.url] || getCachedCreator(profile.platform, profile.username || profile.url)?.avatar}+ alt={profile.username || profile.platform}+ class="preview-avatar-thumb"+ referrerpolicy="no-referrer"+ onerror={() => {+ failedAvatars[profile.url] = true;+ delete profileAvatars[profile.url];+ }}+ />+ {:else}+ <div class="preview-initials-badge" data-platform={profile.platform}>+ <span>{(profile.username || profile.platform).slice(0, 2).toUpperCase()}</span>+ </div>+ {/if}+ <span class="list-row-content">+ <span class="list-row-title">{profile.username || profile.url}</span>+ <span class="list-row-sub">{profile.url} • {profile._platformLabel || profile.platform}</span>+ </span>+ <span class="list-row-trailing">+ <button+ type="button"+ class="btn btn-sm btn-secondary"+ onclick={(e) => {+ e.stopPropagation();+ triggerDownloadForProfile(profile);+ }}+ >+ Download+ </button>+ <button+ type="button"+ class="btn btn-sm btn-ghost"+ title="Remove Profile"+ onclick={(e) => {+ e.stopPropagation();+ handleDeleteSavedProfile(profile);+ }}+ >+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">+ <polyline points="3 6 5 6 21 6" />+ <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />+ </svg>+ </button>+ </span>+ </div>+ {/each}+ </div>+ {:else}+ <div class="empty-state">+ <p class="empty-state-hint">No saved profiles yet. Enter a URL above and click Save.</p>+ </div>{/if}- </div>+ </section>{/if}</div><style>- .dl {+ .nami-home-stage {display: flex;flex-direction: column;- gap: 14px;+ align-items: center;+ gap: var(--space-4);+ width: 100%;+ max-width: 620px;+ margin: 0 auto;}- .dl-live {- min-height: 0;+ /* Mascot Hero */+ .nami-mascot-wrapper {+ position: relative;+ display: flex;+ align-items: center;+ justify-content: center;+ padding: var(--space-3) 0 var(--space-2);}- .dl-alert {- padding: 10px 14px;- border-radius: var(--oo-radius, 9px);- display: flex;- justify-content: space-between;- align-items: flex-start;- gap: 12px;- font-size: 12.5px;- line-height: 1.45;+ .nami-mascot-glow {+ position: absolute;+ width: 160px;+ height: 160px;+ border-radius: 50%;+ background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 70%);+ pointer-events: none;+ z-index: 0;}- .dl-alert-body {- flex: 1;- min-width: 0;+ .nami-mascot-icon {+ position: relative;+ z-index: 1;+ filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));+ }++ /* Canonical LibreGet HomeUrlBar */+ .url-bar {+ position: relative;+ display: flex;+ align-items: center;+ gap: 8px;+ width: 100%;+ height: 58px;+ padding: 0 10px 0 18px;+ border-radius: 20px;+ background: var(--surface);+ box-shadow:+ inset 0 0 0 var(--hairline) var(--content-border),+ 0 12px 32px rgba(var(--shadow-ink, 0, 0, 0), var(--elev-alpha-1, 0.2)),+ 0 2px 6px rgba(var(--shadow-ink, 0, 0, 0), calc(var(--elev-alpha-1, 0.2) * 0.6));+ transition: box-shadow var(--duration-base) var(--ease-out);}- .dl-alert.success {- background: var(--success);- color: var(--on-success);+ .url-bar:focus-within {+ box-shadow:+ inset 0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent),+ 0 0 0 5px var(--accent-soft),+ 0 12px 32px rgba(var(--shadow-ink, 0, 0, 0), var(--elev-alpha-1, 0.2));}- .dl-alert.error {- background: var(--error);- color: var(--on-error);+ .url-input {+ flex: 1;+ min-width: 0;+ height: 100%;+ border: none;+ background: transparent;+ color: var(--text);+ font: inherit;+ font-size: 15px;+ letter-spacing: -0.01em;+ outline: none;}- .dl-alert.info {- background: color-mix(in srgb, var(--oo-accent) 12%, transparent);- color: var(--oo-accent);+ .url-input::placeholder {+ color: var(--text-dim);}- .dl-alert-details {- margin-top: 6px;- font-size: 11.5px;+ .clear-btn {+ display: grid;+ place-items: center;+ width: 28px;+ height: 28px;+ border: none;+ border-radius: 50%;+ background: transparent;+ color: var(--text-faint);cursor: pointer;+ flex-shrink: 0;}- .dl-alert-details pre {- margin-top: 4px;- padding: 6px 8px;- border-radius: 4px;- background: rgba(0, 0, 0, 0.2);- font-family: var(--font-mono, monospace);- font-size: 11px;- white-space: pre-wrap;- max-height: 140px;- overflow-y: auto;+ .clear-btn :global(svg) {+ pointer-events: none;}- .dl-alert-close {- font-size: 18px;- line-height: 1;- opacity: 0.8;- background: transparent;+ .clear-btn:hover {+ color: var(--text-muted);+ }++ .go-btn {+ display: grid;+ place-items: center;+ width: 40px;+ height: 40px;+ flex-shrink: 0;border: none;- color: inherit;+ border-radius: 50%;+ background: var(--cta);+ color: var(--on-cta);cursor: pointer;- padding: 2px 6px;- min-width: 28px;- min-height: 28px;- display: flex;- align-items: center;- justify-content: center;- border-radius: 4px;+ box-shadow: 0 4px 14px var(--accent-glow, rgba(255, 159, 10, 0.4));+ transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);}- .dl-alert-close:hover {- opacity: 1;- background: rgba(0, 0, 0, 0.1);+ .go-btn:hover:not(:disabled) {+ background: var(--cta-hover);}- .dl-quicklist {- display: flex;- flex-wrap: wrap;- gap: 6px;+ .go-btn:active:not(:disabled) {+ background: var(--cta-press);+ transform: scale(0.95);}- .dl-chip {- display: flex;+ .go-btn:disabled {+ opacity: 0.5;+ cursor: not-allowed;+ }++ .paste-btn {+ display: inline-flex;align-items: center;- gap: 6px;- padding: 5px 11px;+ gap: 8px;+ height: 36px;+ padding: 0 8px 0 14px;+ flex-shrink: 0;+ border: none;border-radius: 999px;- font-size: 11.5px;- background: var(--oo-group-bg);- border: 1px solid var(--oo-border);- color: var(--oo-text);+ background: var(--fill-1);+ color: var(--text);+ font: inherit;+ font-size: var(--text-sm);+ font-weight: 600;cursor: pointer;- transition: background 150ms ease, border-color 150ms ease;+ transition: background var(--duration-fast) var(--ease-out);}- .dl-chip:disabled {- opacity: 0.5;- cursor: not-allowed;+ .paste-btn:hover {+ background: var(--fill-2);}- .dl-chip.on {- background: var(--oo-accent);- color: var(--on-accent);- border-color: var(--oo-accent);+ .paste-btn kbd {+ font: inherit;+ font-size: 11px;+ font-weight: 600;+ padding: 2px 6px;+ border-radius: 6px;+ background: var(--surface);+ color: var(--text-dim);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ }++ /* Feedback */+ .feedback {+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 6px;+ min-height: 20px;+ color: var(--text-muted);+ font-size: var(--text-sm);font-weight: 500;}- .dl-chip-sub {- font-size: 10px;- opacity: 0.75;+ .feedback-enter {+ animation: feedbackEnter var(--duration-base) var(--ease-out);}- .dl-hint {- font-size: 12px;- color: var(--oo-text-secondary);- margin: 0;+ @keyframes feedbackEnter {+ from { opacity: 0; transform: translateY(-3px); }+ to { opacity: 1; transform: translateY(0); }}- .dl-link {- color: var(--oo-accent);- text-decoration: underline;- font-size: inherit;- background: transparent;- border: none;- padding: 0;- cursor: pointer;+ /* Creator Inspector Panel */+ .home-panel {+ width: 100%;+ background: var(--surface);+ border-radius: var(--radius-lg);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ padding: var(--space-4);+ animation: panel-in var(--duration-slow) var(--ease-spring);+ box-sizing: border-box;}- .dl-link:hover {- opacity: 0.8;+ .home-panel-body {+ display: flex;+ flex-direction: column;+ gap: var(--space-4);}- .dl-group {- background: var(--oo-group-bg);- border-radius: var(--oo-radius, 9px);- border: 1px solid var(--oo-border);- overflow: hidden;+ @keyframes panel-in {+ from { opacity: 0; transform: translateY(-6px) scale(0.99); }+ to { opacity: 1; transform: translateY(0) scale(1); }}- .dl-row {+ .preview-container {display: flex;align-items: center;- gap: 9px;- padding: 10px 12px;+ gap: var(--space-3);+ width: 100%;}- .dl-icon {- width: 15px;- height: 15px;- color: var(--oo-text-secondary);+ .preview-thumbnail-wrapper {+ position: relative;flex-shrink: 0;+ border-radius: var(--radius-md);+ overflow: hidden;+ width: 52px;+ height: 52px;+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ background: var(--fill-2);}- .dl-row input {- flex: 1;- border: 0;- background: transparent;- color: var(--oo-text);- font-size: 13px;- min-width: 0;+ .preview-thumbnail {+ width: 100%;+ height: 100%;+ object-fit: cover;+ display: block;}- .dl-row input:focus {- outline: none;+ .preview-initials-badge {+ width: 100%;+ height: 100%;+ display: flex;+ align-items: center;+ justify-content: center;+ font-size: 15px;+ font-weight: 700;+ color: var(--on-accent);+ background: var(--accent);}- .dl-row input:disabled {- opacity: 0.6;- cursor: not-allowed;+ .preview-initials-badge[data-platform="instagram"] {+ background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);+ color: #ffffff;}- .dl-segmented {- display: flex;- background: color-mix(in srgb, var(--oo-text) 6%, transparent);- border-radius: var(--oo-radius, 9px);- padding: 2px;- gap: 1px;+ .preview-initials-badge[data-platform="tiktok"] {+ background: #010101;+ color: #00f2fe;}- .dl-segmented button {- flex: 1;- min-height: 38px;- padding: 7px 8px;- font-size: 12px;- font-weight: 500;- color: var(--oo-text-secondary);- border-radius: 7px;- background: transparent;- border: none;- cursor: pointer;- transition: background 150ms ease, color 150ms ease;+ .preview-initials-badge[data-platform="x"] {+ background: #000000;+ color: #ffffff;}- .dl-segmented button.on {- background: var(--oo-group-bg);- color: var(--oo-text);- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);+ .preview-initials-badge[data-platform="facebook"] {+ background: #1877f2;+ color: #ffffff;}- .dl-segmented button:disabled {- opacity: 0.4;- cursor: not-allowed;+ .preview-info {+ flex: 1;+ min-width: 0;+ display: flex;+ flex-direction: column;+ gap: 3px;}- .dl-segmented button:disabled.on {- background: transparent;- box-shadow: none;+ .preview-title {+ font-size: var(--text-md);+ font-weight: 600;+ color: var(--text);+ margin: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;}- .dl-warning {- font-size: 12px;- color: var(--error);- margin: -4px 0 0;+ .preview-author {+ font-size: var(--text-sm);+ color: var(--text-dim);+ margin: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;}- .dl-actions {+ .category-block {display: flex;- justify-content: center;+ flex-direction: column;+ gap: 6px;}- .dl-btn {- min-height: 42px;- padding: 9px 26px;- border-radius: var(--oo-radius, 9px);+ .category-heading {+ font-size: 11px;font-weight: 600;- font-size: 13px;- background: var(--oo-accent);- color: var(--on-accent);- border: none;- cursor: pointer;- transition: filter 150ms ease, opacity 150ms ease;+ letter-spacing: 0.05em;+ color: var(--text-dim);}- .dl-btn:hover:not(:disabled) {- filter: brightness(1.06);+ .segmented-lg {+ width: 100%;+ display: flex;}- .dl-btn:disabled {- opacity: 0.45;- cursor: not-allowed;+ .segmented-lg .segmented-btn {+ flex: 1;+ height: 28px;+ text-align: center;}- .dl-btn.stop {- background: var(--error);- color: var(--on-error);+ /* Full-width orange download button */+ .download-primary-btn {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: var(--space-2);+ background: var(--cta);+ color: var(--on-cta);+ font-size: var(--text-md);+ font-weight: 600;+ letter-spacing: var(--track-snug);+ height: 42px;+ padding: 0 var(--space-4);+ border-radius: var(--radius-md);+ border: none;+ cursor: pointer;+ width: 100%;+ box-shadow: inset 0 0 0 var(--hairline) color-mix(in srgb, var(--on-cta) 12%, transparent);+ transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);}- .dl-progress {- display: flex;- flex-direction: column;- align-items: center;- padding-top: 2px;+ .download-primary-btn:hover:not(:disabled) {+ background: var(--cta-hover);}- .dl-ring {- color: var(--oo-accent);+ .download-primary-btn:active:not(:disabled) {+ background: var(--cta-press);+ transform: scale(0.99);}- .dl-ring-track {- fill: none;- stroke: color-mix(in srgb, var(--oo-text) 8%, transparent);- stroke-width: 8;+ .download-primary-btn:disabled {+ opacity: 0.5;+ cursor: not-allowed;}- .dl-ring-progress {- fill: none;- stroke: currentColor;- stroke-width: 8;- stroke-linecap: round;- transform: rotate(-90deg);- transform-origin: 52px 52px;- transition: stroke-dashoffset 0.35s ease;+ .download-primary-btn.stop-primary-btn {+ background: var(--danger, #ff3b30);+ color: #ffffff;+ box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35);}- .dl-ring.indeterminate .dl-ring-progress {- stroke-dasharray: 70 207;- transition: none;- animation: dl-ring-spin 1.1s linear infinite;+ .go-btn.stop-btn {+ background: var(--danger, #ff3b30);+ color: #ffffff;+ box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35);}- @keyframes dl-ring-spin {- from {- transform: rotate(-90deg);- }- to {- transform: rotate(270deg);- }+ /* Saved Profiles Section */+ .saved-profiles-section {+ width: 100%;+ display: flex;+ flex-direction: column;+ gap: var(--space-2);+ margin-top: var(--space-2);}- .dl-ring-count {- font-size: 17px;- font-weight: 700;- fill: var(--oo-text);+ .saved-profiles-card {+ overflow: hidden;}- .dl-ring-label {- font-size: 9.5px;- fill: var(--oo-text-secondary);+ .saved-profiles-card .preview-initials-badge {+ width: 32px;+ height: 32px;+ border-radius: var(--radius-sm);+ font-size: 11px;+ flex-shrink: 0;}- .dl-progress-stage {- font-size: 12.5px;- font-weight: 600;- color: var(--oo-text);- margin: 10px 0 2px;- text-align: center;+ .preview-avatar-thumb {+ width: 32px;+ height: 32px;+ border-radius: var(--radius-sm);+ object-fit: cover;+ flex-shrink: 0;}- .dl-progress-msg {- font-size: 11.5px;- color: var(--oo-text-secondary);- margin: 0;- max-width: 280px;- white-space: nowrap;+ .preview-shimmer-badge {+ width: 48px;+ height: 48px;+ border-radius: var(--radius-sm);+ background: var(--surface-hover);+ position: relative;overflow: hidden;- text-overflow: ellipsis;- text-align: center;+ flex-shrink: 0;}- @media (max-width: 440px) {- .dl-segmented {- flex-wrap: wrap;- }- .dl-segmented button {- flex: 1 1 28%;- }+ .shimmer-pulse {+ width: 100%;+ height: 100%;+ background: linear-gradient(+ 90deg,+ transparent 0%,+ rgba(255, 255, 255, 0.08) 50%,+ transparent 100%+ );+ animation: shimmer 1.5s infinite;}- @media (prefers-reduced-motion: reduce) {- .dl-ring.indeterminate .dl-ring-progress {- animation: none;- }- .dl-ring-progress {- transition: none;- }+ @keyframes shimmer {+ 0% { transform: translateX(-100%); }+ 100% { transform: translateX(100%); }}</style>diff --git a/src/components/nami/HistoryManager.svelte b/src/components/nami/HistoryManager.svelteindex 852a0fdd..d4698624 100644--- a/src/components/nami/HistoryManager.svelte+++ b/src/components/nami/HistoryManager.svelte@@ -1,5 +1,6 @@<script lang="ts">- import { onMount } from "svelte";+ import { onMount } from 'svelte';+ import { convertFileSrc } from '@tauri-apps/api/core';import {getRecords,getFilteredRecords,@@ -19,9 +20,10 @@openFile,openFolder,formatFileSize,- } from "$lib/stores/nami_history_store.svelte";- import { t } from "$lib/i18n";- import type { NamiMediaRecord } from "$lib/api/nami";+ } from '$lib/stores/nami_history_store.svelte';+ import { showToast } from '$lib/stores/toast-store.svelte';+ import { t } from '$lib/i18n';+ import type { NamiMediaRecord } from '$lib/api/nami';interface Props {onSwitchToDownload?: () => void;@@ -30,255 +32,272 @@let { onSwitchToDownload }: Props = $props();const platforms = [- { key: "all", labelKey: "nami.platform_all" },- { key: "instagram", label: "Instagram" },- { key: "tiktok", label: "TikTok" },- { key: "facebook", label: "Facebook" },- { key: "x", label: "X" },+ { key: 'all', label: 'All' },+ { key: 'instagram', label: 'Instagram' },+ { key: 'tiktok', label: 'TikTok' },+ { key: 'facebook', label: 'Facebook' },+ { key: 'x', label: 'X' },];- let deleteCandidate = $state<NamiMediaRecord | null>(null);- let dialogEl: HTMLDialogElement | null = $state(null);-- onMount(() => {- loadHistory();+ const BATCH_SIZE = 30;+ let visibleCount = $state(BATCH_SIZE);+ let filteredRecords = $derived(getFilteredRecords());+ let visibleRecords = $derived(filteredRecords.slice(0, visibleCount));+ let sentinelEl = $state<HTMLElement | null>(null);+ let failedImages = $state<Record<string, boolean>>({});++ $effect(() => {+ getPlatformFilter();+ getSearchQuery();+ visibleCount = BATCH_SIZE;});- function handlePlatformClick(p: string) {- setPlatformFilter(p);- }-- function handleSearchInput(e: Event) {- const target = e.target as HTMLInputElement;- setSearchQuery(target.value);- }+ $effect(() => {+ if (!sentinelEl || visibleCount >= filteredRecords.length) return;- function promptDelete(record: NamiMediaRecord) {- deleteCandidate = record;- dialogEl?.showModal();- }+ const observer = new IntersectionObserver(+ (entries) => {+ if (entries[0]?.isIntersecting) {+ visibleCount = Math.min(filteredRecords.length, visibleCount + BATCH_SIZE);+ }+ },+ { rootMargin: '500px' },+ );- function cancelDelete() {- deleteCandidate = null;- dialogEl?.close();- }+ observer.observe(sentinelEl);+ return () => observer.disconnect();+ });- async function confirmDelete() {- if (!deleteCandidate) return;- const id = deleteCandidate.id;- cancelDelete();- await deleteRecord(id);- }+ onMount(() => {+ loadHistory();+ });function formatDate(unixSeconds: number): string {- if (!unixSeconds) return "";+ if (!unixSeconds) return '';const d = new Date(unixSeconds * 1000);return d.toLocaleDateString(undefined, {- month: "short",- day: "numeric",- year: "numeric",+ month: 'short',+ day: 'numeric',+ year: 'numeric',});}- function getPlatformBadgeClass(plat: string): string {- const p = plat.toLowerCase();- if (p === "instagram") return "badge-ig";- if (p === "tiktok") return "badge-tt";- if (p === "facebook") return "badge-fb";- if (p === "x") return "badge-x";- return "";+ function isImageFile(path: string): boolean {+ return /\.(jpe?g|png|webp|gif|bmp|avif)$/i.test(path);+ }++ async function handleDelete(record: NamiMediaRecord) {+ try {+ await deleteRecord(record.id);+ showToast('info', 'Record removed from history');+ } catch (err: unknown) {+ const msg = err instanceof Error ? err.message : String(err);+ showToast('error', `Failed to remove: ${msg}`);+ }+ }++ async function handleReconcile() {+ try {+ await reconcileDisk();+ const stats = getReconcileStats();+ if (stats) {+ showToast('success', `Reconcile complete: checked ${stats.checked}, cleaned ${stats.removed} missing files`);+ }+ } catch (err: unknown) {+ const msg = err instanceof Error ? err.message : String(err);+ showToast('error', `Reconcile failed: ${msg}`);+ }}</script>-<div class="hm">+<div class="hm-page">+ <!-- Toolbar: Platform filter + Reconcile Disk --><div class="hm-toolbar">- <div class="hm-segmented" role="tablist" aria-label={$t("nami.platform_aria")}>+ <div class="segmented segmented-lg" role="tablist">{#each platforms as platform (platform.key)}<buttontype="button"role="tab"aria-selected={getPlatformFilter() === platform.key}- class:on={getPlatformFilter() === platform.key}- onclick={() => handlePlatformClick(platform.key)}+ class="segmented-btn"+ class:active={getPlatformFilter() === platform.key}+ onclick={() => setPlatformFilter(platform.key)}>- {platform.labelKey ? $t(platform.labelKey) : platform.label}+ {platform.label}</button>{/each}</div><buttontype="button"- class="hm-sync-btn"- onclick={() => reconcileDisk()}+ class="btn btn-sm btn-secondary"+ onclick={handleReconcile}disabled={isReconciling() || isLoading()}- aria-label={$t("nami.sync_disk")}+ title="Verify media existence on disk and prune missing items"><svg- class="hm-btn-icon"- class:spin={isReconciling()}viewBox="0 0 16 16"+ width="13"+ height="13"fill="none"stroke="currentColor"- stroke-width="1.4"+ stroke-width="1.5"stroke-linecap="round"stroke-linejoin="round"- aria-hidden="true"+ class:spin={isReconciling()}><path d="M1.5 8a6.5 6.5 0 0 1 11.1-4.6L14 5" /><path d="M14 2v3h-3" /><path d="M14.5 8a6.5 6.5 0 0 1-11.1 4.6L2 11" /><path d="M2 14v-3h3" /></svg>- <span>{isReconciling() ? $t("nami.syncing_disk") : $t("nami.sync_disk")}</span>+ <span>{isReconciling() ? 'Reconciling...' : 'Reconcile Disk'}</span></button></div>- <div class="hm-search-box">- <svg class="hm-search-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true">- <circle cx="7" cy="7" r="4.5" />- <path d="m10.5 10.5 3.5 3.5" />- </svg>+ <!-- Search Input -->+ <div class="hm-search-row"><inputtype="search"+ class="input input-lg input-search"value={getSearchQuery()}- oninput={handleSearchInput}- placeholder={$t("nami.search_history_placeholder")}- aria-label={$t("nami.search_history_placeholder")}+ oninput={(e) => setSearchQuery((e.target as HTMLInputElement).value)}+ placeholder="Search history by author, filename, or post ID..."autocomplete="off"spellcheck="false"/>- {#if getSearchQuery()}- <button- type="button"- class="hm-clear-search"- onclick={() => setSearchQuery("")}- aria-label={$t("common.clear")}- >- ×- </button>- {/if}</div>{#if getError()}- <div class="hm-alert error" role="alert">+ <div class="notice notice-danger" role="alert"><span>{getError()}</span>- <button type="button" class="hm-alert-dismiss" onclick={clearError}>×</button>+ <button type="button" class="btn btn-sm btn-ghost" onclick={clearError}>×</button></div>{/if}{#if getReconcileStats()}- <div class="hm-alert info" role="status">- <span>- {$t("nami.disk_synced", {- checked: getReconcileStats()?.checked ?? 0,- removed: getReconcileStats()?.removed ?? 0,- })}- </span>- <button type="button" class="hm-alert-dismiss" onclick={clearReconcileStats}>×</button>+ <div class="notice notice-info" role="status">+ <span>Checked {getReconcileStats()?.checked ?? 0} items, removed {getReconcileStats()?.removed ?? 0} missing files.</span>+ <button type="button" class="btn btn-sm btn-ghost" onclick={clearReconcileStats}>×</button></div>{/if}+ <!-- History Items -->{#if isLoading()}- <div class="hm-empty">- <p>{$t("common.loading")}</p>+ <div class="empty-state">+ <div class="spinner"></div>+ <p class="empty-state-hint">Loading download ledger...</p></div>{:else if getFilteredRecords().length === 0}- <div class="hm-empty">- <p>{$t("nami.no_history_yet")}</p>+ <div class="empty-state surface-card">+ <p class="empty-state-title">No download history found</p>+ <p class="empty-state-hint">Files archived from Instagram, TikTok, Facebook, and X will appear here automatically.</p>{#if onSwitchToDownload}- <button type="button" class="hm-action-link" onclick={onSwitchToDownload}>- {$t("nami.start_download")}+ <button type="button" class="btn btn-primary" onclick={onSwitchToDownload}>+ Start Archiving</button>{/if}</div>{:else}- <div class="hm-list" role="list">- {#each getFilteredRecords() as record (record.id)}- <div class="hm-card" role="listitem">- <div class="hm-card-header">- <div class="hm-card-meta">- <span class="hm-badge {getPlatformBadgeClass(record.platform)}">- {record.platform.toUpperCase()}- </span>- <span class="hm-author" title={record.author ?? record.post_id}>- {record.author ? `@${record.author}` : `ID: ${record.post_id}`}- </span>- </div>- <span class="hm-date">{formatDate(record.downloaded_at)}</span>+ <div class="surface-card">+ {#each visibleRecords as record (record.id)}+ <div+ class="list-row interactive"+ role="button"+ tabindex="0"+ onclick={() => openFile(record.file_path)}+ onkeydown={(e) => {+ if (e.key === 'Enter') openFile(record.file_path);+ }}+ >+ <div class="hm-media-icon" data-platform={record.platform}>+ {#if isImageFile(record.file_path) && !failedImages[record.id]}+ <img+ src={convertFileSrc(record.file_path)}+ alt={record.author || record.post_id}+ class="hm-media-thumb"+ loading="lazy"+ onerror={() => {+ failedImages[record.id] = true;+ }}+ />+ {:else if record.file_path.endsWith('.mp4') || record.file_path.endsWith('.mov')}+ <svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor">+ <polygon points="5 3 19 12 5 21 5 3" />+ </svg>+ {:else}+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">+ <rect x="3" y="3" width="18" height="18" rx="2" ry="2" />+ <circle cx="8.5" cy="8.5" r="1.5" />+ <polyline points="21 15 16 10 5 21" />+ </svg>+ {/if}</div>- <div class="hm-card-body">- <p class="hm-path" title={record.file_path}>- {record.file_path}- </p>- <div class="hm-card-footer">- <span class="hm-size">{formatFileSize(record.file_size)}</span>- <div class="hm-card-actions">- <button- type="button"- class="hm-btn secondary"- onclick={() => openFile(record.file_path)}- title={$t("nami.open_file")}- aria-label={$t("nami.open_file")}- >- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" class="hm-icon-sm" aria-hidden="true">- <polygon points="4 2 12 8 4 14 4 2" />- </svg>- <span>{$t("nami.open_file")}</span>- </button>- <button- type="button"- class="hm-btn secondary"- onclick={() => openFolder(record.file_path)}- title={$t("nami.open_folder")}- aria-label={$t("nami.open_folder")}- >- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" class="hm-icon-sm" aria-hidden="true">- <path d="M1.5 3.5A1.5 1.5 0 0 1 3 2h3l1.5 2H13a1.5 1.5 0 0 1 1.5 1.5v7A1.5 1.5 0 0 1 13 14H3a1.5 1.5 0 0 1-1.5-1.5z" />- </svg>- <span>{$t("nami.open_folder")}</span>- </button>- <button- type="button"- class="hm-btn danger"- onclick={() => promptDelete(record)}- title={$t("nami.delete_record")}- aria-label={$t("nami.delete_record")}- >- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" class="hm-icon-sm" aria-hidden="true">- <line x1="3" y1="4" x2="13" y2="4" />- <path d="M5 4V3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1" />- <path d="M6 7v5M10 7v5" />- </svg>- </button>- </div>- </div>- </div>+ <span class="list-row-content">+ <span class="list-row-title">+ {record.author ? `@${record.author}` : `Post ${record.post_id}`}+ </span>+ <span class="list-row-sub">+ {record.platform.toUpperCase()} • {formatDate(record.downloaded_at)} • {formatFileSize(record.file_size)}+ </span>+ </span>++ <span class="list-row-trailing">+ <button+ type="button"+ class="btn btn-sm btn-secondary"+ onclick={(e) => {+ e.stopPropagation();+ openFile(record.file_path);+ }}+ title="Open Media File"+ >+ Open+ </button>++ <button+ type="button"+ class="btn btn-sm btn-secondary"+ onclick={(e) => {+ e.stopPropagation();+ openFolder(record.file_path);+ }}+ title="Open Containing Folder"+ >+ Folder+ </button>++ <button+ type="button"+ class="btn btn-sm btn-ghost"+ title="Delete ledger record"+ onclick={(e) => {+ e.stopPropagation();+ handleDelete(record);+ }}+ >+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">+ <polyline points="3 6 5 6 21 6" />+ <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />+ </svg>+ </button>+ </span></div>{/each}++ {#if visibleCount < filteredRecords.length}+ <div bind:this={sentinelEl} class="hm-sentinel" aria-hidden="true"></div>+ {/if}</div>{/if}</div>-<dialog bind:this={dialogEl} class="hm-dialog" onclose={() => (deleteCandidate = null)}>- <div class="hm-dialog-content">- <p class="hm-dialog-title">{$t("nami.delete_record")}</p>- <p class="hm-dialog-body">{$t("nami.confirm_delete_record")}</p>- {#if deleteCandidate}- <p class="hm-dialog-path">{deleteCandidate.file_path}</p>- {/if}- <div class="hm-dialog-actions">- <button type="button" class="hm-dialog-btn" onclick={cancelDelete}>{$t("common.cancel")}</button>- <button type="button" class="hm-dialog-btn danger" onclick={confirmDelete}>{$t("nami.delete")}</button>- </div>- </div>-</dialog>-<style>- .hm {+ .hm-page {display: flex;flex-direction: column;- gap: 14px;+ gap: var(--space-4);width: 100%;}@@ -286,410 +305,81 @@display: flex;align-items: center;justify-content: space-between;- gap: 10px;+ gap: var(--space-3);flex-wrap: wrap;}- .hm-segmented {- display: flex;- background: color-mix(in srgb, var(--oo-text) 6%, transparent);- border-radius: var(--oo-radius, 9px);- padding: 2px;- gap: 1px;- flex: 1;- min-width: 240px;- }-- .hm-segmented button {- flex: 1;- min-height: 34px;- padding: 6px 10px;- font-size: 12px;- font-weight: 500;- color: var(--oo-text-secondary);- border-radius: 7px;- background: transparent;- border: none;- cursor: pointer;- transition: background 150ms ease, color 150ms ease;- }-- .hm-segmented button.on {- background: var(--oo-group-bg);- color: var(--oo-text);- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);- }-- .hm-sync-btn {- display: inline-flex;- align-items: center;- gap: 6px;- min-height: 34px;- padding: 6px 14px;- border-radius: var(--oo-radius-sm);- background: var(--oo-group-bg);- border: 1px solid var(--oo-border);- color: var(--oo-text);- font-size: 12px;- font-weight: 500;- cursor: pointer;- transition: background 120ms ease, border-color 120ms ease;- flex-shrink: 0;- }-- .hm-sync-btn:hover:not(:disabled) {- background: color-mix(in srgb, var(--oo-text) 5%, var(--oo-group-bg));- }-- .hm-sync-btn:disabled {- opacity: 0.6;- cursor: not-allowed;- }-- .hm-btn-icon {- width: 14px;- height: 14px;- }-- .hm-btn-icon.spin {- animation: hm-spin 1s linear infinite;- }-- @keyframes hm-spin {- from {- transform: rotate(0deg);- }- to {- transform: rotate(360deg);- }- }-- .hm-search-box {- display: flex;- align-items: center;- gap: 8px;- min-height: 38px;- padding: 0 12px;- background: var(--oo-group-bg);- border: 1px solid var(--oo-border);- border-radius: var(--oo-radius, 9px);- }-- .hm-search-icon {- width: 15px;- height: 15px;- color: var(--oo-text-secondary);- flex-shrink: 0;- }-- .hm-search-box input {- flex: 1;- border: none;- background: transparent;- color: var(--oo-text);- font-size: 13px;- outline: none;- min-width: 0;- }-- .hm-clear-search {- background: transparent;- border: none;- color: var(--oo-text-secondary);- font-size: 16px;- cursor: pointer;- padding: 2px 6px;- border-radius: 4px;- }-- .hm-clear-search:hover {- color: var(--oo-text);- }-- .hm-alert {- display: flex;- align-items: center;- justify-content: space-between;- padding: 8px 12px;- border-radius: var(--oo-radius-sm);- font-size: 12.5px;- }-- .hm-alert.error {- background: var(--error);- color: var(--on-error);- }-- .hm-alert.info {- background: color-mix(in srgb, var(--oo-accent) 15%, var(--oo-group-bg));- border: 1px solid var(--oo-accent);- color: var(--oo-text);- }-- .hm-alert-dismiss {- background: transparent;- border: none;- font-size: 15px;- cursor: pointer;- color: inherit;- padding: 0 4px;- }-- .hm-empty {- text-align: center;- padding: 40px 16px;- color: var(--oo-text-secondary);- background: var(--oo-group-bg);- border-radius: var(--oo-radius, 9px);- border: 1px dashed var(--oo-border);- display: flex;- flex-direction: column;- align-items: center;- gap: 8px;- }-- .hm-empty p {- margin: 0;- font-size: 13px;- }-- .hm-action-link {- background: var(--oo-accent);- color: var(--on-accent);- border: none;- border-radius: var(--oo-radius-sm);- padding: 6px 14px;- font-size: 12px;- font-weight: 500;- cursor: pointer;- margin-top: 4px;- }-- .hm-list {- display: flex;- flex-direction: column;- gap: 8px;- }-- .hm-card {- background: var(--oo-group-bg);- border: 1px solid var(--oo-border);- border-radius: var(--oo-radius, 9px);- padding: 12px 14px;- display: flex;- flex-direction: column;- gap: 6px;- transition: border-color 150ms ease;- }-- .hm-card:hover {- border-color: color-mix(in srgb, var(--oo-accent) 40%, var(--oo-border));+ .hm-search-row {+ width: 100%;}- .hm-card-header {- display: flex;- align-items: center;- justify-content: space-between;- gap: 8px;+ .hm-search-row .input {+ width: 100%;}- .hm-card-meta {+ .hm-media-icon {+ position: relative;+ width: 38px;+ height: 38px;+ border-radius: var(--radius-sm);display: flex;align-items: center;- gap: 8px;- min-width: 0;- }-- .hm-badge {- font-size: 10px;- font-weight: 600;- padding: 2px 6px;- border-radius: 4px;- background: color-mix(in srgb, var(--oo-text) 8%, transparent);- color: var(--oo-text-secondary);- letter-spacing: 0.03em;+ justify-content: center;+ background: var(--fill-2);+ color: var(--text-muted);flex-shrink: 0;- }-- .hm-badge.badge-ig {- background: color-mix(in srgb, #e1306c 15%, transparent);- color: #e1306c;- }-- .hm-badge.badge-tt {- background: color-mix(in srgb, #00f2fe 15%, transparent);- color: var(--oo-text);- }-- .hm-badge.badge-fb {- background: color-mix(in srgb, #1877f2 15%, transparent);- color: #1877f2;- }-- .hm-badge.badge-x {- background: color-mix(in srgb, var(--oo-text) 12%, transparent);- color: var(--oo-text);- }-- .hm-author {- font-size: 13px;- font-weight: 600;- color: var(--oo-text);overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;}- .hm-date {- font-size: 11px;- color: var(--oo-text-secondary);- flex-shrink: 0;- }-- .hm-card-body {- display: flex;- flex-direction: column;- gap: 6px;- }-- .hm-path {- font-size: 11.5px;- font-family: var(--font-mono, monospace);- color: var(--oo-text-secondary);- margin: 0;- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;- line-height: 1.4;- }-- .hm-card-footer {- display: flex;- align-items: center;- justify-content: space-between;- gap: 12px;- margin-top: 2px;- }-- .hm-size {- font-size: 11.5px;- color: var(--oo-text-secondary);- font-weight: 500;+ .hm-media-thumb {+ width: 100%;+ height: 100%;+ object-fit: cover;+ display: block;}- .hm-card-actions {+ .hm-media-fallback {+ width: 100%;+ height: 100%;display: flex;align-items: center;- gap: 6px;- }-- .hm-btn {- display: inline-flex;- align-items: center;- gap: 5px;- min-height: 28px;- padding: 4px 10px;- border-radius: var(--oo-radius-sm);- font-size: 11.5px;- font-weight: 500;- cursor: pointer;- border: none;- transition: background 120ms ease, color 120ms ease;+ justify-content: center;}- .hm-btn.secondary {- background: color-mix(in srgb, var(--oo-text) 7%, transparent);- color: var(--oo-text);- }-- .hm-btn.secondary:hover {- background: color-mix(in srgb, var(--oo-text) 12%, transparent);- }-- .hm-btn.danger {- background: transparent;- color: var(--oo-text-secondary);- padding: 4px 6px;- }-- .hm-btn.danger:hover {- background: color-mix(in srgb, var(--error, #e53935) 15%, transparent);- color: var(--error, #e53935);- }-- .hm-icon-sm {- width: 12px;- height: 12px;- }-- .hm-dialog {- border: 1px solid var(--oo-border);- border-radius: var(--oo-radius, 9px);- background: var(--oo-content-bg);- color: var(--oo-text);- padding: 0;- max-width: 420px;- width: 90%;- box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);+ .hm-media-icon[data-platform="instagram"] {+ color: #e1306c;}- .hm-dialog::backdrop {- background: rgba(0, 0, 0, 0.45);+ .hm-media-icon[data-platform="tiktok"] {+ color: #00f2fe;}- .hm-dialog-content {- padding: 20px;- display: flex;- flex-direction: column;- gap: 10px;+ .hm-media-icon[data-platform="x"] {+ color: var(--text);}- .hm-dialog-title {- font-size: 15px;- font-weight: 600;- margin: 0;- }-- .hm-dialog-body {- font-size: 12.5px;- color: var(--oo-text-secondary);- margin: 0;- line-height: 1.45;+ .hm-media-icon[data-platform="facebook"] {+ color: #1877f2;}- .hm-dialog-path {- font-size: 11px;- font-family: var(--font-mono, monospace);- color: var(--oo-text-secondary);- background: var(--oo-group-bg);- padding: 6px 8px;- border-radius: 4px;- word-break: break-all;- margin: 0;+ .spin {+ animation: spin 1s linear infinite;}- .hm-dialog-actions {- display: flex;- justify-content: flex-end;- gap: 8px;- margin-top: 10px;+ @keyframes spin {+ to { transform: rotate(360deg); }}- .hm-dialog-btn {- min-height: 32px;- padding: 6px 14px;- border-radius: var(--oo-radius-sm);- font-size: 12px;- font-weight: 500;- border: 1px solid var(--oo-border);- background: var(--oo-group-bg);- color: var(--oo-text);- cursor: pointer;+ .list-row {+ content-visibility: auto;+ contain-intrinsic-size: 0 54px;+ contain: layout paint style;}- .hm-dialog-btn.danger {- background: var(--error, #e53935);- color: var(--on-error, #ffffff);- border-color: var(--error, #e53935);+ .hm-sentinel {+ height: 1px;+ width: 100%;+ pointer-events: none;+ opacity: 0;}</style>diff --git a/src/components/nami/ProfileManager.svelte b/src/components/nami/ProfileManager.svelteindex baaa2ba1..abda26a0 100644--- a/src/components/nami/ProfileManager.svelte+++ b/src/components/nami/ProfileManager.svelte@@ -8,7 +8,10 @@pullAllCreators,type Profile,} from '$lib/api/nami';+ import { showToast } from '$lib/stores/toast-store.svelte';import { t } from '$lib/i18n';+ import { getCachedCreator, resolveCreatorMetadata } from '$lib/nami/metadata';+ import { parseProfileUrl } from '$lib/utils/nami_parser';interface Props {onSelectProfileForDownload?: (url: string) => void;@@ -28,13 +31,33 @@let newUrl = $state('');let loading = $state(false);let error = $state('');- let confirmDeleteUrl = $state<string | null>(null);let syncingProfileUrl = $state<string | null>(null);let syncingAll = $state(false);let syncFeedback = $state<string | null>(null);+ let profileAvatars = $state<Record<string, string>>({});+ let failedAvatars = $state<Record<string, boolean>>({});let requestId = 0;- let dialogEl: HTMLDialogElement | null = $state(null);++ function warmProfilesAvatars(list: Profile[]) {+ list.forEach(async (profile) => {+ const target = profile.username || profile.url;+ const cached = getCachedCreator(profile.platform || activePlatform, target);+ if (cached?.avatar) {+ profileAvatars[profile.url] = cached.avatar;+ } else {+ const parsed = parseProfileUrl(profile.url);+ if (parsed.platform !== 'unknown' && parsed.cleanUrl) {+ try {+ const meta = await resolveCreatorMetadata(parsed);+ if (meta?.avatar) {+ profileAvatars[profile.url] = meta.avatar;+ }+ } catch {}+ }+ }+ });+ }async function loadPlatformProfiles(targetPlatform = activePlatform) {const thisRequest = ++requestId;@@ -44,6 +67,7 @@const result = await loadProfiles(targetPlatform);if (thisRequest !== requestId) return;profiles = result;+ warmProfilesAvatars(result);} catch (err) {if (thisRequest !== requestId) return;error = $t('nami.failed_to_load_profiles') as string;@@ -71,47 +95,31 @@try {await saveProfile(activePlatform, trimmedUrl);newUrl = '';+ showToast('success', 'Profile added successfully');await loadPlatformProfiles();} catch (err) {error = errorMessage(err, $t('nami.failed_to_add_profile') as string);+ showToast('error', error);console.error(err);}}- function promptDelete(url: string) {- confirmDeleteUrl = url;- dialogEl?.showModal();- }-- function cancelDelete() {- confirmDeleteUrl = null;- dialogEl?.close();- }-- async function confirmDelete() {- const url = confirmDeleteUrl;- cancelDelete();- if (!url) return;+ async function removeProfile(url: string) {try {await deleteProfile(activePlatform, url);+ showToast('info', 'Profile deleted');await loadPlatformProfiles();} catch (err) {error = errorMessage(err, $t('nami.failed_to_delete_profile') as string);+ showToast('error', error);console.error('Failed to delete profile:', err);}}- function initials(profile: Profile): string {- const source = (profile.username || profile.url || '?')- .replace(/^https?:\/\//, '')- .replace(/^www\./, '');- return source.charAt(0).toUpperCase() || '?';- }-function formatSynced(timestamp?: number | null): string {- if (!timestamp) return '';+ if (!timestamp) return 'Never downloaded';const d = new Date(timestamp * 1000);- return d.toLocaleDateString(undefined, { month: 'short', day: 'numeric' });+ return `Downloaded ${d.toLocaleDateString(undefined, { month: 'short', day: 'numeric' })}`;}async function handlePull(profile: Profile) {@@ -121,16 +129,16 @@try {const res = await pullCreator(profile.url, activePlatform);if (res.success) {- syncFeedback = $t('nami.pull_success', {- name: profile.username || profile.url,- count: res.files_downloaded,- }) as string;+ syncFeedback = `Downloaded ${res.files_downloaded} new files from ${profile.username || profile.url}`;+ showToast('success', syncFeedback);await loadPlatformProfiles();} else {- error = res.message || 'Sync failed';+ error = res.message || 'Download failed';+ showToast('error', error);}} catch (err) {- error = errorMessage(err, 'Failed to sync profile');+ error = errorMessage(err, 'Failed to download profile');+ showToast('error', error);} finally {syncingProfileUrl = null;}@@ -143,13 +151,12 @@error = '';try {const summary = await pullAllCreators(activePlatform);- syncFeedback = $t('nami.pull_all_success', {- total: summary.succeeded,- count: summary.total_downloaded,- }) as string;+ syncFeedback = `Batch download complete: ${summary.total_downloaded} files downloaded across ${summary.succeeded} creators`;+ showToast('success', syncFeedback);await loadPlatformProfiles();} catch (err) {- error = errorMessage(err, 'Failed to sync all creators');+ error = errorMessage(err, 'Failed to download all creators');+ showToast('error', error);} finally {syncingAll = false;}@@ -165,14 +172,16 @@});</script>-<div class="pm">- <div class="pm-segmented" role="tablist" aria-label={$t('nami.platform_aria')}>+<div class="pm-page">+ <!-- Platform Selector -->+ <div class="segmented segmented-lg" role="tablist">{#each platforms as platform (platform.key)}<buttontype="button"role="tab"aria-selected={activePlatform === platform.key}- class:on={activePlatform === platform.key}+ class="segmented-btn"+ class:active={activePlatform === platform.key}onclick={() => switchPlatform(platform.key)}>{platform.label}@@ -180,514 +189,241 @@{/each}</div>+ <!-- Add Profile Row -->+ <div class="surface-card pm-add-card">+ <input+ class="input input-lg"+ type="text"+ bind:value={newUrl}+ placeholder="Add creator profile URL or @username..."+ onkeydown={(e) => e.key === 'Enter' && addProfile()}+ autocomplete="off"+ spellcheck="false"+ />+ <button+ type="button"+ class="btn btn-lg btn-primary"+ onclick={addProfile}+ disabled={!newUrl.trim() || loading}+ >+ Add Profile+ </button>+ </div>++ <!-- Sync Feedback or Alert -->{#if error}- <div class="pm-alert" role="alert">{error}</div>+ <div class="notice notice-danger" role="alert">+ <span>{error}</span>+ </div>{/if}{#if syncFeedback}- <div class="pm-alert info" role="status">+ <div class="notice notice-success" role="status"><span>{syncFeedback}</span>- <button type="button" class="pm-alert-dismiss" onclick={() => (syncFeedback = null)}>×</button>+ <button type="button" class="btn btn-sm btn-ghost" onclick={() => (syncFeedback = null)}>×</button></div>{/if}- <div class="pm-group">- <div class="pm-row">- <svg class="pm-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" aria-hidden="true">- <path d="M5.5 10.5c-.8.8-2.2.8-3 0-.8-.8-.8-2.2 0-3L4 6" />- <path d="M10.5 5.5c.8-.8 2.2-.8 3 0 .8.8.8 2.2 0 3L12 10" />- <path d="M6.3 9.7 9.7 6.3" />- </svg>- <input- id="profile-url"- type="text"- bind:value={newUrl}- placeholder={$t('nami.profile_placeholder')}- onkeydown={(e) => e.key === 'Enter' && addProfile()}- autocomplete="off"- spellcheck="false"- aria-label={$t('nami.profile_url_aria')}- />- <button type="button" class="pm-add-btn" onclick={addProfile} disabled={!newUrl.trim() || loading}>- {$t('nami.add')}- </button>+ <!-- Header Bar -->+ <div class="pm-section-head">+ <div class="pm-count-badge">+ <span class="section-header-title">{activePlatform.toUpperCase()} PROFILES</span>+ <span class="badge badge-neutral">{profiles.length}</span></div>++ <button+ type="button"+ class="btn btn-sm btn-secondary"+ onclick={handlePullAll}+ disabled={profiles.length === 0 || syncingAll}+ >+ <svg+ viewBox="0 0 16 16"+ width="13"+ height="13"+ fill="none"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ stroke-linejoin="round"+ class:spin={syncingAll}+ >+ <path d="M8 1.5v8.5M4.5 6.5l3.5 3.5 3.5-3.5M2 13.5h12" />+ </svg>+ <span>{syncingAll ? 'Downloading...' : 'Download All'}</span>+ </button></div>+ <!-- Profiles List -->{#if loading}- <p class="pm-empty">{$t('nami.loading_profiles')}</p>+ <div class="empty-state">+ <div class="spinner"></div>+ <p class="empty-state-hint">Loading profiles...</p>+ </div>{:else if profiles.length === 0}- <p class="pm-empty">{$t('nami.no_profiles_yet')}</p>- {:else}- <div class="pm-header-actions">- <span class="pm-count">{profiles.length} {profiles.length === 1 ? 'profile' : 'profiles'}</span>- <button- type="button"- class="pm-sync-all-btn"- onclick={handlePullAll}- disabled={syncingAll}- >- <svg- class="pm-btn-icon"- class:spin={syncingAll}- viewBox="0 0 16 16"- fill="none"- stroke="currentColor"- stroke-width="1.4"- stroke-linecap="round"- stroke-linejoin="round"- aria-hidden="true"- >- <path d="M1.5 8a6.5 6.5 0 0 1 11.1-4.6L14 5" />- <path d="M14 2v3h-3" />- <path d="M14.5 8a6.5 6.5 0 0 1-11.1 4.6L2 11" />- <path d="M2 14v-3h3" />- </svg>- <span>{syncingAll ? $t('nami.syncing_creator') : $t('nami.sync_all_creators')}</span>- </button>+ <div class="empty-state surface-card">+ <p class="empty-state-title">No profiles added for {activePlatform}</p>+ <p class="empty-state-hint">Paste a username or profile URL above to track and download creator media.</p></div>-- <div class="pm-group">+ {:else}+ <div class="surface-card">{#each profiles as profile (profile.url)}- <div class="pm-row pm-profile-row">- <div class="pm-avatar" aria-hidden="true">{initials(profile)}</div>- <div class="pm-info">- <p class="pm-name">- {profile.username || profile.url}- {#if profile.last_pulled_at}- <span class="pm-synced">• {formatSynced(profile.last_pulled_at)}</span>- {/if}- </p>- {#if profile.username}- <p class="pm-url">{profile.url}</p>- {/if}- </div>- <div class="pm-actions">+ {@const avatarSrc = profileAvatars[profile.url] || getCachedCreator(profile.platform || activePlatform, profile.username || profile.url)?.avatar}+ <div+ class="list-row interactive"+ role="button"+ tabindex="0"+ onclick={() => onSelectProfileForDownload?.(profile.url)}+ onkeydown={(e) => {+ if (e.key === 'Enter') onSelectProfileForDownload?.(profile.url);+ }}+ >+ {#if avatarSrc && !failedAvatars[profile.url]}+ <img+ src={avatarSrc}+ alt={profile.username || profile.platform}+ class="pm-avatar-thumb"+ referrerpolicy="no-referrer"+ onerror={() => {+ failedAvatars[profile.url] = true;+ delete profileAvatars[profile.url];+ }}+ />+ {:else}+ <div class="pm-initials-badge" data-platform={activePlatform}>+ <span>{(profile.username || profile.platform || '?').slice(0, 2).toUpperCase()}</span>+ </div>+ {/if}++ <span class="list-row-content">+ <span class="list-row-title">{profile.username || profile.url}</span>+ <span class="list-row-sub">{profile.url} • {formatSynced(profile.last_pulled_at)}</span>+ </span>++ <span class="list-row-trailing"><buttontype="button"- class="pm-sync-btn"- onclick={() => handlePull(profile)}+ class="btn btn-sm btn-primary"+ onclick={(e) => {+ e.stopPropagation();+ handlePull(profile);+ }}disabled={syncingProfileUrl === profile.url}- aria-label={$t('nami.sync_creator')}- title={$t('nami.sync_creator')}+ title="Download creator updates"><svg- class="pm-btn-icon"- class:spin={syncingProfileUrl === profile.url}viewBox="0 0 16 16"+ width="12"+ height="12"fill="none"stroke="currentColor"- stroke-width="1.4"- stroke-linecap="round"- stroke-linejoin="round"- aria-hidden="true"+ stroke-width="1.5"+ class:spin={syncingProfileUrl === profile.url}>- <path d="M1.5 8a6.5 6.5 0 0 1 11.1-4.6L14 5" />- <path d="M14 2v3h-3" />- <path d="M14.5 8a6.5 6.5 0 0 1-11.1 4.6L2 11" />- <path d="M2 14v-3h3" />+ <path d="M8 1.5v8.5M4.5 6.5l3.5 3.5 3.5-3.5M2 13.5h12" /></svg>- <span>{syncingProfileUrl === profile.url ? $t('nami.syncing_creator') : $t('nami.sync_creator')}</span>+ <span>{syncingProfileUrl === profile.url ? 'Downloading...' : 'Download'}</span></button>- {#if onSelectProfileForDownload}- <button- type="button"- class="pm-download-btn"- onclick={() => onSelectProfileForDownload?.(profile.url)}- aria-label={$t('nami.download_with', { name: profile.username || profile.url })}- >- {$t('nami.download')}- </button>- {/if}+<buttontype="button"- class="pm-remove"- onclick={() => promptDelete(profile.url)}- aria-label={$t('nami.remove_profile_aria', { name: profile.username || profile.url })}+ class="btn btn-sm btn-ghost"+ title="Remove Profile"+ onclick={(e) => {+ e.stopPropagation();+ removeProfile(profile.url);+ }}>- {$t('nami.remove')}+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">+ <polyline points="3 6 5 6 21 6" />+ <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />+ </svg></button>- </div>+ </span></div>{/each}</div>{/if}</div>-<dialog bind:this={dialogEl} class="pm-dialog" onclose={() => (confirmDeleteUrl = null)}>- <div class="pm-dialog-content">- <p class="pm-dialog-title" id="pm-confirm-title">{$t('nami.delete_profile_title')}</p>- <p class="pm-dialog-url">{confirmDeleteUrl}</p>- <div class="pm-dialog-actions">- <button type="button" class="pm-dialog-btn" onclick={cancelDelete}>{$t('common.cancel')}</button>- <button type="button" class="pm-dialog-btn danger" onclick={confirmDelete}>{$t('nami.delete')}</button>- </div>- </div>-</dialog>-<style>- .pm {+ .pm-page {display: flex;flex-direction: column;- gap: 14px;+ gap: var(--space-4);+ width: 100%;}- .pm-segmented {+ .pm-add-card {display: flex;- background: color-mix(in srgb, var(--oo-text) 6%, transparent);- border-radius: var(--oo-radius, 9px);- padding: 2px;- gap: 1px;+ gap: var(--space-2);+ padding: var(--space-2);}- .pm-segmented button {+ .pm-add-card .input {flex: 1;- min-height: 38px;- padding: 7px 8px;- font-size: 12px;- font-weight: 500;- color: var(--oo-text-secondary);- border-radius: 7px;- background: transparent;- border: none;- cursor: pointer;- transition: background 150ms ease, color 150ms ease;- }-- .pm-segmented button.on {- background: var(--oo-group-bg);- color: var(--oo-text);- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);- }-- .pm-alert {- padding: 9px 12px;- background: var(--error);- color: var(--on-error);- border-radius: var(--oo-radius, 9px);- font-size: 12.5px;- }-- .pm-group {- background: var(--oo-group-bg);- border-radius: var(--oo-radius, 9px);- border: 1px solid var(--oo-border);- overflow: hidden;}- .pm-row {+ .pm-section-head {display: flex;align-items: center;- gap: 9px;- min-height: 48px;- padding: 10px 14px;- border-bottom: 1px solid var(--oo-border);- }-- .pm-row:last-child {- border-bottom: 0;- }-- .pm-icon {- width: 15px;- height: 15px;- color: var(--oo-text-secondary);- flex-shrink: 0;- }-- .pm-row input {- flex: 1;- border: 0;- background: transparent;- color: var(--oo-text);- font-size: 13px;- min-width: 0;- }-- .pm-row input:focus {- outline: none;- }-- .pm-add-btn {- min-height: 34px;- padding: 6px 15px;- border-radius: var(--oo-radius-sm);- background: var(--oo-accent);- color: var(--on-accent);- border: none;- font-size: 12px;- font-weight: 500;- cursor: pointer;- }-- .pm-add-btn:disabled {- opacity: 0.5;- cursor: not-allowed;- }-- .pm-profile-row {- gap: 10px;- }-- .pm-avatar {- width: 28px;- height: 28px;- border-radius: 50%;- background: var(--oo-accent);- color: var(--on-accent);- display: flex;- align-items: center;- justify-content: center;- font-size: 11px;- font-weight: 600;- flex-shrink: 0;- }-- .pm-info {- min-width: 0;- flex: 1;- }-- .pm-name {- font-size: 13px;- font-weight: 500;- color: var(--oo-text);- margin: 0;- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;- }-- .pm-url {- font-size: 11px;- color: var(--oo-text-secondary);- margin: 2px 0 0;- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;+ justify-content: space-between;+ padding: 0 var(--space-1);}- .pm-actions {+ .pm-count-badge {display: flex;align-items: center;- gap: 6px;- }-- .pm-sync-btn {- min-height: 30px;- padding: 4px 10px;- font-size: 11.5px;- font-weight: 500;- color: var(--oo-text);- background: color-mix(in srgb, var(--oo-text) 8%, transparent);- border: none;- border-radius: 6px;- cursor: pointer;- display: inline-flex;- align-items: center;- gap: 5px;- transition: background 150ms ease;- }-- .pm-sync-btn:hover:not(:disabled) {- background: color-mix(in srgb, var(--oo-text) 14%, transparent);- }-- .pm-sync-btn:disabled {- opacity: 0.6;- cursor: not-allowed;- }-- .pm-sync-all-btn {- min-height: 30px;- padding: 4px 12px;- font-size: 11.5px;- font-weight: 500;- color: var(--oo-text);- background: var(--oo-group-bg);- border: 1px solid var(--oo-border);- border-radius: var(--oo-radius-sm, 7px);- cursor: pointer;- display: inline-flex;- align-items: center;- gap: 6px;- transition: background 150ms ease;+ gap: var(--space-2);}- .pm-sync-all-btn:hover:not(:disabled) {- background: color-mix(in srgb, var(--oo-text) 6%, var(--oo-group-bg));- }-- .pm-sync-all-btn:disabled {- opacity: 0.6;- cursor: not-allowed;- }-- .pm-btn-icon {- width: 13px;- height: 13px;- }-- .pm-btn-icon.spin {- animation: pm-spin 1s linear infinite;- }-- @keyframes pm-spin {- from {- transform: rotate(0deg);- }- to {- transform: rotate(360deg);- }- }-- .pm-synced {- font-size: 10.5px;- color: var(--oo-text-secondary);- margin-left: 6px;- font-weight: normal;+ .pm-avatar-thumb {+ width: 34px;+ height: 34px;+ border-radius: var(--radius-sm);+ object-fit: cover;+ flex-shrink: 0;}- .pm-header-actions {+ .pm-initials-badge {+ width: 34px;+ height: 34px;+ border-radius: var(--radius-sm);display: flex;align-items: center;- justify-content: space-between;- padding: 0 2px;- }-- .pm-count {+ justify-content: center;font-size: 12px;- color: var(--oo-text-secondary);- }-- .pm-alert.info {- background: color-mix(in srgb, var(--oo-accent) 15%, var(--oo-group-bg));- border: 1px solid var(--oo-accent);- color: var(--oo-text);- padding: 8px 12px;- border-radius: var(--oo-radius, 9px);- font-size: 12.5px;- display: flex;- justify-content: space-between;- align-items: center;- }-- .pm-alert-dismiss {- background: transparent;- border: none;- font-size: 15px;- cursor: pointer;- color: inherit;- padding: 0 4px;- }-- .pm-download-btn {- min-height: 30px;- padding: 4px 10px;- font-size: 11.5px;- font-weight: 500;- color: var(--oo-accent);- background: color-mix(in srgb, var(--oo-accent) 10%, transparent);- border: none;- border-radius: 6px;- cursor: pointer;- transition: background 150ms ease;- }-- .pm-download-btn:hover {- background: color-mix(in srgb, var(--oo-accent) 18%, transparent);- }-- .pm-remove {- min-height: 30px;- padding: 4px 8px;- font-size: 11.5px;- font-weight: 500;- color: var(--error);- background: transparent;- border: none;- cursor: pointer;+ font-weight: 700;+ color: var(--on-accent);+ background: var(--accent);flex-shrink: 0;}- .pm-remove:hover {- opacity: 0.75;+ .pm-initials-badge[data-platform="instagram"] {+ background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);+ color: #ffffff;}- .pm-empty {- text-align: center;- color: var(--oo-text-secondary);- padding: 18px 0;- font-size: 12.5px;+ .pm-initials-badge[data-platform="tiktok"] {+ background: #010101;+ color: #00f2fe;}- .pm-dialog {- background: var(--popup-bg, #252528);- color: var(--text, #fff);- border: 1px solid var(--oo-border);- border-radius: 12px;- padding: 20px;- max-width: 340px;- width: 90%;- text-align: center;- box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);+ .pm-initials-badge[data-platform="x"] {+ background: #000000;+ color: #ffffff;}- .pm-dialog::backdrop {- background: var(--dialog-backdrop, rgba(0, 0, 0, 0.5));+ .pm-initials-badge[data-platform="facebook"] {+ background: #1877f2;+ color: #ffffff;}- .pm-dialog-title {- font-size: 14px;- font-weight: 600;- color: var(--oo-text);- margin: 0 0 6px;+ .spin {+ animation: spin 1s linear infinite;}- .pm-dialog-url {- font-size: 12px;- color: var(--oo-text-secondary);- overflow-wrap: anywhere;- margin: 0 0 16px;- }-- .pm-dialog-actions {- display: flex;- gap: 8px;- justify-content: center;- }-- .pm-dialog-btn {- flex: 1;- min-height: 38px;- padding: 8px 10px;- border-radius: 7px;- font-weight: 500;- font-size: 12.5px;- background: color-mix(in srgb, var(--oo-text) 8%, transparent);- color: var(--oo-text);- border: none;- cursor: pointer;- }-- .pm-dialog-btn.danger {- background: var(--error);- color: var(--on-error);- }-- .pm-dialog-btn.danger:hover {- opacity: 0.9;- }-- @media (max-width: 440px) {- .pm-segmented {- flex-wrap: wrap;- }- .pm-segmented button {- flex: 1 1 42%;- }- .pm-row {- padding-inline: 12px;- }+ @keyframes spin {+ to { transform: rotate(360deg); }}</style>diff --git a/src/components/nami/SettingsManager.svelte b/src/components/nami/SettingsManager.svelteindex c3bb7c5d..5d8ba7eb 100644--- a/src/components/nami/SettingsManager.svelte+++ b/src/components/nami/SettingsManager.svelte@@ -8,6 +8,7 @@saveSettings,} from '$lib/stores/nami_settings_store.svelte';import { detectBrowsers, extractBrowserCookies, type DetectedBrowser } from '$lib/api/nami';+ import { showToast } from '$lib/stores/toast-store.svelte';import { onMount } from 'svelte';import { t } from '$lib/i18n';@@ -17,12 +18,6 @@let detectedBrowsers = $state<DetectedBrowser[]>([]);let saving = $state(false);let testingBridge = $state(false);- let saveStatus = $state('');- let saveStatusType = $state<'success' | 'error'>('success');- let bridgeStatus = $state('');- let bridgeStatusType = $state<'success' | 'error'>('success');- let statusTimer: ReturnType<typeof setTimeout> | null = null;- let bridgeTimer: ReturnType<typeof setTimeout> | null = null;let isDirty = $derived(outputDir.trim() !== getOutputDir().trim() ||@@ -48,9 +43,11 @@const selected = await open({directory: true,multiple: false,- title: $t('nami.select_output_dir_title'),+ title: 'Select Nami Output Directory',});- if (selected && typeof selected === 'string') outputDir = selected;+ if (selected && typeof selected === 'string') {+ outputDir = selected;+ }} catch (err) {console.error('Failed to open directory dialog:', err);}@@ -61,9 +58,15 @@const selected = await open({directory: false,multiple: false,- title: $t('nami.select_cookies_title'),+ title: 'Select Netscape Cookies File',+ filters: [+ { name: 'Netscape Cookies (*.txt, *.cookies)', extensions: ['txt', 'cookies'] },+ { name: 'All Files (*.*)', extensions: ['*'] },+ ],});- if (selected && typeof selected === 'string') cookiesFile = selected;+ if (selected && typeof selected === 'string') {+ cookiesFile = selected;+ }} catch (err) {console.error('Failed to open file dialog:', err);}@@ -75,23 +78,12 @@async function handleTestBridge() {testingBridge = true;- bridgeStatus = '';- if (bridgeTimer) {- clearTimeout(bridgeTimer);- bridgeTimer = null;- }try {const result = await extractBrowserCookies(browserCookies, 'instagram');- bridgeStatus = result || 'Bridge verified successfully';- bridgeStatusType = 'success';- bridgeTimer = setTimeout(() => {- bridgeStatus = '';- bridgeTimer = null;- }, 5000);- } catch (err) {- console.error('Failed to test cookie bridge:', err);- bridgeStatus = typeof err === 'string' ? err : 'Bridge test failed';- bridgeStatusType = 'error';+ showToast('success', result || 'Browser bridge connected successfully');+ } catch (err: unknown) {+ const msg = typeof err === 'string' ? err : err instanceof Error ? err.message : 'Bridge test failed';+ showToast('error', msg);} finally {testingBridge = false;}@@ -99,329 +91,176 @@async function handleSave() {saving = true;- saveStatus = '';- if (statusTimer) {- clearTimeout(statusTimer);- statusTimer = null;- }try {await saveSettings(outputDir, cookiesFile, browserCookies);outputDir = getOutputDir();cookiesFile = getCookiesFile();browserCookies = getBrowserCookies();- saveStatus = 'nami.settings_saved';- saveStatusType = 'success';- statusTimer = setTimeout(() => {- if (saveStatus === 'nami.settings_saved') saveStatus = '';- statusTimer = null;- }, 2500);+ showToast('success', 'Nami settings saved successfully');} catch (error) {console.error('Failed to save settings:', error);- saveStatus = 'nami.failed_to_save_settings';- saveStatusType = 'error';+ showToast('error', 'Failed to save settings');} finally {saving = false;}}</script>-<div class="sm">- {#if saveStatus}- <div- class="sm-alert"- class:success={saveStatusType === 'success'}- class:error={saveStatusType === 'error'}- role="status"- aria-live="polite"- >- <span>{$t(saveStatus)}</span>- </div>- {/if}-- {#if bridgeStatus}- <div- class="sm-alert"- class:success={bridgeStatusType === 'success'}- class:error={bridgeStatusType === 'error'}- role="status"- aria-live="polite"- >- <span>{bridgeStatus}</span>- </div>- {/if}+<div class="sm-page">+ <div class="section-header">+ <span class="section-header-title">STORAGE & DESTINATION</span>+ </div>- <div class="sm-group">+ <div class="surface-card sm-group"><div class="sm-row">- <svg class="sm-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round" aria-hidden="true">- <path d="M2 4.6a1 1 0 0 1 1-1h2.6l1.1 1.4H13a1 1 0 0 1 1 1V12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1z" />- </svg>- <span class="sm-label">{$t('nami.output_label')}</span>- <input- id="output-dir"- aria-label={$t('nami.output_dir_aria')}- type="text"- bind:value={outputDir}- placeholder={$t('nami.choose_folder_placeholder')}- autocomplete="off"- spellcheck="false"- />- <button type="button" class="sm-choose-btn" onclick={browseOutputDir}>{$t('nami.choose')}</button>+ <div class="sm-label-col">+ <span class="sm-title">Output Directory</span>+ <span class="sm-desc">Destination directory for all saved media and archives.</span>+ </div>+ <div class="sm-action-col">+ <span class="sm-path-text" title={outputDir || 'Not configured'}>+ {outputDir || 'Not configured'}+ </span>+ <button type="button" class="btn btn-secondary" onclick={browseOutputDir}>+ Browse...+ </button>+ </div></div>+ </div>+ <div class="section-header" style="margin-top: var(--space-4);">+ <span class="section-header-title">AUTOMATIC BROWSER COOKIE BRIDGE</span>+ </div>++ <div class="surface-card sm-group"><div class="sm-row">- <svg class="sm-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round" aria-hidden="true">- <circle cx="8" cy="8" r="6.2" />- <path d="M1.8 8h12.4M8 1.8c2 2 3.1 4.1 3.1 6.2s-1.1 4.2-3.1 6.2c-2-2-3.1-4.1-3.1-6.2S6 3.8 8 1.8z" />- </svg>- <span class="sm-label">{$t('nami.browser_cookies_label')}</span>- <select- id="browser-cookies"- aria-label={$t('nami.browser_cookies_aria')}- bind:value={browserCookies}- class="sm-select"- >- <option value="auto">{$t('nami.browser_cookies_auto')}</option>- {#each detectedBrowsers as b}- <option value={b.id}>- {b.name} {b.available ? '✓' : ''} {b.is_default ? '(Default)' : ''}- </option>- {/each}- <option value="custom">{$t('nami.browser_cookies_manual')}</option>- <option value="none">{$t('nami.browser_cookies_disabled')}</option>- </select>- {#if browserCookies !== 'none' && browserCookies !== 'custom'}+ <div class="sm-label-col">+ <span class="sm-title">Browser Session Bridge</span>+ <span class="sm-desc">Automatically reads session credentials to download private posts, stories, and highlights without manual file exports.</span>+ </div>+ <div class="sm-action-col">+ <select bind:value={browserCookies} class="sm-select">+ <option value="auto">System Default (Automatic)</option>+ {#each detectedBrowsers as browser (browser.id)}+ <option value={browser.id}>+ {browser.name} {browser.is_default ? '(Default)' : ''}+ </option>+ {/each}+ <option value="none">Disabled (No Browser Cookies)</option>+ </select>+<buttontype="button"- class="sm-test-btn"+ class="btn btn-secondary"onclick={handleTestBridge}- disabled={testingBridge}+ disabled={testingBridge || browserCookies === 'none'}+ title="Verify session cookies can be reached">- {testingBridge ? $t('nami.testing_cookies') : $t('nami.test_extract_cookies')}+ {testingBridge ? 'Testing...' : 'Test Bridge'}</button>- {/if}+ </div></div>- {#if browserCookies === 'custom' || (cookiesFile && browserCookies !== 'none')}- <div class="sm-row">- <svg class="sm-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round" aria-hidden="true">- <path d="M4.3 2h4.4L12 5.3V13a.7.7 0 0 1-.7.7H4.3a.7.7 0 0 1-.7-.7V2.7A.7.7 0 0 1 4.3 2Z" />- <path d="M8.7 2v3.3H12" />- </svg>- <span class="sm-label">{$t('nami.cookies_label')}</span>- <input- id="cookies-file"- aria-label={$t('nami.cookies_file_aria')}- type="text"- bind:value={cookiesFile}- placeholder={$t('nami.choose_cookies_placeholder')}- autocomplete="off"- spellcheck="false"- />+ <div class="sm-row">+ <div class="sm-label-col">+ <span class="sm-title">Manual Cookie Jar (Optional)</span>+ <span class="sm-desc">Use a Netscape cookies.txt file instead of the automatic browser bridge.</span>+ </div>+ <div class="sm-action-col">{#if cookiesFile}- <button type="button" class="sm-clear-btn" onclick={clearCookies} title={$t('nami.clear_cookies_file')}>×</button>+ <span class="sm-path-text" title={cookiesFile}>{cookiesFile}</span>+ <button type="button" class="btn btn-ghost" onclick={clearCookies}>Clear</button>{/if}- <button type="button" class="sm-choose-btn" onclick={browseCookiesFile}>{$t('nami.choose')}</button>+ <button type="button" class="btn btn-secondary" onclick={browseCookiesFile}>+ {cookiesFile ? 'Change...' : 'Select File...'}+ </button></div>- {/if}+ </div></div>- <p class="sm-hint">{$t('nami.cookies_bridge_hint')}</p>-- <div class="sm-actions">+ <!-- Save Button -->+ <div class="sm-save-row"><buttontype="button"- class="sm-save-btn"+ class="btn btn-lg btn-primary"onclick={handleSave}disabled={saving || !isDirty}>- {saving ? $t('nami.saving') : $t('nami.save_settings')}+ {saving ? 'Saving...' : 'Save Settings'}</button></div></div><style>- .sm {+ .sm-page {display: flex;flex-direction: column;- gap: 14px;- }-- .sm-alert {- padding: 9px 12px;- border-radius: var(--oo-radius, 9px);- font-size: 12.5px;- text-align: center;- }-- .sm-alert.success {- background: var(--success);- color: var(--on-success);- }-- .sm-alert.error {- background: var(--error);- color: var(--on-error);+ gap: var(--space-2);+ width: 100%;}.sm-group {- background: var(--oo-group-bg);- border-radius: var(--oo-radius, 9px);- border: 1px solid var(--oo-border);- overflow: hidden;+ display: flex;+ flex-direction: column;}.sm-row {display: flex;align-items: center;- gap: 9px;- min-height: 48px;- padding: 10px 14px;- border-bottom: 1px solid var(--oo-border);+ justify-content: space-between;+ gap: var(--space-4);+ padding: var(--space-4);+ border-bottom: var(--hairline) solid var(--separator);}.sm-row:last-child {- border-bottom: 0;- }-- .sm-icon {- width: 15px;- height: 15px;- color: var(--oo-text-secondary);- flex-shrink: 0;+ border-bottom: none;}- .sm-label {- font-size: 13px;- color: var(--oo-text);- flex-shrink: 0;- }-- .sm-row input {+ .sm-label-col {+ display: flex;+ flex-direction: column;+ gap: 3px;flex: 1;- border: 0;- background: transparent;- color: var(--oo-text);- font-size: 12.5px;min-width: 0;- text-align: right;- }-- .sm-row input::placeholder {- color: var(--oo-text-secondary);- opacity: 0.8;- }-- .sm-row input:focus-visible {- outline: none;}- .sm-select {- flex: 1;- border: 1px solid var(--oo-border);- background: var(--oo-card-bg, var(--oo-group-bg));- color: var(--oo-text);- font-size: 12.5px;- border-radius: 6px;- padding: 5px 8px;- min-width: 0;- cursor: pointer;+ .sm-title {+ font-size: var(--text-base);+ font-weight: 500;+ color: var(--text);}- .sm-select:focus-visible {- outline: 2px solid var(--oo-accent);- outline-offset: 1px;+ .sm-desc {+ font-size: var(--text-sm);+ color: var(--text-dim);+ line-height: 1.4;}- .sm-clear-btn {- background: transparent;- border: none;- color: var(--oo-text-secondary);- font-size: 18px;- line-height: 1;- cursor: pointer;- padding: 0 4px;+ .sm-action-col {display: flex;align-items: center;- }-- .sm-clear-btn:hover {- color: var(--error);- }-- .sm-choose-btn,- .sm-test-btn {- min-height: 34px;- padding: 6px 12px;- border-radius: 6px;- font-size: 12px;- font-weight: 500;- background: var(--oo-group-bg);- border: 1px solid var(--oo-border);- color: var(--oo-text);+ gap: var(--space-2);flex-shrink: 0;- cursor: pointer;- transition: background 150ms ease, border-color 150ms ease;- }-- .sm-choose-btn:hover,- .sm-test-btn:hover:not(:disabled) {- background: color-mix(in srgb, var(--oo-text) 5%, var(--oo-group-bg));- border-color: var(--oo-accent);}- .sm-test-btn:disabled {- opacity: 0.6;- cursor: not-allowed;+ .sm-path-text {+ max-width: 200px;+ font-size: var(--text-sm);+ color: var(--text-muted);+ font-family: var(--font-mono);+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;}- .sm-hint {- font-size: 11.5px;- color: var(--oo-text-secondary);- margin: -6px 0 0;- line-height: 1.4;+ .sm-select {+ min-width: 190px;}- .sm-actions {+ .sm-save-row {display: flex;- justify-content: center;- }-- .sm-save-btn {- min-height: 42px;- padding: 9px 26px;- border-radius: var(--oo-radius, 9px);- font-weight: 600;- font-size: 13px;- background: var(--oo-accent);- color: var(--on-accent);- border: none;- cursor: pointer;- transition: filter 150ms ease, opacity 150ms ease;- }-- .sm-save-btn:hover:not(:disabled) {- filter: brightness(1.06);- }-- .sm-save-btn:disabled {- opacity: 0.5;- cursor: not-allowed;- }-- @media (max-width: 500px) {- .sm-row {- align-items: flex-start;- flex-wrap: wrap;- }- .sm-row input,- .sm-select {- order: 3;- flex-basis: calc(100% - 24px);- text-align: left;- }- .sm-choose-btn,- .sm-test-btn {- margin-left: auto;- }+ justify-content: flex-end;+ margin-top: var(--space-4);}</style>diff --git a/src/components/settings/DependencyRow.svelte b/src/components/settings/DependencyRow.svelteindex 4cc0b5dd..768932ed 100644--- a/src/components/settings/DependencyRow.svelte+++ b/src/components/settings/DependencyRow.svelte@@ -144,8 +144,7 @@}});- // #222: as tres, e nao so o PDFium.- let supportsCustomFile = $derived(["yt-dlp", "FFmpeg", "PDFium"].includes(name));+ let supportsCustomFile = $derived(["yt-dlp", "FFmpeg", "PDFium", "gallery-dl"].includes(name));let customPath = $state<string | null>(null);diff --git a/src/components/settings/SettingsBrowserExtension.svelte b/src/components/settings/SettingsBrowserExtension.svelteindex b07b8559..627eb01f 100644--- a/src/components/settings/SettingsBrowserExtension.svelte+++ b/src/components/settings/SettingsBrowserExtension.svelte@@ -213,6 +213,21 @@{rotating ? $t("settings.bridge.rotating") : $t("settings.bridge.rotate")}</button></div>+ <div class="divider"></div>+ <div class="setting-row">+ <div class="setting-col">+ <span class="setting-label">Official repository</span>+ <span class="setting-hint">Download release zips (v0.4.5), report issues, or inspect source code.</span>+ </div>+ <a+ class="bridge-action"+ href="https://github.com/OpenSelena/libreget-extension"+ target="_blank"+ rel="noreferrer"+ >+ GitHub+ </a>+ </div>{/if}</div></section>@@ -247,6 +262,9 @@border-radius: 8px;font: inherit;cursor: pointer;+ text-decoration: none;+ display: inline-flex;+ align-items: center;}.bridge-action:hover { background: rgba(255, 255, 255, 0.08); }.bridge-action:disabled { opacity: 0.5; cursor: not-allowed; }diff --git a/src/components/settings/SettingsPlugins.svelte b/src/components/settings/SettingsPlugins.svelteindex 3e994577..a348e58d 100644--- a/src/components/settings/SettingsPlugins.svelte+++ b/src/components/settings/SettingsPlugins.svelte@@ -119,6 +119,21 @@{/if}</div>{/each}+ <div class="divider"></div>+ <div class="setting-row">+ <div class="setting-col">+ <span class="setting-label">Official repository</span>+ <span class="setting-path">v0.4.5 releases, source code, and standalone install zips.</span>+ </div>+ <a+ class="button"+ href="https://github.com/OpenSelena/libreget-extension"+ target="_blank"+ rel="noreferrer"+ >+ GitHub+ </a>+ </div></div></section>diff --git a/src/components/shell/AppSidebar.svelte b/src/components/shell/AppSidebar.svelteindex ece0b7cc..e1686eb1 100644--- a/src/components/shell/AppSidebar.svelte+++ b/src/components/shell/AppSidebar.svelte@@ -4,6 +4,7 @@import NavIcon from "$components/shell/NavIcon.svelte";import { getUpdateInfo } from "$lib/stores/update-store.svelte";import type { NavItem } from "$lib/nav-config";+ import { isMac } from "$lib/platform";interface Props {primaryNav?: NavItem[];@@ -11,6 +12,8 @@pluginNav?: NavItem[];badgeLabel?: string;badgeCount?: number;+ collapsed?: boolean;+ onToggleCollapsed?: () => void;}let {@@ -19,9 +22,12 @@pluginNav = [],badgeLabel = "",badgeCount = 0,+ collapsed = false,+ onToggleCollapsed,}: Props = $props();let updateInfo = $derived(getUpdateInfo());+ const shortcutLabel = isMac() ? "⌃⌘S" : "Ctrl+Shift+S";const PLUGINS_KEY = "libreget.sidebar.plugins_expanded";let pluginsExpanded = $state(@@ -45,6 +51,35 @@function itemTitle(item: NavItem): string {return item.label || (item.labelKey ? $t(item.labelKey) : "");}++ let tip = $state<{ text: string; top: number; left: number } | null>(null);+ let tipTimer: ReturnType<typeof setTimeout> | undefined;+ let warmTimer: ReturnType<typeof setTimeout> | undefined;+ let warm = false;++ function showTip(event: MouseEvent | FocusEvent, text: string) {+ if (!collapsed) return;+ const el = event.currentTarget as HTMLElement;+ const place = () => {+ const r = el.getBoundingClientRect();+ tip = { text, top: r.top + r.height / 2, left: r.right + 8 };+ warm = true;+ };+ clearTimeout(tipTimer);+ clearTimeout(warmTimer);+ if (warm || event.type === "focus") place();+ else tipTimer = setTimeout(place, 300);+ }++ function hideTip() {+ clearTimeout(tipTimer);+ tip = null;+ warmTimer = setTimeout(() => (warm = false), 250);+ }++ $effect(() => {+ if (!collapsed) tip = null;+ });</script>{#snippet navLink(item: NavItem)}@@ -54,10 +89,15 @@href={item.href}class="mac-nav-item"class:active- title={title}+ title={collapsed ? undefined : title}+ aria-label={item.badge === "downloads" && badgeCount > 0 ? `${title} (${badgeLabel})` : title}aria-current={active ? "page" : undefined}+ onmouseenter={(e) => showTip(e, title)}+ onmouseleave={hideTip}+ onfocus={(e) => showTip(e, title)}+ onblur={hideTip}>- <NavIcon icon={item.icon} iconSvg={item.iconSvg} size={22} {active} />+ <NavIcon icon={item.icon} iconSvg={item.iconSvg} size={collapsed ? 30 : 26} {active} /><span class="mac-nav-label">{title}</span>{#if item.badge === "downloads" && badgeCount > 0}<span class="mac-nav-badge live">{badgeLabel}</span>@@ -67,7 +107,7 @@</a>{/snippet}-<aside class="mac-source-list" aria-label={$t("nav.section_primary")}>+<aside class="mac-source-list" class:collapsed aria-label={$t("nav.section_primary")}><div class="mac-source-list-drag" data-tauri-drag-region></div><nav class="mac-nav-section" aria-label={$t("nav.section_primary")}>@@ -87,27 +127,165 @@<nav class="mac-nav-section" aria-label={$t("nav.section_plugins")}><div class="mac-nav-section-header"><span>{$t("nav.section_plugins")}</span>- <button- type="button"- class="mac-plugins-toggle"- onclick={togglePlugins}- aria-expanded={pluginsExpanded}- aria-label={pluginsExpanded ? $t("nav.collapse_plugins") : $t("nav.expand_plugins")}- >- <svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- {#if pluginsExpanded}- <path d="M4 6l4 4 4-4" />- {:else}- <path d="M6 4l4 4-4 4" />- {/if}- </svg>- </button>+ {#if !collapsed}+ <button+ type="button"+ class="mac-plugins-toggle"+ onclick={togglePlugins}+ aria-expanded={pluginsExpanded}+ aria-label={pluginsExpanded ? $t("nav.collapse_plugins") : $t("nav.expand_plugins")}+ >+ <svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ {#if pluginsExpanded}+ <path d="M4 6l4 4 4-4" />+ {:else}+ <path d="M6 4l4 4-4 4" />+ {/if}+ </svg>+ </button>+ {/if}</div>- {#if pluginsExpanded}+ {#if collapsed || pluginsExpanded}{#each pluginNav as item (item.href)}{@render navLink(item)}{/each}{/if}</nav>{/if}++ <div class="mac-source-list-footer">+ <button+ type="button"+ class="mac-sidebar-collapse"+ onclick={onToggleCollapsed}+ aria-label={`${$t(collapsed ? "nav.expand_sidebar" : "nav.collapse_sidebar")} ${shortcutLabel}`}+ aria-keyshortcuts={isMac() ? "Control+Meta+S" : "Control+Shift+S"}+ aria-expanded={!collapsed}+ title={$t(collapsed ? "nav.expand_sidebar" : "nav.collapse_sidebar")}+ data-ui-tooltip={$t(collapsed ? "nav.expand_sidebar" : "nav.collapse_sidebar")}+ onmouseenter={(e) => showTip(e, `${collapsed ? $t("nav.expand_sidebar") : $t("nav.collapse_sidebar")} ${shortcutLabel}`)}+ onmouseleave={hideTip}+ onfocus={(e) => showTip(e, `${collapsed ? $t("nav.expand_sidebar") : $t("nav.collapse_sidebar")} ${shortcutLabel}`)}+ onblur={hideTip}+ >+ <svg viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <rect x="2.5" y="3.5" width="15" height="13" rx="3" />+ <path d="M7.5 3.5v13" />+ {#if collapsed}+ <path d="M11 8l2 2-2 2" />+ {:else}+ <path d="M13 8l-2 2 2 2" />+ {/if}+ </svg>+ <span class="mac-sidebar-collapse-label">{$t("nav.collapse_sidebar")}</span>+ <kbd class="mac-sidebar-collapse-kbd" aria-hidden="true">{shortcutLabel}</kbd>+ </button>+ </div></aside>++{#if tip}+ <div class="mac-rail-tip" role="tooltip" style:top="{tip.top}px" style:left="{tip.left}px">{tip.text}</div>+{/if}++<style>+ .mac-source-list-footer {+ margin-top: auto;+ padding-top: var(--space-2);+ }++ .mac-sidebar-collapse {+ display: flex;+ align-items: center;+ gap: 8px;+ height: 32px;+ width: 100%;+ padding: 0 6px 0 8px;+ border: none;+ border-radius: var(--radius-md);+ background: transparent;+ color: var(--text-dim);+ font: inherit;+ font-size: var(--text-sm);+ cursor: pointer;+ flex-shrink: 0;+ overflow: hidden;+ transition: background var(--duration-fast, 120ms) var(--ease-out, ease-out), color var(--duration-fast, 120ms) var(--ease-out, ease-out);+ }++ .mac-sidebar-collapse:hover {+ background: var(--fill-1);+ color: var(--text);+ }++ .mac-sidebar-collapse:focus-visible {+ outline: var(--focus-ring);+ outline-offset: -2px;+ }++ .mac-sidebar-collapse-label {+ flex: 1;+ min-width: 0;+ text-align: start;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ }++ .mac-sidebar-collapse-kbd {+ font: inherit;+ font-size: 10.5px;+ color: var(--text-muted);+ padding: 1px 4px;+ border-radius: var(--radius-xs);+ background: var(--fill-2);+ flex-shrink: 0;+ }++ :global([data-sidebar="collapsed"]) .mac-sidebar-collapse,+ .collapsed .mac-sidebar-collapse {+ justify-content: center;+ padding: 0;+ }++ :global([data-sidebar="collapsed"]) .mac-sidebar-collapse-label,+ .collapsed .mac-sidebar-collapse-label,+ :global([data-sidebar="collapsed"]) .mac-sidebar-collapse-kbd,+ .collapsed .mac-sidebar-collapse-kbd {+ display: none;+ }++ @media (max-width: 860px) {+ .mac-sidebar-collapse {+ justify-content: center;+ padding: 0;+ }++ .mac-sidebar-collapse-label,+ .mac-sidebar-collapse-kbd {+ display: none;+ }+ }++ .mac-rail-tip {+ position: fixed;+ transform: translateY(-50%);+ padding: 4px 9px;+ border-radius: var(--radius-md);+ background: var(--surface);+ color: var(--text);+ font-size: var(--text-xs);+ font-weight: 500;+ white-space: nowrap;+ box-shadow:+ inset 0 0 0 var(--hairline) var(--border-hi),+ 0 6px 18px rgba(var(--shadow-ink), 0.18);+ pointer-events: none;+ z-index: 1000;+ animation: tip-in 140ms var(--ease-out);+ }++ @keyframes tip-in {+ from { opacity: 0; transform: translateY(-50%) translateX(-4px); }+ to { opacity: 1; transform: translateY(-50%) translateX(0); }+ }+</style>diff --git a/src/components/shell/NavIcon.svelte b/src/components/shell/NavIcon.svelteindex 70a04526..a52254b7 100644--- a/src/components/shell/NavIcon.svelte+++ b/src/components/shell/NavIcon.svelte@@ -1,50 +1,57 @@<script lang="ts">/**- * Sidebar icon tile supporting both custom MosCat character illustrations- * and classic macOS System Settings-style gradient tiles for dynamic plugins.+ * LibreGet navigation icon with high-resolution multi-density penguin artwork.*/let {icon,iconSvg,- size = 22,+ size = 26,active = false,}: { icon: string; iconSvg?: string; size?: number; active?: boolean } = $props();- const MOSCAT_ICONS: Record<string, string> = {- home: "/icons/nav/home.svg",- downloads: "/icons/nav/downloads.svg",- tools: "/icons/nav/tools.svg",- nami: "/icons/nav/nami.svg",- marketplace: "/icons/nav/marketplace.svg",- convert: "/icons/nav/convert.svg",- settings: "/icons/nav/settings.svg",- about: "/icons/about-64.png",- courses: "/icons/nav/courses.svg",- telegram: "/icons/telegram-64.png",+ const PENGUIN_ICONS: Record<string, string> = {+ home: "home",+ downloads: "downloads",+ tools: "tools",+ nami: "nami",+ marketplace: "marketplace",+ settings: "settings",+ about: "about",+ convert: "convert",+ courses: "courses",+ telegram: "telegram",};const TILES: Record<string, { glyph: string; from: string; to: string }> = {- home: { glyph: "house", from: "#5AA9FF", to: "#1E6FE8" },- downloads: { glyph: "tray-arrow-down", from: "#FFB340", to: "#F28500" },chat: { glyph: "chats-circle", from: "#4CD964", to: "#2AA845" },- marketplace: { glyph: "storefront", from: "#6E8CFF", to: "#3D5BF0" },- settings: { glyph: "gear-six", from: "#A3A3A8", to: "#6F6F75" },- about: { glyph: "info", from: "#5AA9FF", to: "#1E6FE8" },- courses: { glyph: "graduation-cap", from: "#C77DFF", to: "#8E3FD8" },- telegram: { glyph: "paper-plane-tilt", from: "#55C2FF", to: "#1F8FE0" },- convert: { glyph: "arrows-clockwise", from: "#FF7A7A", to: "#E33A3A" },misc: { glyph: "wrench", from: "#9B9BA3", to: "#63636B" },- tools: { glyph: "toolbox", from: "#FF9F5A", to: "#E8641A" },- nami: { glyph: "cloud-arrow-down", from: "#FF6584", to: "#D23B68" },plugin: { glyph: "puzzle-piece", from: "#8E8E93", to: "#5C5C60" },};- let moscatIcon = $derived(MOSCAT_ICONS[icon]);+ let penguin = $derived(PENGUIN_ICONS[icon]);let tile = $derived(TILES[icon] ?? TILES.plugin);let glyphSize = $derived(Math.round(size * 0.64));</script>-{#if iconSvg}+{#if penguin}+ <span+ class="nav-icon nav-penguin"+ class:nav-icon-active={active}+ style:--icon-size="{size}px"+ aria-hidden="true"+ >+ <img+ src="/icons/nav/{penguin}-32.png"+ srcset="/icons/nav/{penguin}-32.png 1x, /icons/nav/{penguin}-64.png 2x"+ alt=""+ width={size}+ height={size}+ class="nav-penguin-img"+ draggable="false"+ decoding="async"+ />+ </span>+{:else if iconSvg}<spanclass="nav-icon nav-tile"class:nav-icon-active={active}@@ -59,22 +66,6 @@{/each}</svg></span>-{:else if moscatIcon}- <span- class="nav-icon nav-moscat"- class:nav-icon-active={active}- style:--icon-size="{size}px"- aria-hidden="true"- >- <img- src={moscatIcon}- alt=""- width={size}- height={size}- class="nav-moscat-img"- draggable="false"- />- </span>{:else}<spanclass="nav-icon nav-tile"@@ -89,6 +80,33 @@{/if}<style>+ .nav-penguin {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ width: var(--icon-size);+ height: var(--icon-size);+ flex-shrink: 0;+ }++ .nav-penguin-img {+ width: var(--icon-size);+ height: var(--icon-size);+ object-fit: contain;+ display: block;+ image-rendering: -webkit-optimize-contrast;+ image-rendering: crisp-edges;+ transition: transform 0.15s var(--ease-out, ease-out);+ }++ .nav-icon-active .nav-penguin-img {+ transform: scale(1.08);+ }++ :global(.mac-nav-item:hover) .nav-penguin-img:not(.nav-icon-active) {+ transform: scale(1.08);+ }+.nav-tile {display: inline-flex;align-items: center;@@ -103,6 +121,7 @@inset 0 -1px 1px rgba(0, 0, 0, 0.12),0 0.5px 1px rgba(0, 0, 0, 0.25);color: #fff;+ transition: transform 0.15s var(--ease-out, ease-out);}.nav-glyph {@@ -113,26 +132,22 @@filter: drop-shadow(0 0.5px 0 rgba(0, 0, 0, 0.18));}- .nav-moscat {- display: inline-flex;- align-items: center;- justify-content: center;- width: var(--icon-size);- height: var(--icon-size);- flex-shrink: 0;+ .nav-icon-active.nav-tile {+ transform: scale(1.05);}- .nav-moscat-img {- width: var(--icon-size);- height: var(--icon-size);- object-fit: contain;- display: block;- border-radius: 4px;- filter: drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.18));- transition: transform 0.15s ease-out;+ :global(.mac-nav-item:hover) .nav-tile:not(.nav-icon-active) {+ transform: scale(1.05);}- .nav-icon-active .nav-moscat-img {- transform: scale(1.08);+ @media (prefers-reduced-motion: reduce) {+ .nav-penguin-img,+ .nav-tile {+ transition: none;+ }+ :global(.mac-nav-item:hover) .nav-penguin-img:not(.nav-icon-active),+ :global(.mac-nav-item:hover) .nav-tile:not(.nav-icon-active) {+ transform: none;+ }}</style>diff --git a/src/components/tools/ToolIcon.svelte b/src/components/tools/ToolIcon.svelteindex ba7d4bbe..e510911d 100644--- a/src/components/tools/ToolIcon.svelte+++ b/src/components/tools/ToolIcon.svelte@@ -35,7 +35,16 @@style:background={gradient}aria-hidden="true">- <span class="tool-glyph" style:--glyph="url({url})" style:width="{glyphSize}px" style:height="{glyphSize}px"></span>+ <img+ class="tool-glyph-img"+ src={url}+ alt=""+ width={glyphSize}+ height={glyphSize}+ draggable="false"+ loading="lazy"+ decoding="async"+ /></span>{/if}@@ -48,11 +57,8 @@flex-shrink: 0;color: #fff;box-shadow:- inset 0 0 0 0.5px rgba(255, 255, 255, 0.28),- inset 0 1px 0 rgba(255, 255, 255, 0.22),- inset 0 -2px 3px rgba(0, 0, 0, 0.14),- 0 1px 2px rgba(0, 0, 0, 0.18),- 0 6px 14px -6px rgba(0, 0, 0, 0.35);+ inset 0 1px 0 rgba(255, 255, 255, 0.25),+ 0 2px 8px -2px rgba(0, 0, 0, 0.25);transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);}@@ -84,11 +90,11 @@opacity: 0.72;}- .tool-glyph {+ .tool-glyph-img {display: block;- background: #fff;- -webkit-mask: var(--glyph) center / contain no-repeat;- mask: var(--glyph) center / contain no-repeat;- filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.2));+ object-fit: contain;+ filter: brightness(0) invert(1);+ pointer-events: none;+ -webkit-user-drag: none;}</style>diff --git a/src/components/tools/ToolTile.svelte b/src/components/tools/ToolTile.svelteindex c45ed26a..c416f7ec 100644--- a/src/components/tools/ToolTile.svelte+++ b/src/components/tools/ToolTile.svelte@@ -88,6 +88,9 @@text-align: center;-webkit-user-drag: none;transition: background var(--duration-fast) var(--ease-out);+ content-visibility: auto;+ contain-intrinsic-size: 148px 160px;+ contain: layout paint style;}.tool-tile-art {diff --git a/src/components/tools/ToolsSearchBar.svelte b/src/components/tools/ToolsSearchBar.svelteindex 36457207..f0eb130c 100644--- a/src/components/tools/ToolsSearchBar.svelte+++ b/src/components/tools/ToolsSearchBar.svelte@@ -122,6 +122,11 @@flex-shrink: 0;}+ .tools-filter .segmented-btn {+ height: 28px;+ min-width: 28px;+ }+.sr-only {position: absolute;width: 1px;diff --git a/src/components/tools/documents/GdocsTool.svelte b/src/components/tools/documents/GdocsTool.svelteindex 077a88c5..5c1b6a4b 100644--- a/src/components/tools/documents/GdocsTool.svelte+++ b/src/components/tools/documents/GdocsTool.svelte@@ -1,32 +1,132 @@<script lang="ts">- /** Google Docs/Slides/Sheets públicos via export oficial (estudo 51). */+ /** Google Docs/Slides/Sheets públicos + Extractor y compilador vectorial 16:9 de Google Slides. */import { invoke } from "@tauri-apps/api/core";+ import { listen } from "@tauri-apps/api/event";+ import { onDestroy, onMount } from "svelte";import { t } from "$lib/i18n";import { showToast } from "$lib/stores/toast-store.svelte";- import { errText, pickDir, reveal } from "$lib/tools/rt";+ import { errText, onToolProgress, pct, pickDir, reveal, type ToolProgress } from "$lib/tools/rt";++ type Info = { kind: string; id: string; formats: string[]; is_published?: boolean };+ type CompileResult = { title: string; pages: number; output_path: string; format: string };+ type BridgeInfo = { port: number; slide_count: number; last_output: string | null; script: string };- type Info = { kind: string; id: string; formats: string[] };let url = $state("");let info = $state<Info | null>(null);let format = $state("pdf");let dest = $state("");let busy = $state(false);let out = $state<string | null>(null);+ let progress = $state<ToolProgress | null>(null);++ let svgDir = $state("");+ let compilingSvgDir = $state(false);+ let compiledResult = $state<CompileResult | null>(null);++ let bridgeInfo = $state<BridgeInfo | null>(null);+ let bridgeSlidesCount = $state(0);++ let unlistenProgress: (() => void) | null = null;+ let unlistenBridgeProgress: (() => void) | null = null;+ let unlistenBridgeDone: (() => void) | null = null;++ onMount(async () => {+ unlistenProgress = await onToolProgress((p) => {+ if (p.id.startsWith("gslides") || p.id === "gdocs") {+ progress = p;+ }+ });+ unlistenBridgeProgress = await listen<{ slide_count: number }>("gslides-bridge-progress", (ev) => {+ bridgeSlidesCount = ev.payload.slide_count;+ });+ unlistenBridgeDone = await listen<{ file: string; pages: number }>("gslides-bridge-complete", (ev) => {+ bridgeSlidesCount = 0;+ out = ev.payload.file;+ showToast("success", $t("tools.common.done") as string);+ });+ try {+ bridgeInfo = await invoke<BridgeInfo>("tool_gslides_bridge_info");+ bridgeSlidesCount = bridgeInfo.slide_count;+ } catch {+ // Ignorar en entorno sin puente activo+ }+ });++ onDestroy(() => {+ unlistenProgress?.();+ unlistenBridgeProgress?.();+ unlistenBridgeDone?.();+ });- async function parse() {- info = await invoke<Info | null>("tool_gdocs_parse", { url });- if (!info) showToast("error", $t("tools.gdocs.bad_url") as string);- else if (!info.formats.includes(format)) format = info.formats[0];+ async function parse(): Promise<Info | null> {+ const parsed = await invoke<Info | null>("tool_gdocs_parse", { url });+ info = parsed;+ if (!parsed) {+ showToast("error", $t("tools.gdocs.bad_url") as string);+ } else if (!parsed.formats.includes(format)) {+ format = parsed.formats[0];+ }+ return parsed;}async function run() {- if (!info || busy) return;- if (!dest) { const d = await pickDir(); if (!d) return; dest = d; }- busy = true; out = null;+ if (busy || !url.trim()) return;+ if (!info) {+ const parsed = await parse();+ if (!parsed) return;+ }+ if (!dest) {+ const d = await pickDir();+ if (!d) return;+ dest = d;+ }+ busy = true;+ out = null;+ progress = null;try {out = await invoke<string>("tool_gdocs_download", { url, format, dest });showToast("success", $t("tools.common.done") as string);- } catch (e) { showToast("error", errText(e)); } finally { busy = false; }+ } catch (e) {+ showToast("error", errText(e));+ } finally {+ busy = false;+ }+ }++ async function runCompileDir() {+ if (compilingSvgDir) return;+ if (!svgDir) {+ const d = await pickDir();+ if (!d) return;+ svgDir = d;+ }+ compilingSvgDir = true;+ compiledResult = null;+ progress = null;+ try {+ const res = await invoke<CompileResult>("tool_gslides_compile_dir", {+ svgDir,+ outputPdf: dest || null,+ });+ compiledResult = res;+ out = res.output_path;+ showToast("success", $t("tools.common.done") as string);+ } catch (e) {+ showToast("error", errText(e));+ } finally {+ compilingSvgDir = false;+ }+ }++ async function copyBrowserScript() {+ try {+ const latest = await invoke<BridgeInfo>("tool_gslides_bridge_info");+ bridgeInfo = latest;+ await navigator.clipboard.writeText(latest.script);+ showToast("success", $t("tools.common.copied") as string);+ } catch (e) {+ showToast("error", errText(e));+ }}</script>@@ -34,7 +134,7 @@<section><div class="group"><div class="group-row">- <div class="group-row-content"><input class="input" type="url" bind:value={url} oninput={() => (info = null)} placeholder="https://docs.google.com/presentation/d/…" onkeydown={(e) => e.key === "Enter" && parse()} /></div>+ <div class="group-row-content"><input class="input" type="url" bind:value={url} oninput={() => (info = null)} placeholder="https://docs.google.com/presentation/d/…" onkeydown={(e) => e.key === "Enter" && run()} /></div><div class="group-row-trailing"><button class="btn btn-secondary btn-sm" type="button" disabled={!url.trim()} onclick={parse}>{$t("tools.gdocs.check")}</button></div></div>{#if info}@@ -48,14 +148,53 @@<div class="group-row-trailing"><button class="btn btn-secondary btn-sm" type="button" onclick={async () => { const d = await pickDir(); if (d) dest = d; }}>{$t("tools.common.choose")}</button></div></div><div class="group-row">- <div class="group-row-content"><div class="group-row-sub">{$t("tools.gdocs.note")}</div></div>- <div class="group-row-trailing"><button class="btn btn-primary" type="button" disabled={busy || !info} onclick={run}>{busy ? $t("tools.common.working") : $t("tools.common.download")}</button></div>+ <div class="group-row-content">+ {#if busy || compilingSvgDir}+ <div class="group-row-sub">{progress?.message ?? (progress ? `${progress.done}/${progress.total ?? "?"}` : "…")}</div>+ <div class="progress"><div class="progress-fill" style:width="{pct(progress) ?? 0}%"></div></div>+ {:else}+ <div class="group-row-sub">{$t("tools.gdocs.note")}</div>+ {/if}+ </div>+ <div class="group-row-trailing"><button class="btn btn-primary" type="button" disabled={busy || !url.trim()} onclick={run}>{busy ? $t("tools.common.working") : $t("tools.common.download")}</button></div></div></div></section>++ <section>+ <div class="group">+ <div class="group-row">+ <div class="group-row-content">+ <div class="group-row-title">SVG → PDF (16:9)</div>+ <div class="group-row-sub mono">{svgDir || $t("tools.common.ask_on_run")}</div>+ </div>+ <div class="group-row-trailing">+ <button class="btn btn-secondary btn-sm" type="button" onclick={async () => { const d = await pickDir(); if (d) svgDir = d; }}>{$t("tools.common.choose")}</button>+ <button class="btn btn-primary btn-sm" type="button" disabled={compilingSvgDir} onclick={runCompileDir}>{compilingSvgDir ? $t("tools.common.working") : "PDF"}</button>+ </div>+ </div>+ {#if bridgeInfo}+ <div class="group-row">+ <div class="group-row-content">+ <div class="group-row-title">Bookmarklet / JS ({`127.0.0.1:${bridgeInfo.port}`})</div>+ <div class="group-row-sub">{bridgeSlidesCount > 0 ? `${bridgeSlidesCount} slides en buffer` : "Extractor para consola o marcador del navegador"}</div>+ </div>+ <div class="group-row-trailing">+ <button class="btn btn-secondary btn-sm" type="button" onclick={copyBrowserScript}>{$t("tools.common.copy")}</button>+ </div>+ </div>+ {/if}+ </div>+ </section>+{#if out}<section><div class="group"><div class="group-row">- <div class="group-row-content"><div class="group-row-sub mono">{out}</div></div>+ <div class="group-row-content">+ {#if compiledResult}+ <div class="group-row-title">{compiledResult.title} · {compiledResult.pages} slides</div>+ {/if}+ <div class="group-row-sub mono">{out}</div>+ </div><div class="group-row-trailing"><button class="btn btn-secondary btn-sm" type="button" onclick={() => reveal(out!)}>{$t("tools.common.reveal")}</button></div></div></div></section>{/if}diff --git a/src/components/tools/youtube/CodecTool.svelte b/src/components/tools/youtube/CodecTool.svelteindex 343d7333..da16bd9b 100644--- a/src/components/tools/youtube/CodecTool.svelte+++ b/src/components/tools/youtube/CodecTool.svelte@@ -36,7 +36,7 @@<div class="group-row"><div class="group-row-content"><div class="group-row-title">{$t("tools.codec.how")}</div><ol class="steps"><li>{$t("tools.codec.step1")}</li><li>{$t("tools.codec.step2")}</li><li>{$t("tools.codec.step3")}</li></ol></div></div><div class="group-row"><div class="group-row-content"><div class="group-row-title">{$t("tools.codec.extension")}</div><div class="group-row-sub">{$t("tools.codec.extension_hint")}</div></div>- <div class="group-row-trailing btn-row"><a class="btn btn-secondary btn-sm" href="/settings">{$t("tools.codec.open_settings")}</a><button class="btn btn-ghost btn-sm" type="button" onclick={() => openUrl("https://github.com/OpenSelena/libreget#browser-extension")}>GitHub</button></div>+ <div class="group-row-trailing btn-row"><a class="btn btn-secondary btn-sm" href="/settings">{$t("tools.codec.open_settings")}</a><button class="btn btn-ghost btn-sm" type="button" onclick={() => openUrl("https://github.com/OpenSelena/libreget-extension")}>GitHub</button></div></div></div></section>diff --git a/src/lib/api/nami.ts b/src/lib/api/nami.tsindex 0394bfe5..e5756ba1 100644--- a/src/lib/api/nami.ts+++ b/src/lib/api/nami.ts@@ -1,6 +1,49 @@-import { invoke } from '@tauri-apps/api/core';+import { invoke, convertFileSrc } from '@tauri-apps/api/core';import { listen, type UnlistenFn } from '@tauri-apps/api/event';+export interface CachedAvatar {+ file_path: string;+ data_url: string;+}++export interface ResolvedProfileAvatar {+ data_url: string;+ name?: string;+}++export async function resolveFacebookAvatar(url: string): Promise<ResolvedProfileAvatar | null> {+ if (!url || typeof url !== 'string') return null;+ try {+ return await invoke<ResolvedProfileAvatar | null>('nami_resolve_facebook_avatar', { url });+ } catch {+ return null;+ }+}++export async function cacheAvatar(url: string): Promise<string> {+ if (!url || typeof url !== 'string') return '';+ const trimmed = url.trim();+ if (+ trimmed.startsWith('asset://') ||+ trimmed.startsWith('http://asset.localhost') ||+ trimmed.startsWith('data:')+ ) {+ return trimmed;+ }+ try {+ const res = await invoke<CachedAvatar>('nami_cache_avatar', { url: trimmed });+ if (res?.data_url) {+ return res.data_url;+ }+ if (res?.file_path) {+ return convertFileSrc(res.file_path);+ }+ } catch (err) {+ console.warn('[nami] Avatar caching failed, falling back to remote URL:', err);+ }+ return trimmed;+}+export interface Profile {url: string;username?: string;diff --git a/src/lib/home/librebox-controller.ts b/src/lib/home/librebox-controller.tsindex a25cb099..8c21e067 100644--- a/src/lib/home/librebox-controller.ts+++ b/src/lib/home/librebox-controller.ts@@ -28,6 +28,7 @@ export type SearchResult = {};export type HomeInputMode = "url" | "batch" | "torrent" | "p2p";+export type MoreAction = "batch" | "torrent" | "advanced" | "p2p";export function isUrl(value: string): boolean {return (diff --git a/src/lib/home/plural.ts b/src/lib/home/plural.tsnew file mode 100644index 00000000..6b5a3e68--- /dev/null+++ b/src/lib/home/plural.ts@@ -0,0 +1,24 @@+import { get } from "svelte/store";+import { locale } from "$lib/i18n";++const rulesCache = new Map<string, Intl.PluralRules>();++export function pluralKey(base: string, count: number): string {+ const lang = get(locale) || "en";+ let rules = rulesCache.get(lang);+ if (!rules) {+ try {+ rules = new Intl.PluralRules(lang);+ } catch {+ rules = new Intl.PluralRules("en");+ }+ rulesCache.set(lang, rules);+ }+ return `${base}_${rules.select(count) === "one" ? "one" : "other"}`;+}++export function splitLink(text: string): { before: string; link: string; after: string } {+ const m = /^(.*?)\[(.+?)\](.*)$/s.exec(text);+ if (!m) return { before: text, link: "", after: "" };+ return { before: m[1], link: m[2], after: m[3] };+}diff --git a/src/lib/home/video-or-list.test.ts b/src/lib/home/video-or-list.test.tsnew file mode 100644index 00000000..be87014e--- /dev/null+++ b/src/lib/home/video-or-list.test.ts@@ -0,0 +1,30 @@+import { describe, expect, it } from "vitest";+import { videoOrListLink } from "./video-or-list";++describe("videoOrListLink", () => {+ it("recognises an automatic mix link as a mix", () => {+ expect(+ videoOrListLink(+ "https://www.youtube.com/watch?v=abc&list=RDabc&start_radio=1"+ )+ ).toEqual({+ videoId: "abc",+ listId: "RDabc",+ isMix: true,+ });+ });++ it("recognises a video opened inside a normal playlist", () => {+ expect(videoOrListLink("https://youtu.be/abc?list=PL1")?.isMix).toBe(false);+ expect(+ videoOrListLink("https://music.youtube.com/watch?v=abc&list=OLAK1")?.videoId+ ).toBe("abc");+ });++ it("does not ask for a plain video or a plain playlist", () => {+ expect(videoOrListLink("https://www.youtube.com/watch?v=abc")).toBeNull();+ expect(videoOrListLink("https://www.youtube.com/playlist?list=PL1")).toBeNull();+ expect(videoOrListLink("https://example.com/watch?v=abc&list=PL1")).toBeNull();+ expect(videoOrListLink("not a link")).toBeNull();+ });+});diff --git a/src/lib/home/video-or-list.ts b/src/lib/home/video-or-list.tsnew file mode 100644index 00000000..bd2a5a64--- /dev/null+++ b/src/lib/home/video-or-list.ts@@ -0,0 +1,20 @@+export type VideoOrListLink = { videoId: string; listId: string; isMix: boolean };++export function videoOrListLink(raw: string): VideoOrListLink | null {+ let url: URL;+ try {+ url = new URL(raw);+ } catch {+ return null;+ }+ const host = url.hostname.replace(/^www\.|^m\.|^music\./i, "").toLowerCase();+ const videoId =+ host === "youtu.be"+ ? url.pathname.slice(1).split("/")[0]+ : host === "youtube.com"+ ? url.searchParams.get("v")+ : null;+ const listId = url.searchParams.get("list");+ if (!videoId || !listId) return null;+ return { videoId, listId, isMix: /^RD/.test(listId) };+}diff --git a/src/lib/i18n/el.json b/src/lib/i18n/el.jsonindex f001f0e7..2a1d386e 100644--- a/src/lib/i18n/el.json+++ b/src/lib/i18n/el.json@@ -65,7 +65,9 @@"section_plugins": "Plugins","expand_plugins": "Expand plugins","collapse_plugins": "Collapse plugins",- "tools": "Tools"+ "tools": "Tools",+ "collapse_sidebar": "Σύμπτυξη πλαϊνής στήλης",+ "expand_sidebar": "Ανάπτυξη πλαϊνής στήλης"},"command_palette": {"open": "Search",@@ -87,7 +89,14 @@"action_advanced": "Advanced options","action_simple": "Back to the simple view","value_line": "{{count}} files · {{size}} saved with LibreGet",- "value_first": "Your first download takes about a minute. Private content only needs your browser cookies."+ "value_first": "Your first download takes about a minute. Private content only needs your browser cookies.",+ "more": "Περισσότεροι τρόποι λήψης",+ "paste": "Επικόλληση",+ "paste_empty": "Το πρόχειρο δεν έχει σύνδεσμο.",+ "submit": "Λήψη αυτού του συνδέσμου",+ "saved_count_one": "{{count}} αρχείο",+ "saved_count_other": "{{count}} αρχεία",+ "saved_line": "{{files}} · {{size}} αποθηκεύτηκαν"},"tools": {"tab": "Εργαλεία",@@ -3248,7 +3257,11 @@"view_downloads": "View downloads","eta_left": "About {{eta}} left","view_history": "History",- "view_tools": "Tools"+ "view_tools": "Tools",+ "leftovers_title": "Διαγραφή όσων άφησε πίσω αυτή η λήψη;",+ "leftovers_body": "Αυτή η λήψη άφησε {{count}} μερικό(ά) αρχείο(α), {{size}} συνολικά. Τα ολοκληρωμένα αρχεία δεν αγγίζονται.",+ "leftovers_keep": "Αφαίρεση και διατήρηση των αρχείων",+ "leftovers_delete": "Αφαίρεση και διαγραφή των αρχείων"},"toast": {"download_preparing": "Προετοιμασία λήψης...",@@ -3810,7 +3823,8 @@"copy_to_clipboard_on_hotkey_desc": "Αντιγράψτε αυτόματα το ληφθέν αρχείο στο πρόχειρο για εύκολη επικόλληση","filename_template": "Πρότυπο ονόματος αρχείου","filename_template_desc": "Πρότυπο εξόδου του yt-dlp για τα ληφθέντα αρχεία",- "filename_template_preview": "Προεπισκόπηση: {{preview}}"+ "filename_template_preview": "Προεπισκόπηση: {{preview}}",+ "remove_saved_dir": "Remove"},"update_available": "Η έκδοση {{version}} του LibreGet είναι διαθέσιμη","update_button": "ενημέρωση τώρα",@@ -4375,7 +4389,12 @@},"courses_plugin_needed": "This is a course page. The free Courses plugin signs in with your account and downloads every lesson.","courses_plugin_ready": "Course pages are downloaded from the Courses tab with your account signed in.",- "install_courses_plugin": "Get the Courses plugin"+ "install_courses_plugin": "Get the Courses plugin",+ "video_or_list": "Αυτό το βίντεο ανήκει σε λίστα. Τι θέλετε να κατεβάσετε;",+ "video_or_list_mix": "Αυτό το βίντεο ανήκει σε αυτόματο μείγμα. Τι θέλετε να κατεβάσετε;",+ "video_or_list_video": "Μόνο αυτό το βίντεο",+ "video_or_list_list": "Ολόκληρη τη λίστα",+ "video_or_list_mix_list": "Το μείγμα"},"about": {"tab": {diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.jsonindex 9049843f..e2a7b837 100644--- a/src/lib/i18n/en.json+++ b/src/lib/i18n/en.json@@ -65,6 +65,8 @@"section_plugins": "Plugins","expand_plugins": "Expand plugins","collapse_plugins": "Collapse plugins",+ "collapse_sidebar": "Collapse sidebar",+ "expand_sidebar": "Expand sidebar","tools": "Tools"},"command_palette": {@@ -79,8 +81,15 @@"action_paste": "Paste URL from clipboard"},"home": {+ "more": "More download actions","inspector_title": "Download options","hero_title": "Grab a link, get the file.",+ "paste": "Paste",+ "paste_empty": "Your clipboard has no link.",+ "submit": "Download this link",+ "saved_count_one": "{{count}} file",+ "saved_count_other": "{{count}} files",+ "saved_line": "{{files}} · {{size}} saved","action_batch": "Many links at once","action_torrent": "Open a .torrent file","action_p2p": "Send a file to someone",@@ -3248,7 +3257,11 @@"view_downloads": "View downloads","eta_left": "About {{eta}} left","view_history": "History",- "view_tools": "Tools"+ "view_tools": "Tools",+ "leftovers_title": "Delete what this download left behind?",+ "leftovers_body": "This download left {{count}} partial file(s), {{size}} in total. Finished files are not touched.",+ "leftovers_keep": "Remove and keep the files",+ "leftovers_delete": "Remove and delete the files"},"toast": {"download_preparing": "Preparing download...",@@ -3810,7 +3823,8 @@"copy_to_clipboard_on_hotkey_desc": "Automatically copy the downloaded file to clipboard for easy pasting","filename_template": "Filename template","filename_template_desc": "yt-dlp output template for downloaded files",- "filename_template_preview": "Preview: {{preview}}"+ "filename_template_preview": "Preview: {{preview}}",+ "remove_saved_dir": "Remove"},"update_available": "LibreGet {{version}} is available","update_button": "update now",@@ -4375,7 +4389,12 @@},"courses_plugin_needed": "This is a course page. The free Courses plugin signs in with your account and downloads every lesson.","courses_plugin_ready": "Course pages are downloaded from the Courses tab with your account signed in.",- "install_courses_plugin": "Get the Courses plugin"+ "install_courses_plugin": "Get the Courses plugin",+ "video_or_list": "This video is part of a list. What do you want to download?",+ "video_or_list_mix": "This video is part of an automatic mix. What do you want to download?",+ "video_or_list_video": "Only this video",+ "video_or_list_list": "The whole list",+ "video_or_list_mix_list": "The mix"},"about": {"tab": {diff --git a/src/lib/i18n/es.json b/src/lib/i18n/es.jsonindex 5cce45bd..0cc78d7d 100644--- a/src/lib/i18n/es.json+++ b/src/lib/i18n/es.json@@ -65,7 +65,9 @@"section_plugins": "Plugins","expand_plugins": "Expand plugins","collapse_plugins": "Collapse plugins",- "tools": "Tools"+ "tools": "Tools",+ "collapse_sidebar": "Contraer barra lateral",+ "expand_sidebar": "Expandir barra lateral"},"command_palette": {"open": "Search",@@ -87,7 +89,14 @@"action_advanced": "Advanced options","action_simple": "Back to the simple view","value_line": "{{count}} files · {{size}} saved with LibreGet",- "value_first": "Your first download takes about a minute. Private content only needs your browser cookies."+ "value_first": "Your first download takes about a minute. Private content only needs your browser cookies.",+ "more": "Más formas de descargar",+ "paste": "Pegar",+ "paste_empty": "No hay ningún enlace en el portapapeles.",+ "submit": "Descargar este enlace",+ "saved_count_one": "{{count}} archivo",+ "saved_count_other": "{{count}} archivos",+ "saved_line": "{{files}} · {{size}} guardados"},"tools": {"tab": "Herramientas",@@ -3248,7 +3257,11 @@"view_downloads": "View downloads","eta_left": "About {{eta}} left","view_history": "History",- "view_tools": "Tools"+ "view_tools": "Tools",+ "leftovers_title": "¿Eliminar lo que dejó esta descarga?",+ "leftovers_body": "Esta descarga dejó {{count}} archivo(s) parcial(es), {{size}} en total. Los archivos terminados no se tocan.",+ "leftovers_keep": "Quitar y conservar los archivos",+ "leftovers_delete": "Quitar y eliminar los archivos"},"toast": {"download_preparing": "Preparando descarga...",@@ -3810,7 +3823,8 @@"copy_to_clipboard_on_hotkey_desc": "Copia automáticamente el archivo descargado al portapapeles para pegarlo fácilmente","filename_template": "Plantilla de nombre de archivo","filename_template_desc": "Plantilla de salida yt-dlp para los archivos descargados",- "filename_template_preview": "Vista previa: {{preview}}"+ "filename_template_preview": "Vista previa: {{preview}}",+ "remove_saved_dir": "Remove"},"update_available": "LibreGet {{version}} está disponible","update_button": "actualizar ahora",@@ -4375,7 +4389,12 @@},"courses_plugin_needed": "This is a course page. The free Courses plugin signs in with your account and downloads every lesson.","courses_plugin_ready": "Course pages are downloaded from the Courses tab with your account signed in.",- "install_courses_plugin": "Get the Courses plugin"+ "install_courses_plugin": "Get the Courses plugin",+ "video_or_list": "Este vídeo forma parte de una lista. ¿Qué quieres descargar?",+ "video_or_list_mix": "Este vídeo forma parte de un mix automático. ¿Qué quieres descargar?",+ "video_or_list_video": "Solo este vídeo",+ "video_or_list_list": "La lista completa",+ "video_or_list_mix_list": "El mix"},"about": {"tab": {diff --git a/src/lib/i18n/fa.json b/src/lib/i18n/fa.jsonindex efc7861f..5758d92e 100644--- a/src/lib/i18n/fa.json+++ b/src/lib/i18n/fa.json@@ -65,7 +65,9 @@"section_plugins": "افزونهها","expand_plugins": "باز کردن افزونهها","collapse_plugins": "بستن افزونهها",- "tools": "Tools"+ "tools": "Tools",+ "collapse_sidebar": "جمع کردن نوار کناری",+ "expand_sidebar": "باز کردن نوار کناری"},"command_palette": {"open": "Search",@@ -87,7 +89,14 @@"action_advanced": "Advanced options","action_simple": "Back to the simple view","value_line": "{{count}} files · {{size}} saved with LibreGet",- "value_first": "Your first download takes about a minute. Private content only needs your browser cookies."+ "value_first": "Your first download takes about a minute. Private content only needs your browser cookies.",+ "more": "راههای دیگر دانلود",+ "paste": "جایگذاری",+ "paste_empty": "در کلیپبورد لینکی نیست.",+ "submit": "دانلود این لینک",+ "saved_count_one": "{{count}} فایل",+ "saved_count_other": "{{count}} فایل",+ "saved_line": "{{files}} · {{size}} ذخیره شد"},"tools": {"tab": "Tools",@@ -3248,7 +3257,11 @@"view_downloads": "View downloads","eta_left": "About {{eta}} left","view_history": "History",- "view_tools": "Tools"+ "view_tools": "Tools",+ "leftovers_title": "آنچه این دانلود به جا گذاشته حذف شود؟",+ "leftovers_body": "این دانلود {{count}} فایل ناقص به حجم کل {{size}} به جا گذاشت. به فایلهای کامل دست زده نمیشود.",+ "leftovers_keep": "حذف و نگه داشتن فایلها",+ "leftovers_delete": "حذف و پاک کردن فایلها"},"toast": {"download_preparing": "در حال آمادهسازی دانلود…",@@ -3810,7 +3823,8 @@"copy_to_clipboard_on_hotkey_desc": "Automatically copy the downloaded file to clipboard for easy pasting","filename_template": "Filename template","filename_template_desc": "yt-dlp output template for downloaded files",- "filename_template_preview": "Preview: {{preview}}"+ "filename_template_preview": "Preview: {{preview}}",+ "remove_saved_dir": "Remove"},"update_available": "LibreGet {{version}} is available","update_button": "update now",@@ -4375,7 +4389,12 @@},"courses_plugin_needed": "This is a course page. The free Courses plugin signs in with your account and downloads every lesson.","courses_plugin_ready": "Course pages are downloaded from the Courses tab with your account signed in.",- "install_courses_plugin": "Get the Courses plugin"+ "install_courses_plugin": "Get the Courses plugin",+ "video_or_list": "این ویدیو بخشی از یک فهرست است. چه چیزی را میخواهید دانلود کنید؟",+ "video_or_list_mix": "این ویدیو بخشی از یک میکس خودکار است. چه چیزی را میخواهید دانلود کنید؟",+ "video_or_list_video": "فقط این ویدیو",+ "video_or_list_list": "کل فهرست",+ "video_or_list_mix_list": "میکس"},"about": {"tab": {diff --git a/src/lib/i18n/fr.json b/src/lib/i18n/fr.jsonindex 9b1f66e0..a84c15ed 100644--- a/src/lib/i18n/fr.json+++ b/src/lib/i18n/fr.json@@ -65,7 +65,9 @@"section_plugins": "Plugins","expand_plugins": "Expand plugins","collapse_plugins": "Collapse plugins",- "tools": "Tools"+ "tools": "Tools",+ "collapse_sidebar": "Réduire la barre latérale",+ "expand_sidebar": "Développer la barre latérale"},"command_palette": {"open": "Search",@@ -87,7 +89,14 @@"action_advanced": "Advanced options","action_simple": "Back to the simple view","value_line": "{{count}} files · {{size}} saved with LibreGet",- "value_first": "Your first download takes about a minute. Private content only needs your browser cookies."+ "value_first": "Your first download takes about a minute. Private content only needs your browser cookies.",+ "more": "Autres façons de télécharger",+ "paste": "Coller",+ "paste_empty": "Aucun lien dans le presse-papiers.",+ "submit": "Télécharger ce lien",+ "saved_count_one": "{{count}} fichier",+ "saved_count_other": "{{count}} fichiers",+ "saved_line": "{{files}} · {{size}} enregistrés"},"tools": {"tab": "Outils",@@ -3248,7 +3257,11 @@"view_downloads": "View downloads","eta_left": "About {{eta}} left","view_history": "History",- "view_tools": "Tools"+ "view_tools": "Tools",+ "leftovers_title": "Supprimer ce que ce téléchargement a laissé ?",+ "leftovers_body": "Ce téléchargement a laissé {{count}} fichier(s) partiel(s), {{size}} au total. Les fichiers terminés ne sont pas touchés.",+ "leftovers_keep": "Retirer et garder les fichiers",+ "leftovers_delete": "Retirer et supprimer les fichiers"},"toast": {"download_preparing": "Préparation du téléchargement...",@@ -3810,7 +3823,8 @@"copy_to_clipboard_on_hotkey_desc": "Copier automatiquement le fichier téléchargé dans le presse-papiers pour un collage facile","filename_template": "Modèle de nom de fichier","filename_template_desc": "Modèle de sortie yt-dlp pour les fichiers téléchargés",- "filename_template_preview": "Aperçu : {{preview}}"+ "filename_template_preview": "Aperçu : {{preview}}",+ "remove_saved_dir": "Remove"},"update_available": "LibreGet {{version}} est disponible","update_button": "mettre à jour",@@ -4375,7 +4389,12 @@},"courses_plugin_needed": "This is a course page. The free Courses plugin signs in with your account and downloads every lesson.","courses_plugin_ready": "Course pages are downloaded from the Courses tab with your account signed in.",- "install_courses_plugin": "Get the Courses plugin"+ "install_courses_plugin": "Get the Courses plugin",+ "video_or_list": "Cette vidéo fait partie d'une liste. Que voulez-vous télécharger ?",+ "video_or_list_mix": "Cette vidéo fait partie d'un mix automatique. Que voulez-vous télécharger ?",+ "video_or_list_video": "Uniquement cette vidéo",+ "video_or_list_list": "Toute la liste",+ "video_or_list_mix_list": "Le mix"},"about": {"tab": {diff --git a/src/lib/i18n/it.json b/src/lib/i18n/it.jsonindex c9875d6d..5a846efe 100644--- a/src/lib/i18n/it.json+++ b/src/lib/i18n/it.json@@ -65,7 +65,9 @@"section_plugins": "Plugins","expand_plugins": "Expand plugins","collapse_plugins": "Collapse plugins",- "tools": "Tools"+ "tools": "Tools",+ "collapse_sidebar": "Comprimi barra laterale",+ "expand_sidebar": "Espandi barra laterale"},"command_palette": {"open": "Search",@@ -87,7 +89,14 @@"action_advanced": "Advanced options","action_simple": "Back to the simple view","value_line": "{{count}} files · {{size}} saved with LibreGet",- "value_first": "Your first download takes about a minute. Private content only needs your browser cookies."+ "value_first": "Your first download takes about a minute. Private content only needs your browser cookies.",+ "more": "Altri modi per scaricare",+ "paste": "Incolla",+ "paste_empty": "Negli appunti non c'è nessun link.",+ "submit": "Scarica questo link",+ "saved_count_one": "{{count}} file",+ "saved_count_other": "{{count}} file",+ "saved_line": "{{files}} · {{size}} salvati"},"tools": {"tab": "Strumenti",@@ -3248,7 +3257,11 @@"view_downloads": "View downloads","eta_left": "About {{eta}} left","view_history": "History",- "view_tools": "Tools"+ "view_tools": "Tools",+ "leftovers_title": "Eliminare ciò che ha lasciato questo download?",+ "leftovers_body": "Questo download ha lasciato {{count}} file parziali, {{size}} in totale. I file completati non vengono toccati.",+ "leftovers_keep": "Rimuovi e mantieni i file",+ "leftovers_delete": "Rimuovi ed elimina i file"},"toast": {"download_preparing": "Preparazione download...",@@ -3810,7 +3823,8 @@"copy_to_clipboard_on_hotkey_desc": "Copia automaticamente il file scaricato negli appunti per incollare facilmente","filename_template": "Modello nome file","filename_template_desc": "Modello di output yt-dlp per i file scaricati",- "filename_template_preview": "Anteprima: {{preview}}"+ "filename_template_preview": "Anteprima: {{preview}}",+ "remove_saved_dir": "Remove"},"update_available": "LibreGet {{version}} è disponibile","update_button": "aggiorna ora",@@ -4375,7 +4389,12 @@},"courses_plugin_needed": "This is a course page. The free Courses plugin signs in with your account and downloads every lesson.","courses_plugin_ready": "Course pages are downloaded from the Courses tab with your account signed in.",- "install_courses_plugin": "Get the Courses plugin"+ "install_courses_plugin": "Get the Courses plugin",+ "video_or_list": "Questo video fa parte di un elenco. Cosa vuoi scaricare?",+ "video_or_list_mix": "Questo video fa parte di un mix automatico. Cosa vuoi scaricare?",+ "video_or_list_video": "Solo questo video",+ "video_or_list_list": "Tutto l'elenco",+ "video_or_list_mix_list": "Il mix"},"about": {"tab": {diff --git a/src/lib/i18n/ja.json b/src/lib/i18n/ja.jsonindex 0cd56e1c..046d51de 100644--- a/src/lib/i18n/ja.json+++ b/src/lib/i18n/ja.json@@ -65,7 +65,9 @@"section_plugins": "Plugins","expand_plugins": "Expand plugins","collapse_plugins": "Collapse plugins",- "tools": "Tools"+ "tools": "Tools",+ "collapse_sidebar": "サイドバーを折りたたむ",+ "expand_sidebar": "サイドバーを展開"},"command_palette": {"open": "Search",@@ -87,7 +89,14 @@"action_advanced": "Advanced options","action_simple": "Back to the simple view","value_line": "{{count}} files · {{size}} saved with LibreGet",- "value_first": "Your first download takes about a minute. Private content only needs your browser cookies."+ "value_first": "Your first download takes about a minute. Private content only needs your browser cookies.",+ "more": "その他のダウンロード方法",+ "paste": "貼り付け",+ "paste_empty": "クリップボードにリンクがありません。",+ "submit": "このリンクをダウンロード",+ "saved_count_one": "{{count}} 件のファイル",+ "saved_count_other": "{{count}} 件のファイル",+ "saved_line": "{{files}} · {{size}} 保存済み"},"tools": {"tab": "ツール",@@ -3248,7 +3257,11 @@"view_downloads": "View downloads","eta_left": "About {{eta}} left","view_history": "History",- "view_tools": "Tools"+ "view_tools": "Tools",+ "leftovers_title": "このダウンロードが残したものを削除しますか?",+ "leftovers_body": "このダウンロードは不完全なファイルを {{count}} 個(合計 {{size}})残しました。完了したファイルには手を付けません。",+ "leftovers_keep": "削除してファイルは残す",+ "leftovers_delete": "削除してファイルも消す"},"toast": {"download_preparing": "ダウンロードを準備中...",@@ -3810,7 +3823,8 @@"copy_to_clipboard_on_hotkey_desc": "ダウンロードしたファイルを自動的にクリップボードにコピーして貼り付けやすくします","filename_template": "ファイル名テンプレート","filename_template_desc": "ダウンロードファイルのyt-dlp出力テンプレート",- "filename_template_preview": "プレビュー: {{preview}}"+ "filename_template_preview": "プレビュー: {{preview}}",+ "remove_saved_dir": "Remove"},"update_available": "LibreGet {{version}} が利用可能です","update_button": "今すぐ更新",@@ -4375,7 +4389,12 @@},"courses_plugin_needed": "This is a course page. The free Courses plugin signs in with your account and downloads every lesson.","courses_plugin_ready": "Course pages are downloaded from the Courses tab with your account signed in.",- "install_courses_plugin": "Get the Courses plugin"+ "install_courses_plugin": "Get the Courses plugin",+ "video_or_list": "この動画はリストの一部です。何をダウンロードしますか?",+ "video_or_list_mix": "この動画は自動ミックスの一部です。何をダウンロードしますか?",+ "video_or_list_video": "この動画のみ",+ "video_or_list_list": "リスト全体",+ "video_or_list_mix_list": "ミックス"},"about": {"tab": {diff --git a/src/lib/i18n/keys.ts b/src/lib/i18n/keys.tsindex 5250113f..fcbc8df4 100644--- a/src/lib/i18n/keys.ts+++ b/src/lib/i18n/keys.ts@@ -245,6 +245,10 @@ export type TranslationKeys =| 'downloads.history_toggle'| 'downloads.history_toggle_hint'| 'downloads.history_view_link'+ | 'downloads.leftovers_body'+ | 'downloads.leftovers_delete'+ | 'downloads.leftovers_keep'+ | 'downloads.leftovers_title'| 'downloads.log.copied'| 'downloads.log.copy'| 'downloads.log.copy_failed'@@ -427,6 +431,13 @@ export type TranslationKeys =| 'home.action_torrent'| 'home.hero_title'| 'home.inspector_title'+ | 'home.more'+ | 'home.paste'+ | 'home.paste_empty'+ | 'home.saved_count_one'+ | 'home.saved_count_other'+ | 'home.saved_line'+ | 'home.submit'| 'home.value_first'| 'home.value_line'@@ -590,6 +601,11 @@ export type TranslationKeys =| 'librebox.torrent_none_selected'| 'librebox.torrent_selected'| 'librebox.unsupported'+ | 'librebox.video_or_list'+ | 'librebox.video_or_list_list'+ | 'librebox.video_or_list_mix'+ | 'librebox.video_or_list_mix_list'+ | 'librebox.video_or_list_video'| 'librebox.view_formats'| 'marketplace.browse'@@ -769,8 +785,10 @@ export type TranslationKeys =| 'nav.about'| 'nav.collapse_plugins'+ | 'nav.collapse_sidebar'| 'nav.downloads'| 'nav.expand_plugins'+ | 'nav.expand_sidebar'| 'nav.home'| 'nav.marketplace'| 'nav.section_app'@@ -1322,6 +1340,7 @@ export type TranslationKeys =| 'settings.download.preset_quality_desc'| 'settings.download.presets'| 'settings.download.presets_desc'+ | 'settings.download.remove_saved_dir'| 'settings.download.sb_cat_filler'| 'settings.download.sb_cat_interaction'| 'settings.download.sb_cat_intro'diff --git a/src/lib/i18n/lo.json b/src/lib/i18n/lo.jsonindex cd7274e7..34be2587 100644--- a/src/lib/i18n/lo.json+++ b/src/lib/i18n/lo.json@@ -65,7 +65,9 @@"section_plugins": "ປລັກອິນ","expand_plugins": "ຂະຫຍາຍປລັກອິນ","collapse_plugins": "ຫຍໍ້ປລັກອິນ",- "tools": "ເຄື່ອງມື"+ "tools": "ເຄື່ອງມື",+ "collapse_sidebar": "ຫຍໍ້ແຖບຂ້າງ",+ "expand_sidebar": "ຂະຫຍາຍແຖບຂ້າງ"},"command_palette": {"open": "ຄົ້ນຫາ",@@ -87,7 +89,14 @@"action_advanced": "ຕົວເລືອກຂັ້ນສູງ","action_simple": "ກັບໄປມຸມມອງແບບງ່າຍ","value_line": "{{count}} ໄຟລ໌ · {{size}} ບັນທຶກດ້ວຍ LibreGet",- "value_first": "ການດາວໂຫຼດຄັ້ງທຳອິດໃຊ້ເວລາປະມານໜຶ່ງນາທີ. ເນື້ອຫາສ່ວນຕົວຕ້ອງການພຽງຄຸກກີ້ຂອງບຣາວເຊີທ່ານ."+ "value_first": "ການດາວໂຫຼດຄັ້ງທຳອິດໃຊ້ເວລາປະມານໜຶ່ງນາທີ. ເນື້ອຫາສ່ວນຕົວຕ້ອງການພຽງຄຸກກີ້ຂອງບຣາວເຊີທ່ານ.",+ "more": "ວິທີດາວໂຫຼດອື່ນໆ",+ "paste": "ວາງ",+ "paste_empty": "ບໍ່ມີລິ້ງໃນຄລິບບອດ.",+ "submit": "ດາວໂຫຼດລິ້ງນີ້",+ "saved_count_one": "{{count}} ໄຟລ໌",+ "saved_count_other": "{{count}} ໄຟລ໌",+ "saved_line": "ບັນທຶກແລ້ວ {{files}} · {{size}}"},"tools": {"tab": "ເຄື່ອງມື",@@ -3248,7 +3257,11 @@"view_downloads": "View downloads","eta_left": "About {{eta}} left","view_history": "ປະຫວັດ",- "view_tools": "ເຄື່ອງມື"+ "view_tools": "ເຄື່ອງມື",+ "leftovers_title": "ລຶບສິ່ງທີ່ການດາວໂຫຼດນີ້ປະໄວ້ບໍ?",+ "leftovers_body": "ການດາວໂຫຼດນີ້ເຫຼືອໄຟລ໌ບໍ່ຄົບ {{count}} ໄຟລ໌, ລວມ {{size}}. ໄຟລ໌ທີ່ສຳເລັດແລ້ວຈະບໍ່ຖືກແຕະຕ້ອງ.",+ "leftovers_keep": "ເອົາອອກ ແລະ ເກັບໄຟລ໌ໄວ້",+ "leftovers_delete": "ເອົາອອກ ແລະ ລຶບໄຟລ໌"},"toast": {"download_preparing": "ກຳລັງກຽມດາວໂຫຼດ...",@@ -3810,7 +3823,8 @@"copy_to_clipboard_on_hotkey_desc": "ສຳເນົາໄຟລ໌ທີ່ດາວໂຫຼດໄປຄລິບບອດອັດຕະໂນມັດ ເພື່ອວາງໄດ້ງ່າຍ","filename_template": "ແມ່ແບບຊື່ໄຟລ໌","filename_template_desc": "ແມ່ແບບຜົນລັບ yt-dlp ສຳລັບໄຟລ໌ທີ່ດາວໂຫຼດ",- "filename_template_preview": "ຕົວຢ່າງ: {{preview}}"+ "filename_template_preview": "ຕົວຢ່າງ: {{preview}}",+ "remove_saved_dir": "Remove"},"update_available": "LibreGet {{version}} ພ້ອມໃຫ້ອັບເດດແລ້ວ","update_button": "ອັບເດດດຽວນີ້",@@ -4375,7 +4389,12 @@},"courses_plugin_needed": "ນີ້ແມ່ນໜ້າຄອສຮຽນ. ປລັກອິນ Courses ຟຣີຈະເຂົ້າສູ່ລະບົບດ້ວຍບັນຊີຂອງທ່ານ ແລະ ດາວໂຫຼດທຸກບົດຮຽນ.","courses_plugin_ready": "ໜ້າຄອສຮຽນຈະຖືກດາວໂຫຼດຈາກແຖບ Courses ໂດຍເຂົ້າສູ່ລະບົບບັນຊີຂອງທ່ານ.",- "install_courses_plugin": "ຮັບປລັກອິນ Courses"+ "install_courses_plugin": "ຮັບປລັກອິນ Courses",+ "video_or_list": "ວິດີໂອນີ້ເປັນສ່ວນໜຶ່ງຂອງລາຍການ. ທ່ານຕ້ອງການດາວໂຫຼດຫຍັງ?",+ "video_or_list_mix": "ວິດີໂອນີ້ເປັນສ່ວນໜຶ່ງຂອງມິກອັດຕະໂນມັດ. ທ່ານຕ້ອງການດາວໂຫຼດຫຍັງ?",+ "video_or_list_video": "ສະເພາະວິດີໂອນີ້",+ "video_or_list_list": "ລາຍການທັງໝົດ",+ "video_or_list_mix_list": "ມິກ"},"about": {"tab": {diff --git a/src/lib/i18n/pt.json b/src/lib/i18n/pt.jsonindex 3ebf6992..61aef1f5 100644--- a/src/lib/i18n/pt.json+++ b/src/lib/i18n/pt.json@@ -65,7 +65,9 @@"section_plugins": "Plugins","expand_plugins": "Expand plugins","collapse_plugins": "Collapse plugins",- "tools": "Ferramentas"+ "tools": "Ferramentas",+ "collapse_sidebar": "Recolher barra lateral",+ "expand_sidebar": "Expandir barra lateral"},"command_palette": {"open": "Search",@@ -87,7 +89,14 @@"action_advanced": "Advanced options","action_simple": "Back to the simple view","value_line": "{{count}} files · {{size}} saved with LibreGet",- "value_first": "Your first download takes about a minute. Private content only needs your browser cookies."+ "value_first": "Your first download takes about a minute. Private content only needs your browser cookies.",+ "more": "Mais formas de baixar",+ "paste": "Colar",+ "paste_empty": "Sua área de transferência não tem nenhum link.",+ "submit": "Baixar este link",+ "saved_count_one": "{{count}} arquivo",+ "saved_count_other": "{{count}} arquivos",+ "saved_line": "{{files}} · {{size}} salvos"},"tools": {"tab": "Ferramentas",@@ -3248,7 +3257,11 @@"view_downloads": "View downloads","eta_left": "About {{eta}} left","view_history": "Histórico",- "view_tools": "Ferramentas"+ "view_tools": "Ferramentas",+ "leftovers_title": "Apagar o que este download deixou para trás?",+ "leftovers_body": "Este download deixou {{count}} arquivo(s) parcial(is), {{size}} no total. Arquivos prontos não são tocados.",+ "leftovers_keep": "Remover e manter os arquivos",+ "leftovers_delete": "Remover e apagar os arquivos"},"toast": {"download_preparing": "Preparando download...",@@ -3810,7 +3823,8 @@"copy_to_clipboard_on_hotkey_desc": "Copiar automaticamente o arquivo baixado para o clipboard para fácil colagem","filename_template": "Template de nome","filename_template_desc": "Template yt-dlp para nome dos arquivos baixados",- "filename_template_preview": "Preview: {{preview}}"+ "filename_template_preview": "Preview: {{preview}}",+ "remove_saved_dir": "Remove"},"update_available": "LibreGet {{version}} está disponível","update_button": "atualizar agora",@@ -4375,7 +4389,12 @@},"courses_plugin_needed": "This is a course page. The free Courses plugin signs in with your account and downloads every lesson.","courses_plugin_ready": "Course pages are downloaded from the Courses tab with your account signed in.",- "install_courses_plugin": "Get the Courses plugin"+ "install_courses_plugin": "Get the Courses plugin",+ "video_or_list": "Este vídeo faz parte de uma lista. O que você quer baixar?",+ "video_or_list_mix": "Este vídeo faz parte de um mix automático. O que você quer baixar?",+ "video_or_list_video": "Só este vídeo",+ "video_or_list_list": "A lista inteira",+ "video_or_list_mix_list": "O mix"},"about": {"tab": {diff --git a/src/lib/i18n/ru.json b/src/lib/i18n/ru.jsonindex 1b613fae..253296cb 100644--- a/src/lib/i18n/ru.json+++ b/src/lib/i18n/ru.json@@ -65,7 +65,9 @@"section_plugins": "Плагины","expand_plugins": "Развернуть плагины","collapse_plugins": "Свернуть плагины",- "tools": "Инструменты"+ "tools": "Инструменты",+ "collapse_sidebar": "Свернуть боковую панель",+ "expand_sidebar": "Развернуть боковую панель"},"command_palette": {"open": "Поиск",@@ -87,7 +89,14 @@"action_advanced": "Расширенные параметры","action_simple": "Вернуться к простому виду","value_line": "{{count}} файлов · {{size}} сохранено с LibreGet",- "value_first": "Первая загрузка займёт около минуты. Для приватного контента нужны только cookies вашего браузера."+ "value_first": "Первая загрузка займёт около минуты. Для приватного контента нужны только cookies вашего браузера.",+ "more": "Другие способы скачать",+ "paste": "Вставить",+ "paste_empty": "В буфере обмена нет ссылки.",+ "submit": "Скачать по ссылке",+ "saved_count_one": "{{count}} файл",+ "saved_count_other": "{{count}} файлов",+ "saved_line": "{{files}} · {{size}} сохранено"},"tools": {"tab": "Инструменты",@@ -3248,7 +3257,11 @@"view_downloads": "View downloads","eta_left": "About {{eta}} left","view_history": "История",- "view_tools": "Инструменты"+ "view_tools": "Инструменты",+ "leftovers_title": "Удалить то, что осталось от этой загрузки?",+ "leftovers_body": "Эта загрузка оставила незавершённые файлы ({{count}}), всего {{size}}. Готовые файлы не затрагиваются.",+ "leftovers_keep": "Убрать, но оставить файлы",+ "leftovers_delete": "Убрать и удалить файлы"},"toast": {"download_preparing": "Подготовка к скачиванию…",@@ -3810,7 +3823,8 @@"copy_to_clipboard_on_hotkey_desc": "Автоматически копировать скачанный файл в буфер обмена для удобной вставки","filename_template": "Шаблон имени файла","filename_template_desc": "Шаблон вывода yt-dlp для скачиваемых файлов",- "filename_template_preview": "Предпросмотр: {{preview}}"+ "filename_template_preview": "Предпросмотр: {{preview}}",+ "remove_saved_dir": "Убрать из списка"},"update_available": "Доступен LibreGet {{version}}","update_button": "обновить сейчас",@@ -4375,7 +4389,12 @@},"courses_plugin_needed": "Это страница курса. Бесплатный плагин «Курсы» войдёт в ваш аккаунт и скачает все уроки.","courses_plugin_ready": "Страницы курсов скачиваются со вкладки «Курсы», когда вы вошли в аккаунт.",- "install_courses_plugin": "Установить плагин «Курсы»"+ "install_courses_plugin": "Установить плагин «Курсы»",+ "video_or_list": "Это видео входит в список. Что скачать?",+ "video_or_list_mix": "Это видео входит в автоматический микс. Что скачать?",+ "video_or_list_video": "Только это видео",+ "video_or_list_list": "Весь список",+ "video_or_list_mix_list": "Микс"},"about": {"tab": {diff --git a/src/lib/i18n/zh-TW.json b/src/lib/i18n/zh-TW.jsonindex af70498b..87565f76 100644--- a/src/lib/i18n/zh-TW.json+++ b/src/lib/i18n/zh-TW.json@@ -65,7 +65,9 @@"section_plugins": "Plugins","expand_plugins": "Expand plugins","collapse_plugins": "Collapse plugins",- "tools": "Tools"+ "tools": "Tools",+ "collapse_sidebar": "收合側邊欄",+ "expand_sidebar": "展開側邊欄"},"command_palette": {"open": "Search",@@ -87,7 +89,14 @@"action_advanced": "Advanced options","action_simple": "Back to the simple view","value_line": "{{count}} files · {{size}} saved with LibreGet",- "value_first": "Your first download takes about a minute. Private content only needs your browser cookies."+ "value_first": "Your first download takes about a minute. Private content only needs your browser cookies.",+ "more": "更多下載方式",+ "paste": "貼上",+ "paste_empty": "剪貼簿裡沒有連結。",+ "submit": "下載此連結",+ "saved_count_one": "{{count}} 個檔案",+ "saved_count_other": "{{count}} 個檔案",+ "saved_line": "已儲存 {{files}} · {{size}}"},"tools": {"tab": "工具",@@ -3248,7 +3257,11 @@"view_downloads": "View downloads","eta_left": "About {{eta}} left","view_history": "History",- "view_tools": "Tools"+ "view_tools": "Tools",+ "leftovers_title": "要刪除這次下載留下的檔案嗎?",+ "leftovers_body": "這次下載留下了 {{count}} 個不完整的檔案,共 {{size}}。已完成的檔案不會受影響。",+ "leftovers_keep": "移除但保留檔案",+ "leftovers_delete": "移除並刪除檔案"},"toast": {"download_preparing": "正在準備下載...",@@ -3810,7 +3823,8 @@"copy_to_clipboard_on_hotkey_desc": "下載完成後自動將檔案複製到剪貼簿,方便貼上","filename_template": "檔名範本","filename_template_desc": "下載檔案使用的 yt-dlp 輸出範本",- "filename_template_preview": "預覽: {{preview}}"+ "filename_template_preview": "預覽: {{preview}}",+ "remove_saved_dir": "Remove"},"update_available": "LibreGet {{version}} 可供更新","update_button": "立即更新",@@ -4375,7 +4389,12 @@},"courses_plugin_needed": "This is a course page. The free Courses plugin signs in with your account and downloads every lesson.","courses_plugin_ready": "Course pages are downloaded from the Courses tab with your account signed in.",- "install_courses_plugin": "Get the Courses plugin"+ "install_courses_plugin": "Get the Courses plugin",+ "video_or_list": "這部影片屬於某個清單。你要下載什麼?",+ "video_or_list_mix": "這部影片屬於自動合輯。你要下載什麼?",+ "video_or_list_video": "只要這部影片",+ "video_or_list_list": "整個清單",+ "video_or_list_mix_list": "整個合輯"},"about": {"tab": {diff --git a/src/lib/i18n/zh.json b/src/lib/i18n/zh.jsonindex a59c1b45..cd3e2cb2 100644--- a/src/lib/i18n/zh.json+++ b/src/lib/i18n/zh.json@@ -65,7 +65,9 @@"section_plugins": "插件","expand_plugins": "展开插件","collapse_plugins": "收起插件",- "tools": "工具"+ "tools": "工具",+ "collapse_sidebar": "收起侧边栏",+ "expand_sidebar": "展开侧边栏"},"command_palette": {"open": "搜索",@@ -87,7 +89,14 @@"action_advanced": "高级选项","action_simple": "回到简洁视图","value_line": "已用 LibreGet 保存 {{count}} 个文件 · {{size}}",- "value_first": "你的第一次下载大约需要一分钟。私有内容只需你的浏览器 cookies。"+ "value_first": "你的第一次下载大约需要一分钟。私有内容只需你的浏览器 cookies。",+ "more": "更多下载方式",+ "paste": "粘贴",+ "paste_empty": "剪贴板里没有链接。",+ "submit": "下载此链接",+ "saved_count_one": "{{count}} 个文件",+ "saved_count_other": "{{count}} 个文件",+ "saved_line": "已保存 {{files}} · {{size}}"},"tools": {"tab": "工具",@@ -3248,7 +3257,11 @@"view_downloads": "View downloads","eta_left": "About {{eta}} left","view_history": "历史记录",- "view_tools": "工具"+ "view_tools": "工具",+ "leftovers_title": "删除此下载留下的文件?",+ "leftovers_body": "此下载留下了 {{count}} 个不完整的文件,共 {{size}}。已完成的文件不会受影响。",+ "leftovers_keep": "移除但保留文件",+ "leftovers_delete": "移除并删除文件"},"toast": {"download_preparing": "正在准备下载...",@@ -3810,7 +3823,8 @@"copy_to_clipboard_on_hotkey_desc": "自动将下载的文件复制到剪贴板以便粘贴","filename_template": "文件名模板","filename_template_desc": "yt-dlp 下载文件的输出模板",- "filename_template_preview": "预览:{{preview}}"+ "filename_template_preview": "预览:{{preview}}",+ "remove_saved_dir": "Remove"},"update_available": "LibreGet {{version}} 可用","update_button": "立即更新",@@ -4375,7 +4389,12 @@},"courses_plugin_needed": "这是一个课程页面。免费的 Courses 插件可用你的账号登录并下载每一节课。","courses_plugin_ready": "课程页面在「课程」标签页中下载,需先登录你的账号。",- "install_courses_plugin": "获取 Courses 插件"+ "install_courses_plugin": "获取 Courses 插件",+ "video_or_list": "此视频属于一个列表。你想下载什么?",+ "video_or_list_mix": "此视频属于一个自动合辑。你想下载什么?",+ "video_or_list_video": "只下载此视频",+ "video_or_list_list": "整个列表",+ "video_or_list_mix_list": "整个合辑"},"about": {"tab": {diff --git a/src/lib/nami/dispatcher.test.ts b/src/lib/nami/dispatcher.test.tsindex 7432705f..12d3898c 100644--- a/src/lib/nami/dispatcher.test.ts+++ b/src/lib/nami/dispatcher.test.ts@@ -53,7 +53,6 @@ describe('nami multi-tier dispatcher', () => {});expect(mockNativeRunner).toHaveBeenCalledTimes(1);- expect(progressSpy).toHaveBeenCalledWith('Switching to gallery-dl engine...', 0);expect(mockGdlRunner).toHaveBeenCalledTimes(1);expect(result.success).toBe(true);expect(result.files_count).toBe(3);diff --git a/src/lib/nami/dispatcher.ts b/src/lib/nami/dispatcher.tsindex 2ef88f52..9f705b25 100644--- a/src/lib/nami/dispatcher.ts+++ b/src/lib/nami/dispatcher.ts@@ -35,7 +35,6 @@ export async function dispatchMultiTierDownload(options: MultiTierOptions): Prom}// Fallback to gallery-dl orchestrator- onProgress?.('Switching to gallery-dl engine...', 0);if (options.gdlRunner) {return await options.gdlRunner();}diff --git a/src/lib/nami/metadata.test.ts b/src/lib/nami/metadata.test.tsnew file mode 100644index 00000000..860595a8--- /dev/null+++ b/src/lib/nami/metadata.test.ts@@ -0,0 +1,75 @@+import { describe, it, expect, vi } from 'vitest';+import { decodeHtmlEntities, resolveCreatorMetadata } from './metadata';+import * as namiApi from '$lib/api/nami';++vi.mock('$lib/api/nami', () => ({+ httpFetch: vi.fn(),+ cacheAvatar: vi.fn(async (url: string) => url),+ resolveFacebookAvatar: vi.fn(async () => null),+}));++describe('nami metadata extraction', () => {+ it('decodes HTML entities properly', () => {+ expect(decodeHtmlEntities('모모 (MOMO)')).toBe('모모 (MOMO)');+ expect(decodeHtmlEntities('A & B @test')).toBe('A & B @test');+ });++ it('extracts Instagram metadata from OpenGraph tags', async () => {+ const mockHtml = `+ <html>+ <head>+ <meta property="og:image" content="https://scontent.cdninstagram.com/avatar.jpg" />+ <meta property="og:title" content="모모 (MOMO) (@momo) • Instagram photos and videos" />+ <meta property="og:description" content="16M Followers, 0 Following, 463 Posts - See Instagram photos and videos" />+ </head>+ </html>+ `;++ vi.mocked(namiApi.httpFetch).mockResolvedValueOnce({+ ok: true,+ status: 200,+ headers: {},+ body: mockHtml,+ });++ const meta = await resolveCreatorMetadata({+ platform: 'instagram',+ username: 'momo',+ cleanUrl: 'https://www.instagram.com/momo/',+ rawInput: 'https://www.instagram.com/momo/',+ isSpecificMedia: false,+ });++ expect(meta).not.toBeNull();+ expect(meta?.name).toBe('모모 (MOMO)');+ expect(meta?.avatar).toBe('https://scontent.cdninstagram.com/avatar.jpg');+ expect(meta?.meta).toContain('16M followers');+ expect(meta?.meta).toContain('463 posts');+ });++ it('extracts X/Twitter metadata from vxtwitter endpoint', async () => {+ vi.mocked(namiApi.httpFetch).mockResolvedValueOnce({+ ok: true,+ status: 200,+ headers: {},+ body: JSON.stringify({+ name: 'OpenAI',+ followers_count: 5000000,+ profile_image_url: 'https://pbs.twimg.com/avatar.jpg',+ }),+ });++ const meta = await resolveCreatorMetadata({+ platform: 'x',+ username: 'OpenAI',+ cleanUrl: 'https://x.com/OpenAI',+ rawInput: 'OpenAI',+ isSpecificMedia: false,+ });++ expect(meta).not.toBeNull();+ expect(meta?.name).toBe('OpenAI');+ expect(meta?.avatar).toBe('https://pbs.twimg.com/avatar.jpg');+ expect(meta?.meta).toContain('5,000,000 followers');+ });+});diff --git a/src/lib/nami/metadata.ts b/src/lib/nami/metadata.tsnew file mode 100644index 00000000..9b76a339--- /dev/null+++ b/src/lib/nami/metadata.ts@@ -0,0 +1,337 @@+import { httpFetch, cacheAvatar, resolveFacebookAvatar } from '$lib/api/nami';+import type { ParsedProfile } from '$lib/utils/nami_parser';++export interface CreatorMetadata {+ platform: string;+ platformName: string;+ name: string;+ handle: string;+ meta: string;+ avatar: string;+ url: string;+}++export function decodeHtmlEntities(str: string): string {+ return str+ .replace(/&#x([0-9a-fA-F]+);/g, (_, hex) => String.fromCharCode(parseInt(hex, 16)))+ .replace(/&#([0-9]+);/g, (_, dec) => String.fromCharCode(parseInt(dec, 10)))+ .replace(/&/g, '&')+ .replace(/"/g, '"')+ .replace(/'/g, "'")+ .replace(/</g, '<')+ .replace(/>/g, '>');+}++export function formatCount(countStr: string): string {+ const match = countStr.match(/([\d.,]+)\s*([KkMmBb])?/i);+ if (!match) return countStr;+ const num = parseFloat(match[1].replace(/,/g, ''));+ const unit = (match[2] || '').toUpperCase();+ if (isNaN(num)) return countStr;+ return `${num}${unit}`;+}++const memoryCache = new Map<string, { meta: CreatorMetadata; time: number }>();+const CACHE_TTL_MS = 24 * 60 * 60 * 1000;++function getCacheKey(platform: string, target: string): string {+ return `${platform.toLowerCase()}:${target.toLowerCase().trim()}`;+}++export function getCachedCreator(platform: string, target: string): CreatorMetadata | null {+ if (!platform || !target) return null;+ const key = getCacheKey(platform, target);+ const mem = memoryCache.get(key);+ if (mem && Date.now() - mem.time < CACHE_TTL_MS) {+ return mem.meta;+ }++ if (typeof localStorage !== 'undefined') {+ try {+ const raw = localStorage.getItem(`nami_creator_${key}`);+ if (raw) {+ const parsed = JSON.parse(raw);+ if (parsed && parsed.meta && Date.now() - parsed.time < CACHE_TTL_MS) {+ memoryCache.set(key, parsed);+ return parsed.meta;+ }+ }+ } catch {}+ }+ return null;+}++export function setCachedCreator(platform: string, target: string, meta: CreatorMetadata): void {+ if (!platform || !target || !meta) return;+ const key = getCacheKey(platform, target);+ const entry = { meta, time: Date.now() };+ memoryCache.set(key, entry);++ if (typeof localStorage !== 'undefined') {+ try {+ localStorage.setItem(`nami_creator_${key}`, JSON.stringify(entry));+ } catch {}+ }+}++export async function resolveCreatorMetadata(p: ParsedProfile): Promise<CreatorMetadata | null> {+ if (!p.username && !p.cleanUrl) return null;++ const target = p.username || p.cleanUrl;+ const cached = getCachedCreator(p.platform, target);+ if (cached && cached.avatar) {+ return cached;+ }++ const platformLabels: Record<string, string> = {+ instagram: 'Instagram',+ tiktok: 'TikTok',+ facebook: 'Facebook',+ x: 'X',+ };+ const platName = platformLabels[p.platform] || p.platform;+ const handle = p.username ? `@${p.username}` : p.cleanUrl;+ let name = p.username || platName;+ let meta = `${handle} • ${platName}`;+ let avatar = '';++ if (p.platform === 'instagram' && p.username) {+ try {+ const res = await httpFetch({+ url: `https://www.instagram.com/${encodeURIComponent(p.username)}/`,+ headers: {+ 'User-Agent': 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',+ 'Accept-Language': 'en-US,en;q=0.9',+ },+ timeout_ms: 6000,+ });++ if (res.ok && res.body) {+ const html = res.body;+ const imgMatch = html.match(/property="og:image"\s+content="([^"]+)"/) || html.match(/content="([^"]+)"\s+property="og:image"/);+ const titleMatch = html.match(/property="og:title"\s+content="([^"]+)"/) || html.match(/content="([^"]+)"\s+property="og:title"/);+ const descMatch = html.match(/property="og:description"\s+content="([^"]+)"/) || html.match(/content="([^"]+)"\s+property="og:description"/);++ if (imgMatch) {+ avatar = decodeHtmlEntities(imgMatch[1]);+ }++ if (titleMatch) {+ const rawTitle = decodeHtmlEntities(titleMatch[1]);+ const nameMatch = rawTitle.match(/^(.+?)\s*\(@/);+ if (nameMatch) {+ name = nameMatch[1].trim();+ }+ }++ if (descMatch) {+ const rawDesc = decodeHtmlEntities(descMatch[1]);+ const followersMatch = rawDesc.match(/([\d.,]+[KkMmBb]?)\s*Followers/i);+ const postsMatch = rawDesc.match(/([\d.,]+[KkMmBb]?)\s*Posts/i);++ const parts = [+ handle,+ 'Instagram',+ followersMatch ? `${followersMatch[1]} followers` : '',+ postsMatch ? `${postsMatch[1]} posts` : '',+ ].filter(Boolean);++ meta = parts.join(' • ');+ }+ }+ } catch {+ // Keep fallbacks+ }+ } else if (p.platform === 'tiktok' && p.username) {+ try {+ const res = await httpFetch({+ url: `https://www.tiktok.com/@${encodeURIComponent(p.username)}`,+ headers: {+ 'User-Agent': 'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)',+ 'Accept-Language': 'en-US,en;q=0.9',+ },+ timeout_ms: 6000,+ });++ if (res.ok && res.body) {+ const html = res.body;+ const imgMatch = html.match(/property="og:image"\s+content="([^"]+)"/) || html.match(/content="([^"]+)"\s+property="og:image"/);+ const titleMatch = html.match(/property="og:title"\s+content="([^"]+)"/) || html.match(/content="([^"]+)"\s+property="og:title"/);+ const descMatch = html.match(/property="og:description"\s+content="([^"]+)"/) || html.match(/content="([^"]+)"\s+property="og:description"/);++ if (imgMatch) {+ avatar = decodeHtmlEntities(imgMatch[1]);+ }++ if (titleMatch) {+ const rawTitle = decodeHtmlEntities(titleMatch[1]);+ const cleanedTitle = rawTitle.replace(/\s+on TikTok$/i, '').trim();+ if (cleanedTitle) {+ name = cleanedTitle;+ }+ }++ if (descMatch) {+ const rawDesc = decodeHtmlEntities(descMatch[1]);+ const followersMatch = rawDesc.match(/([\d.,]+[KkMmBb]?)\s*Followers/i);+ const parts = [+ handle,+ 'TikTok',+ followersMatch ? `${followersMatch[1]} followers` : '',+ ].filter(Boolean);+ meta = parts.join(' • ');+ }+ }+ } catch {+ // Keep fallbacks+ }+ } else if (p.platform === 'facebook' && (p.username || p.cleanUrl)) {+ try {+ const fbTarget = p.username ? `https://www.facebook.com/${encodeURIComponent(p.username)}` : p.cleanUrl;+ const fbResolved = await resolveFacebookAvatar(fbTarget);+ if (fbResolved?.data_url) {+ avatar = fbResolved.data_url;+ if (fbResolved.name) {+ name = fbResolved.name;+ }+ }++ if (!avatar) {+ const res = await httpFetch({+ url: fbTarget,+ headers: {+ 'User-Agent': 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',+ 'Accept-Language': 'en-US,en;q=0.9',+ },+ timeout_ms: 6000,+ });++ if (res.ok && res.body) {+ const html = res.body;+ const imgMatch = html.match(/property="og:image"\s+content="([^"]+)"/) || html.match(/content="([^"]+)"\s+property="og:image"/);+ const titleMatch = html.match(/property="og:title"\s+content="([^"]+)"/) || html.match(/content="([^"]+)"\s+property="og:title"/);+ const descMatch = html.match(/property="og:description"\s+content="([^"]+)"/) || html.match(/content="([^"]+)"\s+property="og:description"/);++ if (imgMatch) {+ const rawImg = decodeHtmlEntities(imgMatch[1]);+ if (!rawImg.includes('lookaside.fbsbx.com')) {+ avatar = rawImg;+ }+ }++ if (titleMatch && !name) {+ const rawTitle = decodeHtmlEntities(titleMatch[1]);+ const cleanedTitle = rawTitle.replace(/\s*\|\s*Facebook$/i, '').trim();+ if (cleanedTitle) {+ name = cleanedTitle;+ }+ }++ if (descMatch) {+ const rawDesc = decodeHtmlEntities(descMatch[1]);+ const followersMatch = rawDesc.match(/([\d.,]+[KkMmBb]?)\s*followers/i);+ const parts = [+ handle,+ 'Facebook',+ followersMatch ? `${followersMatch[1]} followers` : '',+ ].filter(Boolean);+ meta = parts.join(' • ');+ }+ }+ }+ } catch {+ // Keep fallbacks+ }+ } else if (p.platform === 'x' && p.username) {+ try {+ const res = await httpFetch({+ url: `https://api.vxtwitter.com/${encodeURIComponent(p.username)}`,+ headers: {+ 'User-Agent': 'TelegramBot (like TwitterBot)',+ 'Accept': 'application/json',+ },+ timeout_ms: 5000,+ });++ if (res.ok && res.body && !res.body.includes('<!DOCTYPE html>')) {+ const data = JSON.parse(res.body);+ if (data.name) name = data.name;+ if (data.profile_image_url) avatar = data.profile_image_url;+ const followers = data.followers_count ? `${data.followers_count.toLocaleString()} followers` : '';+ const parts = [handle, 'X', followers].filter(Boolean);+ meta = parts.join(' • ');+ }++ if (!avatar) {+ const fxRes = await httpFetch({+ url: `https://api.fxtwitter.com/${encodeURIComponent(p.username)}`,+ headers: {+ 'User-Agent': 'Mozilla/5.0 (compatible; Googlebot/2.1)',+ 'Accept': 'application/json',+ },+ timeout_ms: 5000,+ });+ if (fxRes.ok && fxRes.body && !fxRes.body.includes('<!DOCTYPE html>')) {+ const fxData = JSON.parse(fxRes.body);+ if (fxData.user) {+ if (fxData.user.name) name = fxData.user.name;+ if (fxData.user.avatar_url) avatar = fxData.user.avatar_url;+ const followers = fxData.user.followers ? `${fxData.user.followers.toLocaleString()} followers` : '';+ const parts = [handle, 'X', followers].filter(Boolean);+ meta = parts.join(' • ');+ }+ }+ }++ if (!avatar) {+ const xRes = await httpFetch({+ url: `https://x.com/${encodeURIComponent(p.username)}`,+ headers: {+ 'User-Agent': 'Twitterbot/1.0',+ 'Accept-Language': 'en-US,en;q=0.9',+ },+ timeout_ms: 5000,+ });+ if (xRes.ok && xRes.body) {+ const html = xRes.body;+ const imgMatch = html.match(/property="og:image"\s+content="([^"]+)"/) || html.match(/content="([^"]+)"\s+property="og:image"/);+ const titleMatch = html.match(/property="og:title"\s+content="([^"]+)"/) || html.match(/content="([^"]+)"\s+property="og:title"/);++ if (imgMatch) avatar = decodeHtmlEntities(imgMatch[1]);+ if (titleMatch) {+ const rawTitle = decodeHtmlEntities(titleMatch[1]);+ name = rawTitle.replace(/\s*\(@.+?\)\s*on\s*X$/i, '').trim() || name;+ }+ const parts = [handle, 'X'].filter(Boolean);+ meta = parts.join(' • ');+ }+ }++ if (avatar && avatar.includes('_normal.')) {+ avatar = avatar.replace('_normal.', '_bigger.');+ }+ } catch {+ // Keep fallbacks+ }+ }++ if (avatar) {+ avatar = await cacheAvatar(avatar);+ }++ const resolved: CreatorMetadata = {+ platform: p.platform,+ platformName: platName,+ name,+ handle,+ meta,+ avatar,+ url: p.cleanUrl,+ };++ if (avatar) {+ setCachedCreator(p.platform, target, resolved);+ }++ return resolved;+}diff --git a/src/lib/platform-display-names.ts b/src/lib/platform-display-names.tsindex 5484a5a8..2bb5661b 100644--- a/src/lib/platform-display-names.ts+++ b/src/lib/platform-display-names.ts@@ -22,6 +22,7 @@ export const PLATFORM_DISPLAY_NAMES: Record<string, string> = {metaanalysis: "Meta-Analysis Academy",magnet: "BitTorrent",p2p: "P2P",+ gdocs: "Google Docs / Slides",direct_file: "Direct file",};diff --git a/src/lib/stores/changelog-store.svelte.ts b/src/lib/stores/changelog-store.svelte.tsindex 0f8f5ade..e8bbfaef 100644--- a/src/lib/stores/changelog-store.svelte.ts+++ b/src/lib/stores/changelog-store.svelte.ts@@ -39,7 +39,7 @@ export async function initChangelog(): Promise<void> {try {currentVersion = await getVersion();} catch {- currentVersion = "0.16.10";+ currentVersion = "1.0.0";}const lastSeen = localStorage.getItem(STORAGE_KEY);diff --git a/src/lib/stores/download-store.svelte.ts b/src/lib/stores/download-store.svelte.tsindex 5e744586..a6b5338c 100644--- a/src/lib/stores/download-store.svelte.ts+++ b/src/lib/stores/download-store.svelte.ts@@ -71,6 +71,7 @@ export type GenericDownloadItem = BaseItem & {etaSeconds?: number | null;filePath?: string;fileCount?: number;+ canPause?: boolean;thumbnail_url?: string | null;quality?: string | null;downloadMode?: string | null;@@ -90,6 +91,7 @@ export type GenericProgressExtra = {fragmentIndex?: number | null;fragmentCount?: number | null;plannedFormats?: string[] | null;+ fileCount?: number | null;};export type DownloadItem = CourseDownloadItem | GenericDownloadItem;@@ -425,6 +427,37 @@ export function markGenericComplete(id: number, success: boolean, error?: stringflushNow();}+export function registerGenericDownload(+ id: number,+ title: string,+ platform: string,+ thumbnail_url?: string | null,+ author?: string | null,+ queueKind?: QueueKind,+ canPause?: boolean,+) {+ const now = Date.now();+ downloads.set(id, {+ kind: "generic",+ id,+ name: title,+ platform,+ percent: 0,+ speed: 0,+ downloadedBytes: 0,+ totalBytes: null,+ phase: "archiving",+ status: "downloading",+ startedAt: now,+ lastUpdateAt: now,+ thumbnail_url: thumbnail_url ?? null,+ author: author ?? null,+ queueKind: queueKind ?? "image",+ canPause: canPause ?? (queueKind !== "image" && queueKind !== "generic"),+ });+ flushNow();+}+export function upsertGenericProgress(id: number,title: string,@@ -486,6 +519,7 @@ export function upsertGenericProgress(fragmentIndex: extra?.fragmentIndex ?? prev?.fragmentIndex ?? null,fragmentCount: extra?.fragmentCount ?? prev?.fragmentCount ?? null,plannedFormats: extra?.plannedFormats ?? prev?.plannedFormats ?? null,+ fileCount: extra?.fileCount !== undefined ? (extra.fileCount ?? undefined) : prev?.fileCount,});if (resolvedStatus === "downloading") {diff --git a/src/lib/stores/nami_download_store.svelte.ts b/src/lib/stores/nami_download_store.svelte.tsindex 6f8e607e..8c3ec6b3 100644--- a/src/lib/stores/nami_download_store.svelte.ts+++ b/src/lib/stores/nami_download_store.svelte.ts@@ -8,6 +8,11 @@ import {} from "$lib/api/nami";import { parseProfileUrl } from "$lib/utils/nami_parser";import { dispatchMultiTierDownload } from "$lib/nami/dispatcher";+import {+ registerGenericDownload,+ upsertGenericProgress,+ markGenericComplete,+} from "$lib/stores/download-store.svelte";export type StatusType = "success" | "error" | "info";@@ -17,24 +22,44 @@ export interface NamiDraft {selectedProfileUrl: string | null;}+export interface CreatorMetaSnapshot {+ name: string;+ handle: string;+ avatar?: string;+ platform: string;+ platformName?: string;+}++interface ActiveNamiTask {+ queueId: number;+ downloadId: string;+ title: string;+ platform: string;+ filesDownloaded: number;+ stage: string | null;+ stageIndex: number | null;+ stageTotal: number | null;+ lastMessage: string;+ unlisten?: () => void;+}+let draft = $state<NamiDraft>({url: "",contentType: "all",selectedProfileUrl: null,});-let active = $state(false);-let downloadId = $state<string | null>(null);-let filesDownloaded = $state(0);-let stage = $state<string | null>(null);-let stageIndex = $state<number | null>(null);-let stageTotal = $state<number | null>(null);-let lastMessage = $state("");+const activeTasks = new Map<string, ActiveNamiTask>();+let activeCount = $state(0);+let latestFilesDownloaded = $state(0);+let latestStage = $state<string | null>(null);+let latestStageIndex = $state<number | null>(null);+let latestStageTotal = $state<number | null>(null);+let latestMessage = $state("");let status = $state("");let statusType = $state<StatusType>("info");let statusDetail = $state("");let cancelling = $state(false);-let unlisten: (() => void) | null = null;export function getDraft(): NamiDraft {return draft;@@ -47,31 +72,32 @@ export function setDraft(newDraft: Partial<NamiDraft>) {}export function isActive(): boolean {- return active;+ return activeCount > 0;}export function getDownloadId(): string | null {- return downloadId;+ const first = activeTasks.keys().next();+ return first.done ? null : first.value;}export function getFilesDownloaded(): number {- return filesDownloaded;+ return latestFilesDownloaded;}export function getStage(): string | null {- return stage;+ return latestStage;}export function getStageIndex(): number | null {- return stageIndex;+ return latestStageIndex;}export function getStageTotal(): number | null {- return stageTotal;+ return latestStageTotal;}export function getLastMessage(): string {- return lastMessage;+ return latestMessage;}export function getStatus(): string {@@ -96,42 +122,13 @@ export function clearStatus() {statusDetail = "";}-function applyProgress(progressData: DownloadProgress) {- if (progressData.message && progressData.message.trim()) {- lastMessage = progressData.message.trim();- }- if (typeof progressData.files_downloaded === "number" && progressData.files_downloaded >= 0) {- filesDownloaded = progressData.files_downloaded;- }- if (progressData.stage) {- stage = progressData.stage;- }- if (typeof progressData.stage_index === "number") {- stageIndex = progressData.stage_index;- }- if (typeof progressData.stage_total === "number") {- stageTotal = progressData.stage_total;- }-}--function resetProgressState() {- filesDownloaded = 0;- stage = null;- stageIndex = null;- stageTotal = null;- lastMessage = "";-}-export async function startDownload(url: string,outputDir: string,cookiesFile: string,contentType: string,+ creatorMeta?: CreatorMetaSnapshot | null,): Promise<DownloadResult | null> {- if (active) {- throw new Error("A download is already in progress");- }-const parsed = parseProfileUrl(url.trim());const cleanUrl = parsed.cleanUrl || url.trim();const cleanOutputDir = outputDir.trim();@@ -144,18 +141,81 @@ export async function startDownload(return null;}- cancelling = false;- active = true;- resetProgressState();- status = "Starting download...";- statusType = "info";- statusDetail = "";+ const qId = Date.now() + Math.floor(Math.random() * 1000);+ const id = String(qId);+ const currentPlatform = creatorMeta?.platform || parsed.platform || "nami";+ const currentTitle = creatorMeta?.name+ ? `${creatorMeta.name} (${creatorMeta.handle}) - ${creatorMeta.platformName || currentPlatform} Profile Archive`+ : `${cleanUrl} - Profile Archive`;++ registerGenericDownload(+ qId,+ currentTitle,+ currentPlatform,+ creatorMeta?.avatar || null,+ creatorMeta?.handle || null,+ "image",+ );++ const task: ActiveNamiTask = {+ queueId: qId,+ downloadId: id,+ title: currentTitle,+ platform: currentPlatform,+ filesDownloaded: 0,+ stage: null,+ stageIndex: null,+ stageTotal: null,+ lastMessage: "",+ };++ activeTasks.set(id, task);+ activeCount = activeTasks.size;++ let taskUnlisten: (() => void) | null = null;+ try {+ taskUnlisten = await listenToDownloadProgress(id, (progressData: DownloadProgress) => {+ if (progressData.message && progressData.message.trim()) {+ task.lastMessage = progressData.message.trim();+ latestMessage = task.lastMessage;+ }+ if (typeof progressData.files_downloaded === "number" && progressData.files_downloaded >= 0) {+ task.filesDownloaded = progressData.files_downloaded;+ latestFilesDownloaded = task.filesDownloaded;+ }+ if (progressData.stage) {+ task.stage = progressData.stage;+ latestStage = task.stage;+ }+ if (typeof progressData.stage_index === "number") {+ task.stageIndex = progressData.stage_index;+ latestStageIndex = task.stageIndex;+ }+ if (typeof progressData.stage_total === "number") {+ task.stageTotal = progressData.stage_total;+ latestStageTotal = task.stageTotal;+ }- const id = generateDownloadId();- downloadId = id;+ const percent = 0;+ const stagePrefix = task.stageTotal && task.stageTotal > 1 && task.stageIndex !== null+ ? `[${task.stageIndex}/${task.stageTotal}] `+ : "";++ upsertGenericProgress(+ qId,+ task.title,+ task.platform,+ percent,+ 0,+ 0,+ null,+ stagePrefix + (progressData.message || "Archiving profile..."),+ null,+ { fileCount: task.filesDownloaded },+ );+ });+ task.unlisten = taskUnlisten;- try {- unlisten = await listenToDownloadProgress(id, applyProgress);const result = await dispatchMultiTierDownload({profile: parsed,cleanOutputDir,@@ -164,63 +224,59 @@ export async function startDownload(downloadId: id,onProgress: (msg) => {status = msg;- lastMessage = msg;+ task.lastMessage = msg;+ latestMessage = msg;},});- filesDownloaded = result.files_count;-if (result.cancelled) {- status = `Download cancelled: ${result.files_count} file(s) saved before stopping.`;- statusType = "info";- statusDetail = "";+ markGenericComplete(qId, false, "Download cancelled", cleanOutputDir, result.files_count);} else if (result.success) {- status = `Downloaded ${result.files_count} file(s) successfully!`;- statusType = "success";- statusDetail = "";+ markGenericComplete(qId, true, undefined, cleanOutputDir, result.files_count);} else {const lines = (result.message || "Download failed").split("\n");- status = lines[0] || "Download failed";- statusType = "error";- statusDetail = lines.length > 1 ? lines.slice(1).join("\n") : "";+ const errHeader = lines[0] || "Download failed";+ markGenericComplete(qId, false, errHeader, cleanOutputDir, result.files_count);}return result;} catch (error: unknown) {const msg = error instanceof Error ? error.message : String(error);- status = `Download failed: ${msg}`;- statusType = "error";- statusDetail = "";+ markGenericComplete(qId, false, msg, cleanOutputDir, 0);return null;} finally {- active = false;- cancelling = false;- if (unlisten) {+ if (taskUnlisten) {try {- unlisten();- } catch {- // ignore- }- unlisten = null;+ taskUnlisten();+ } catch {}}- downloadId = null;+ activeTasks.delete(id);+ activeCount = activeTasks.size;}}-export async function stopDownload() {- if (!active || !downloadId) return;- if (cancelling) return;+export async function stopDownload(targetId?: string) {+ if (targetId) {+ const task = activeTasks.get(targetId);+ if (task) {+ markGenericComplete(task.queueId, false, "Download cancelled");+ try {+ await cancelDownload(targetId);+ } catch (error) {+ console.error(`Failed to cancel download ${targetId}:`, error);+ }+ }+ return;+ }cancelling = true;- status = "Cancelling download...";- statusType = "info";-- try {- await cancelDownload(downloadId);- } catch (error) {- console.error("Failed to cancel download:", error);- status = `Failed to cancel: ${error}`;- statusType = "error";- cancelling = false;+ for (const [id, task] of activeTasks) {+ markGenericComplete(task.queueId, false, "Download cancelled");+ try {+ await cancelDownload(id);+ } catch (error) {+ console.error(`Failed to cancel download ${id}:`, error);+ }}+ cancelling = false;}diff --git a/src/lib/stores/settings-store.svelte.ts b/src/lib/stores/settings-store.svelte.tsindex 1923bbf8..911008c7 100644--- a/src/lib/stores/settings-store.svelte.ts+++ b/src/lib/stores/settings-store.svelte.ts@@ -8,6 +8,7 @@ export type AppSettings = {};download: {default_output_dir: string;+ saved_output_dirs?: string[];always_ask_path: boolean;video_quality: string;skip_existing: boolean;diff --git a/src/lib/style/macos-shell.css b/src/lib/style/macos-shell.cssindex 25371b07..e2373bac 100644--- a/src/lib/style/macos-shell.css+++ b/src/lib/style/macos-shell.css@@ -73,6 +73,11 @@min-width: 0;}+.mac-titlebar-center .segmented-btn {+ height: 28px;+ min-width: 28px;+}+.mac-titlebar-actions {display: flex;align-items: center;@@ -232,6 +237,9 @@.mac-source-list {width: var(--sidebar-width);min-width: var(--sidebar-width);+ transition:+ width 200ms var(--ease-out),+ min-width 200ms var(--ease-out);display: flex;flex-direction: column;background: transparent;@@ -279,8 +287,8 @@display: flex;align-items: center;gap: 10px;- height: 32px;- padding: 0 var(--space-2);+ height: 36px;+ padding: 0 var(--space-2) 0 6px;border-radius: var(--radius-md);color: var(--text);font-size: var(--text-base);@@ -381,6 +389,49 @@padding-top: var(--space-3);}+[data-shell="mac"][data-sidebar="collapsed"],+[data-sidebar="collapsed"] {+ --sidebar-width: 64px;+}++[data-sidebar="collapsed"] .mac-nav-label,+[data-sidebar="collapsed"] .mac-nav-badge,+[data-sidebar="collapsed"] .mac-plugins-toggle {+ display: none;+}++[data-sidebar="collapsed"] .mac-nav-section-header {+ font-size: 0;+ min-height: 0;+ height: 1px;+ width: 24px;+ margin: 0 auto var(--space-2);+ padding: 0;+ background: var(--separator, var(--content-border));+}++[data-sidebar="collapsed"] .mac-nav-section-header > * {+ display: none;+}++[data-sidebar="collapsed"] .mac-nav-item {+ justify-content: center;+ padding: 0;+ height: 44px;+}++[data-sidebar="collapsed"] .mac-nav-item:has(.mac-nav-badge.live)::after {+ content: "";+ position: absolute;+ top: 7px;+ right: 10px;+ width: 8px;+ height: 8px;+ border-radius: 50%;+ background: var(--accent);+ box-shadow: 0 0 0 2px var(--sidebar-bg, var(--bg));+}+/* Narrow windows: icon-only rail */@media (max-width: 860px) {[data-shell="mac"] {@@ -389,25 +440,32 @@.mac-nav-label,.mac-nav-section-header,- .mac-nav-badge {+ .mac-nav-badge,+ .mac-plugins-toggle {display: none;}.mac-nav-item {justify-content: center;padding: 0;- height: 34px;+ height: 36px;}.mac-nav-item :global(.nav-tile) {--tile-size: 26px;}- .mac-nav-item :global(.nav-moscat) {+ .mac-nav-item :global(.nav-penguin) {--icon-size: 26px;}}+@media (prefers-reduced-motion: reduce) {+ .mac-source-list {+ transition: none;+ }+}+/* ---------- Content pane ---------- */.mac-pane {@@ -426,6 +484,7 @@margin-inline: 0 var(--pane-inset);overflow: hidden;position: relative;+ isolation: isolate;}/* Plugin surfaces expect to be flex children of a column that fills the pane@@ -437,6 +496,8 @@flex-direction: column;overflow-y: auto;overscroll-behavior: contain;+ transform: translateZ(0);+ will-change: scroll-position;}.mac-content {@@ -944,6 +1005,46 @@gap: 0;}+.home-mac {+ position: relative;+ isolation: isolate;+ display: flex;+ flex-direction: column;+ flex: 1;+ min-height: 0;+ width: 100%;+}++.home-backdrop {+ position: absolute;+ inset: 0;+ z-index: -1;+ pointer-events: none;+ overflow: hidden;+}++.home-backdrop::before {+ content: "";+ position: absolute;+ left: 50%;+ top: clamp(28px, 17vh, 190px);+ width: min(820px, 110%);+ aspect-ratio: 1.5;+ transform: translate(-50%, -38%);+ border-radius: 50%;+ background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 17%, transparent), transparent 72%);+}++.home-backdrop::after {+ content: "";+ position: absolute;+ inset: 0;+ background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1.2px);+ background-size: 22px 22px;+ -webkit-mask-image: radial-gradient(ellipse 55% 42% at 50% 30%, #000 20%, transparent 75%);+ mask-image: radial-gradient(ellipse 55% 42% at 50% 30%, #000 20%, transparent 75%);+}+.home-stage {flex: 1;min-height: 0;@@ -952,16 +1053,15 @@align-items: center;justify-content: flex-start;position: relative;- padding: var(--space-6) var(--space-5);+ padding: clamp(28px, 17vh, 190px) 20px 48px;overflow-x: hidden;overflow-y: auto;isolation: isolate;}.home-stage-inner {- margin: auto 0;width: 100%;- max-width: 560px;+ max-width: 620px;display: flex;flex-direction: column;align-items: center;@@ -982,20 +1082,9 @@opacity: 0.78;}-/* one warm light behind the mascot — the single decorative moment of the page */+/* one warm light behind the mascot — handled by home-backdrop to match OmniGet */.home-stage-hero::before {- content: "";- position: absolute;- top: 50%;- left: 50%;- width: min(560px, 100%);- aspect-ratio: 1.4;- transform: translate(-50%, -50%);- border-radius: 50%;- background: radial-gradient(closest-side, var(--accent-glow), transparent 70%);- opacity: 0.9;- pointer-events: none;- z-index: -1;+ display: none;}.home-secondary {@@ -1054,7 +1143,7 @@.home-mac-hero {flex-shrink: 0;width: 100%;- max-width: 560px;+ max-width: 620px;padding: 0 0 var(--space-3);display: flex;align-items: flex-end;@@ -1067,7 +1156,7 @@flex-shrink: 0;width: 100%;min-width: 0;- max-width: 560px;+ max-width: 620px;display: flex;flex-direction: column;align-items: center;@@ -1079,3 +1168,20 @@margin-bottom: var(--space-1);}+.stats-line {+ align-self: center;+ font-size: var(--text-sm);+ font-variant-numeric: tabular-nums;+ color: var(--text-dim);+ text-decoration: none;+ padding: 2px 10px;+ border-radius: var(--radius-full);+ transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);+}++.stats-line:hover {+ color: var(--text-muted);+ background: var(--fill-1);+}++diff --git a/src/lib/style/settings.css b/src/lib/style/settings.cssindex 73f7bccf..d2a82a92 100644--- a/src/lib/style/settings.css+++ b/src/lib/style/settings.css@@ -94,7 +94,11 @@gap: var(--space-3);}-.settings-panel + .settings-panel {+.settings-panel.is-hidden {+ display: none !important;+}++.settings-panel:not(.is-hidden) ~ .settings-panel:not(.is-hidden) {margin-top: var(--space-6);}@@ -794,13 +798,12 @@box-shadow: inset 0 0 0 var(--hairline) var(--content-border);}-/* No overflow:hidden here: it clipped the per-row "…" menu (issue #222). */-.deps-table thead th:first-child {- border-top-left-radius: calc(var(--radius-lg) - 1px);-}--.deps-table thead th:last-child {- border-top-right-radius: calc(var(--radius-lg) - 1px);+/* Dependencies table */+.deps-table-wrap {+ border-radius: var(--radius-lg);+ background: var(--surface);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ padding: 0 var(--space-3);}.deps-table {@@ -815,7 +818,7 @@}.deps-table th {- padding: var(--space-2) var(--space-3);+ padding: var(--space-3) var(--space-2);text-align: left;font-size: var(--text-xs);font-weight: 600;@@ -825,47 +828,53 @@border-bottom: var(--hairline) solid var(--separator);}+.deps-table td {+ padding: var(--space-2) var(--space-2);+ vertical-align: middle;+ min-height: var(--row-base);+}+.deps-table th:first-child,-.deps-table :global(.deps-cell-name) {+.deps-table .deps-cell-name {width: 18%;+ padding-left: 0;}.deps-table th:nth-child(2),-.deps-table :global(.deps-cell-version) {- width: 22%;+.deps-table .deps-cell-version {+ width: 20%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;color: var(--text-dim);font-variant-numeric: tabular-nums;+ padding-left: var(--space-2);+ padding-right: var(--space-2);}.deps-table th:nth-child(3),-.deps-table :global(.deps-cell-status) {+.deps-table .deps-cell-status {width: 18%;+ padding-left: var(--space-2);+ padding-right: var(--space-2);}.deps-table th.deps-col-action,-.deps-table :global(.deps-cell-action) {- width: 42%;+.deps-table .deps-cell-action {+ width: 44%;text-align: right;white-space: nowrap;+ padding-right: 0;}-.deps-table :global(.deps-table-row) {+.deps-table .deps-table-row {border-bottom: var(--hairline) solid var(--separator);}-.deps-table :global(.deps-table-row:last-child) {+.deps-table .deps-table-row:last-child {border-bottom: none;}-.deps-table :global(td) {- padding: var(--space-2) var(--space-3);- vertical-align: middle;- min-height: var(--row-base);-}-.dep-ok {color: var(--success);}diff --git a/src/lib/tools/catalog.ts b/src/lib/tools/catalog.tsindex 73be4d2a..c00c2c5d 100644--- a/src/lib/tools/catalog.ts+++ b/src/lib/tools/catalog.ts@@ -346,8 +346,16 @@ export type IndexedTool = {* texto de cada ferramenta, então "instagram" acha tudo de Instagram mesmo* que a ferramenta não repita a palavra.*/+let cachedIndex: IndexedTool[] | null = null;+let cachedSampleName: string | null = null;+export function buildIndex(t: Translate): IndexedTool[] {- return TOOLS.map((tool) => {+ const sample = t("tools.catalog.yt-download.name");+ if (cachedIndex && cachedSampleName === sample) {+ return cachedIndex;+ }+ cachedSampleName = sample;+ cachedIndex = TOOLS.map((tool) => {const cat = categoryById(tool.category);const name = t(`tools.catalog.${tool.id}.name`);const desc = t(`tools.catalog.${tool.id}.desc`);@@ -355,6 +363,7 @@ export function buildIndex(t: Translate): IndexedTool[] {const parts = [name, desc, catName, ...tool.keywords, ...(cat?.keywords ?? []), ...tool.platforms];return { tool, name, desc, hay: normalize(parts.join(" ")) };});+ return cachedIndex;}/** Todas as palavras da busca precisam aparecer, em qualquer ordem. */diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelteindex 8d108b80..67140bb6 100644--- a/src/routes/+layout.svelte+++ b/src/routes/+layout.svelte@@ -61,15 +61,6 @@let badgeLabel = $derived(counts.badge > 99 ? "99+" : String(counts.badge));let settings = $derived(getSettings());- let isCoreRoute = $derived(- page.url.pathname === "/" ||- page.url.pathname.startsWith("/downloads") ||- page.url.pathname.startsWith("/settings") ||- page.url.pathname.startsWith("/marketplace") ||- page.url.pathname.startsWith("/about") ||- page.url.pathname.startsWith("/nami"),- );-let isFlushRoute = $derived(page.url.pathname === "/" ||page.url.pathname.startsWith("/downloads") ||@@ -348,13 +339,49 @@} catch {}}+ const SIDEBAR_KEY = "libreget.sidebar.collapsed";+ let sidebarCollapsed = $state(+ typeof localStorage === "undefined"+ ? false+ : localStorage.getItem(SIDEBAR_KEY) === "1",+ );++ $effect(() => {+ document.documentElement.setAttribute("data-sidebar", sidebarCollapsed ? "collapsed" : "expanded");+ });++ function toggleSidebar() {+ sidebarCollapsed = !sidebarCollapsed;+ try {+ localStorage.setItem(SIDEBAR_KEY, sidebarCollapsed ? "1" : "0");+ } catch {}+ }++ function onSidebarShortcut(e: KeyboardEvent) {+ if (e.key.toLowerCase() !== "s" || e.altKey) return;+ if ((e.ctrlKey || e.metaKey) && e.shiftKey) {+ e.preventDefault();+ toggleSidebar();+ }+ }+onMount(() => {void checkAutoVacuum();});</script>+<svelte:window onkeydown={onSidebarShortcut} />+<div class="shell" data-reduce-motion={settings?.accessibility?.reduce_motion} data-reduce-transparency={settings?.accessibility?.reduce_transparency}>- <AppSidebar {primaryNav} {appNav} {pluginNav} {badgeLabel} />+ <AppSidebar+ {primaryNav}+ {appNav}+ {pluginNav}+ {badgeLabel}+ badgeCount={counts.badge}+ collapsed={sidebarCollapsed}+ onToggleCollapsed={toggleSidebar}+ /><div class="shell-body"><AppToolbar />@@ -416,15 +443,9 @@<main id="main-content" class="content"><div class="mac-pane" class:mac-pane--flush={isFlushRoute}>- {#if isCoreRoute}- <div class="core-shell" class:core-shell--flush={isFlushRoute}>- {@render children()}- </div>- {:else}- <div class="mac-pane-scroll">- {@render children()}- </div>- {/if}+ <div class="mac-pane-scroll core-shell" class:core-shell--flush={isFlushRoute}>+ {@render children()}+ </div></div><GlobalDownloadBar /></main>@@ -500,6 +521,9 @@width: 100%;margin: 0;overflow-y: auto;+ overscroll-behavior-y: contain;+ transform: translateZ(0);+ will-change: scroll-position;}.core-shell--flush {diff --git a/src/routes/+page.svelte b/src/routes/+page.svelteindex d8a93827..f31b244f 100644--- a/src/routes/+page.svelte+++ b/src/routes/+page.svelte@@ -8,6 +8,7 @@import QualityPicker from "$components/librebox/QualityPicker.svelte";import FormatSelector from "$components/librebox/FormatSelector.svelte";import CookieAccountPicker from "$components/librebox/CookieAccountPicker.svelte";+ import OutputLocationPicker from "$components/librebox/OutputLocationPicker.svelte";import LibreboxAdvanced from "$components/librebox/LibreboxAdvanced.svelte";import MediaPreview from "$components/librebox/MediaPreview.svelte";import BatchDownload from "$components/librebox/BatchDownload.svelte";@@ -17,16 +18,20 @@import HomeHero from "$components/home/HomeHero.svelte";import HomeUrlBar from "$components/home/HomeUrlBar.svelte";import HomeInspector from "$components/home/HomeInspector.svelte";+ import VideoOrListChoice from "$components/home/VideoOrListChoice.svelte";+ import { videoOrListLink } from "$lib/home/video-or-list";import {type LibreState,type PlatformInfo,type SearchResult,type HomeInputMode,+ type MoreAction,showInspectorForState,showLibreboxForState,isUrl,extractUrls,} from "$lib/home/librebox-controller";+ import { pluralKey } from "$lib/home/plural";import { getDownloads, formatBytes } from "$lib/stores/download-store.svelte";import { getDownloadStats } from "$lib/stores/download-stats.svelte";import { getSettings, updateSettings } from "$lib/stores/settings-store.svelte";@@ -66,11 +71,13 @@const COURSE_PLATFORMS = new Set(["hotmart", "udemy"]);let url = $state(getLibreboxDraftUrl());+ let urlInput = $state<HTMLInputElement | null>(null);let homeInputMode = $state<HomeInputMode>("url");let libreState = $state<LibreState>({ kind: "idle" });let debounceTimer = $state<ReturnType<typeof setTimeout> | null>(null);let downloadMode = $state<"auto" | "audio" | "mute">("auto");let selectedQuality = $state("best");+ let selectedOutputDir = $state("");let clipStart = $state("");let clipEnd = $state("");let scheduleAt = $state("");@@ -78,6 +85,8 @@let playlistEntries = $state<{ index: number; title: string; url: string }[]>([]);let selectedPlaylistItems = $state<Set<number>>(new Set());let playlistLoading = $state(false);+ let listChoice = $state<"video" | "list">("video");+ let videoOrList = $derived(videoOrListLink(url.trim()));let torrentEntries = $state<{ index: number; path: string; size_bytes: number }[]>([]);let selectedTorrentFiles = $state<Set<number>>(new Set());let torrentLoading = $state(false);@@ -456,7 +465,7 @@if (url.trim() !== value) return;if (result.supported) {loadCookieAccounts(value);- if (result.content_type === "playlist") {+ if (result.content_type === "playlist" && !videoOrListLink(value)) {loadPlaylistEntries(value);}if (isTorrentUrl(value)) {@@ -523,6 +532,17 @@selectedPlaylistItems = new Set();}+ function chooseVideoOrList(next: "video" | "list") {+ listChoice = next;+ if (next === "list" && playlistEntries.length === 0 && !playlistLoading) {+ loadPlaylistEntries(url.trim());+ }+ }++ function wantsList(info: PlatformInfo): boolean {+ return info.content_type === "playlist" && (!videoOrList || listChoice === "list");+ }+function isTorrentUrl(value: string): boolean {const v = value.trim().toLowerCase();return v.startsWith("magnet:") || v.endsWith(".torrent");@@ -712,7 +732,7 @@return;}- const isPlaylist = info.content_type === "playlist" && playlistEntries.length > 0;+ const isPlaylist = wantsList(info) && playlistEntries.length > 0;if (isPlaylist && selectedPlaylistItems.size === 0) {showToast("error", $t("librebox.playlist_none_selected") as string);return;@@ -725,15 +745,21 @@}const settings = getSettings();- let outputDir = settings?.download.default_output_dir ?? "";-- if ((settings?.download.always_ask_path && !settings?.download.auto_download_on_paste) || !outputDir) {+ const hasExplicitOutputDir = !!selectedOutputDir;+ let outputDir = selectedOutputDir || settings?.download.default_output_dir || "";++ if (+ (!hasExplicitOutputDir &&+ settings?.download.always_ask_path &&+ !settings?.download.auto_download_on_paste) ||+ !outputDir+ ) {const selected = await open({directory: true,title: $t("settings.download.default_output_dir"),});if (!selected) return;- outputDir = selected;+ outputDir = selected as string;}const currentUrl = url.trim();@@ -827,15 +853,21 @@const batchUrls = libreState.urls;const settings = getSettings();- let outputDir = settings?.download.default_output_dir ?? "";-- if ((settings?.download.always_ask_path && !settings?.download.auto_download_on_paste) || !outputDir) {+ const hasExplicitOutputDir = !!selectedOutputDir;+ let outputDir = selectedOutputDir || settings?.download.default_output_dir || "";++ if (+ (!hasExplicitOutputDir &&+ settings?.download.always_ask_path &&+ !settings?.download.auto_download_on_paste) ||+ !outputDir+ ) {const selected = await open({directory: true,title: $t("settings.download.default_output_dir"),});if (!selected) return;- outputDir = selected;+ outputDir = selected as string;}// B34: conferir antes de enfileirar. Sem isto, uma URL sem suporte ou@@ -899,15 +931,21 @@p2pReceiveUrl = "";const settings = getSettings();- let outputDir = settings?.download.default_output_dir ?? "";-- if ((settings?.download.always_ask_path && !settings?.download.auto_download_on_paste) || !outputDir) {+ const hasExplicitOutputDir = !!selectedOutputDir;+ let outputDir = selectedOutputDir || settings?.download.default_output_dir || "";++ if (+ (!hasExplicitOutputDir &&+ settings?.download.always_ask_path &&+ !settings?.download.auto_download_on_paste) ||+ !outputDir+ ) {const selected = await open({directory: true,title: $t("settings.download.default_output_dir"),});if (!selected) return;- outputDir = selected;+ outputDir = selected as string;}libreState = { kind: "preparing", platform: "p2p" };@@ -991,6 +1029,32 @@}}+ function handleHomeMoreAction(action: MoreAction) {+ if (action === "advanced") {+ advancedMode = true;+ } else {+ handleHomeModeChange(action);+ }+ }++ function handleSubmit() {+ if (debounceTimer) {+ clearTimeout(debounceTimer);+ debounceTimer = null;+ }+ const trimmed = url.trim();+ if (!trimmed) return;+ if (libreState.kind === "detected") {+ void handleAction();+ } else {+ const urls = extractUrls(trimmed);+ if (urls.length === 1) {+ libreState = { kind: "detecting" };+ detectPlatform(urls[0]);+ }+ }+ }+function handleDismiss() {clearMediaPreview();libreState = { kind: "idle" };@@ -999,6 +1063,7 @@</script><div class="home-mac" class:home-mac--stage={isStage}>+ <div class="home-backdrop" aria-hidden="true"></div>{#if advancedMode}<div class="home-mac-workspace"><div class="home-mac-hero">@@ -1051,21 +1116,21 @@{#if showLibrebox}<HomeUrlBar- variant="stage"bind:urlbind:mode={homeInputMode}+ bind:inputEl={urlInput}+ busy={libreState.kind === "detecting" || libreState.kind === "searching"}+ busyLabel={libreState.kind === "detecting" ? $t('librebox.detecting') : libreState.kind === "searching" ? $t('librebox.searching') : ""}+ showSubmit={libreState.kind === "detected" || (libreState.kind === "idle" && url.trim().length > 0)}onInput={handleInput}+ onSubmit={handleSubmit}+ onMore={handleHomeMoreAction}onModeChange={handleHomeModeChange}onAdvanced={() => { advancedMode = true; }}/>{/if}- {#if libreState.kind === "detecting"}- <div class="feedback feedback-enter">- <span class="feedback-text">{$t('librebox.detecting')}</span>- </div>-- {:else if libreState.kind === "detected"}+ {#if libreState.kind === "detected"}<div class="feedback feedback-enter" data-supported="true"><span class="feedback-text">{platformDisplayName(libreState.info.platform)}</span></div>@@ -1078,6 +1143,16 @@</button></div>+ {:else if libreState.kind === "idle" && !addedNoticeActive}+ {#if dlStats.totalDownloads > 0}+ <a href="/downloads" class="stats-line">+ {$t("home.saved_line", {+ files: $t(pluralKey("home.saved_count", dlStats.totalDownloads), { count: dlStats.totalDownloads.toLocaleString() }),+ size: formatBytes(dlStats.totalBytes),+ })}+ </a>+ {/if}+{:else if libreState.kind === "batch"}<div class="batch-options"><DownloadModeSelector bind:downloadMode />@@ -1115,7 +1190,14 @@<HomeInspector open={showInspector} title={$t('home.inspector_title')}>{#if libreState.kind === "detected"}<MediaPreview bind:mediaPreview bind:imageLoading={previewImageLoading} />- {#if libreState.info.content_type === "playlist"}+ {#if libreState.info.content_type === "playlist" && videoOrList}+ <VideoOrListChoice+ choice={listChoice}+ isMix={videoOrList.isMix}+ onChoose={chooseVideoOrList}+ />+ {/if}+ {#if wantsList(libreState.info)}<div class="playlist-picker"><div class="playlist-head"><span class="playlist-count">@@ -1192,7 +1274,7 @@<button class="download-primary-btn" onclick={handleAction}>{$t(libreState.info.platform === "udemy" ? 'librebox.go_to_udemy' : 'librebox.go_to_hotmart')}</button>{/if}{:else}- {@const playlistBlocked = libreState.info.content_type === "playlist" && playlistEntries.length > 0 && selectedPlaylistItems.size === 0}+ {@const playlistBlocked = wantsList(libreState.info) && playlistEntries.length > 0 && selectedPlaylistItems.size === 0}{@const torrentBlocked = torrentEntries.length > 0 && selectedTorrentFiles.size === 0}{#if libreState.info.platform === "bilibili"}<BilibiliPreviewExtras {url} accountSlug={selectedCookieSlug && selectedCookieSlug !== "_anonymous" ? selectedCookieSlug : null} />@@ -1206,6 +1288,7 @@{#if downloadMode !== "audio"}<QualityPicker bind:selectedQuality {selectedFormatId} {availableHeights} {hasAudioOnly} />{/if}+ <OutputLocationPicker bind:selectedOutputDir />{#if cookieAccounts.length > 1}<CookieAccountPicker accounts={cookieAccounts} bind:selectedSlug={selectedCookieSlug} />{/if}diff --git a/src/routes/downloads/+page.svelte b/src/routes/downloads/+page.svelteindex 87017dc9..984cef0f 100644--- a/src/routes/downloads/+page.svelte+++ b/src/routes/downloads/+page.svelte@@ -13,6 +13,8 @@formatEta,getFinishedCount,getSpeedHistory,+ removeDownload,+ markGenericComplete,type CourseDownloadItem,type GenericDownloadItem,type QueueKind,@@ -28,6 +30,7 @@import DownloadPoster from "$components/download/DownloadPoster.svelte";import DownloadPhases from "$components/download/DownloadPhases.svelte";import DownloadCommand from "$components/download/DownloadCommand.svelte";+ import FailedLeftoversDialog, { type LeftoverFile } from "$components/downloads/FailedLeftoversDialog.svelte";import ReencodeDialog from "$components/dialog/ReencodeDialog.svelte";import ToolsPanel from "$components/downloads/ToolsPanel.svelte";import VideoOpsOverlay from "$components/downloads/VideoOpsOverlay.svelte";@@ -35,6 +38,7 @@import { locale as i18nLocale } from "$lib/i18n";import { get } from "svelte/store";import timeAgo from "$lib/time-ago";+ import { stopDownload as stopNamiDownload } from "$lib/stores/nami_download_store.svelte";@@ -223,11 +227,16 @@}async function cancelGenericDownload(id: number) {+ markGenericComplete(id, false, "Download cancelled");try {await invoke("cancel_generic_download", { downloadId: id });- } catch (e: any) {- const msg = typeof e === "string" ? e : e.message ?? $t("common.error");- showToast("error", msg);+ } catch {+ // Marked locally+ }+ try {+ await stopNamiDownload(String(id));+ } catch {+ // Ignore if not a nami task}}@@ -260,16 +269,42 @@let pendingRemove = $state<number | null>(null);let pendingRemoveTimer = $state<ReturnType<typeof setTimeout> | null>(null);+ let leftoversOpen = $state(false);+ let leftoverFiles = $state<LeftoverFile[]>([]);+ let leftoversId = $state<number | null>(null);++ async function removeOfferingLeftovers(id: number) {+ let files: LeftoverFile[] = [];+ try {+ files = await invoke<LeftoverFile[]>("failed_download_leftovers", { downloadId: id });+ } catch {+ files = [];+ }+ if (files.length > 0) {+ leftoverFiles = files;+ leftoversId = id;+ leftoversOpen = true;+ return;+ }+ await finishRemove(id, false);+ }++ async function finishRemove(id: number, deletePartials: boolean) {+ try {+ await invoke("remove_download", { downloadId: id, deletePartials });+ } catch {+ // Generic / client-side item not tracked in backend download_queue+ } finally {+ removeDownload(id);+ }+ }function removeItem(id: number) {if (pendingRemove === id) {if (pendingRemoveTimer) clearTimeout(pendingRemoveTimer);pendingRemove = null;pendingRemoveTimer = null;- invoke("remove_download", { downloadId: id }).catch((e: any) => {- const msg = typeof e === "string" ? e : e.message ?? $t("common.error");- showToast("error", msg);- });+ void removeOfferingLeftovers(id);} else {if (pendingRemoveTimer) clearTimeout(pendingRemoveTimer);pendingRemove = id;@@ -298,6 +333,11 @@const msg = typeof e === "string" ? e : e.message ?? $t("common.error");showToast("error", msg);}+ for (const [id, item] of getDownloads()) {+ if (item.status === "complete" || item.status === "error") {+ removeDownload(id);+ }+ }}async function pauseAll() {@@ -782,6 +822,14 @@<ReencodeDialog bind:inputPath={reencodePath} />+<FailedLeftoversDialog+ bind:open={leftoversOpen}+ files={leftoverFiles}+ onRemove={(deletePartials) => {+ if (leftoversId !== null) void finishRemove(leftoversId, deletePartials);+ }}+/>+{#if vopPath}<VideoOpsOverlay filePath={vopPath} onClose={() => (vopPath = null)} />{/if}@@ -803,20 +851,24 @@</div><div class="item-header-actions">{#if item.status === "downloading"}- <button- class="action-icon-btn"- onclick={() => pauseDownload(item.id)}- aria-label={$t('downloads.pause')}- >- <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">- <rect x="6" y="4" width="4" height="16" />- <rect x="14" y="4" width="4" height="16" />- </svg>- </button>+ {#if item.canPause !== false && item.queueKind !== "image"}+ <button+ class="action-icon-btn"+ onclick={() => pauseDownload(item.id)}+ aria-label={$t('downloads.pause')}+ title={$t('downloads.pause')}+ >+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <rect x="6" y="4" width="4" height="16" />+ <rect x="14" y="4" width="4" height="16" />+ </svg>+ </button>+ {/if}<buttonclass="action-icon-btn"onclick={() => cancelGenericDownload(item.id)}aria-label={$t('downloads.cancel')}+ title={$t('downloads.cancel')}><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12" />@@ -1024,9 +1076,14 @@{:else if qualityChip(item)}<span class="quality-chip" title={$t('downloads.quality_hint')}>{qualityChip(item)}</span>{/if}- {#if item.status === "complete" && (item.totalBytes || item.downloadedBytes)}- <span class="meta-sep" aria-hidden="true">·</span>- <span class="meta-text">{formatBytes(item.totalBytes ?? item.downloadedBytes)}</span>+ {#if item.status === "complete"}+ {#if item.totalBytes || item.downloadedBytes}+ <span class="meta-sep" aria-hidden="true">·</span>+ <span class="meta-text">{formatBytes(item.totalBytes ?? item.downloadedBytes)}</span>+ {:else if (item.fileCount ?? 0) > 0}+ <span class="meta-sep" aria-hidden="true">·</span>+ <span class="meta-text">{item.fileCount} {item.fileCount === 1 ? 'file' : 'files'}</span>+ {/if}{:else if item.status === "downloading" && !item.totalBytes && plannedSize(item)}<span class="meta-sep" aria-hidden="true">·</span><span class="meta-text">≈ {formatBytes(plannedSize(item)!)}</span>@@ -1046,7 +1103,10 @@/>{#if isTransferPhase(item.phase)}<div class="item-stats">- {#if item.downloadedBytes > 0}+ {#if (item.fileCount ?? 0) > 0}+ <span>{item.fileCount} {item.fileCount === 1 ? 'file' : 'files'}</span>+ <span class="stats-sep">·</span>+ {:else if item.downloadedBytes > 0}<span>{formatBytes(item.downloadedBytes)}{#if item.totalBytes}{" / "}{formatBytes(item.totalBytes)}{/if}</span><span class="stats-sep">·</span>{/if}@@ -1095,11 +1155,15 @@<divclass="progress-fill"data-status={item.status}- class:indeterminate={item.status === "downloading" && item.percent <= 0 && !isTransferPhase(item.phase)}+ class:indeterminate={item.status === "downloading" && item.percent <= 0 && (!isTransferPhase(item.phase) || item.queueKind === "image")}style:width="{Math.max(0, item.percent).toFixed(1)}%"></div></div>- <span class="item-percent">{Math.max(0, item.percent).toFixed(0)}%</span>+ {#if item.status === "downloading" && item.percent <= 0 && (!isTransferPhase(item.phase) || item.queueKind === "image")}+ <span class="item-percent indeterminate-glyph" title="Progress indeterminate">…</span>+ {:else}+ <span class="item-percent">{Math.max(0, item.percent).toFixed(0)}%</span>+ {/if}</div>{/if}diff --git a/src/routes/marketplace/+page.svelte b/src/routes/marketplace/+page.svelteindex 4a8db1a0..b77976eb 100644--- a/src/routes/marketplace/+page.svelte+++ b/src/routes/marketplace/+page.svelte@@ -278,7 +278,7 @@</div>{:else if browseError}<div class="empty">- <img class="empty-state-art" src="/emoji/satellite_antenna.png" alt="" width="72" height="72" draggable="false" />+ <img class="empty-state-art" src="/mascot/error.png" alt="LibreGet error" width="72" height="72" draggable="false" /><p>{$t("marketplace.browse_error")}</p><p class="error-hint">{$t("marketplace.browse_error_hint")}</p><button class="btn btn-secondary retry-btn" onclick={loadBrowse}>{$t("marketplace.browse_retry")}</button>diff --git a/src/routes/nami/+page.svelte b/src/routes/nami/+page.svelteindex cf787f21..14e21d54 100644--- a/src/routes/nami/+page.svelte+++ b/src/routes/nami/+page.svelte@@ -3,6 +3,7 @@import ProfileManager from '$components/nami/ProfileManager.svelte';import HistoryManager from '$components/nami/HistoryManager.svelte';import SettingsManager from '$components/nami/SettingsManager.svelte';+ import { setToolbar } from '$lib/stores/toolbar-store.svelte';import { setDraft } from '$lib/stores/nami_download_store.svelte';import { t } from '$lib/i18n';@@ -10,19 +11,20 @@let activeTab = $state<TabKey>('download');- const NAV_ITEMS: { key: TabKey; labelKey: string; icon: string }[] = [- { key: 'download', labelKey: 'nami.tab_download', icon: '/icons/nami-download.png' },- { key: 'profiles', labelKey: 'nami.tab_profiles', icon: '/icons/nami-profiles.png' },- { key: 'history', labelKey: 'nami.tab_history', icon: '/icons/clock-counter-clockwise.svg' },- { key: 'settings', labelKey: 'nami.tab_settings', icon: '/icons/nami-settings.png' }- ];-- const DESCRIPTION_KEYS: Record<TabKey, string> = {- download: 'nami.desc_download',- profiles: 'nami.desc_profiles',- history: 'nami.desc_history',- settings: 'nami.desc_settings'- };+ $effect(() => {+ return setToolbar({+ segments: [+ { id: 'download', label: $t('nami.tab_download') || 'Home' },+ { id: 'profiles', label: $t('nami.tab_profiles') || 'Profiles' },+ { id: 'history', label: $t('nami.tab_history') || 'History' },+ { id: 'settings', label: $t('nami.tab_settings') || 'Settings' },+ ],+ activeSegment: activeTab,+ onSegment: (id) => {+ activeTab = id as TabKey;+ },+ });+ });function switchTab(tab: TabKey) {activeTab = tab;@@ -30,50 +32,11 @@</script><svelte:head>- <title>{$t('nami.page_title')}</title>+ <title>{$t('nami.page_title') || 'LibreGet — Nami'}</title></svelte:head>-<div class="oo-shell">- <aside class="oo-sidebar" aria-label={$t('nami.sections_aria')}>- <nav class="oo-nav" role="tablist" aria-orientation="vertical">- {#each NAV_ITEMS as item (item.key)}- <button- type="button"- role="tab"- id="tab-{item.key}"- aria-controls={activeTab === item.key ? `tabpanel-${item.key}` : undefined}- aria-selected={activeTab === item.key}- class="oo-nav-item"- class:active={activeTab === item.key}- onclick={() => switchTab(item.key)}- >- <span- class="oo-nav-icon"- style="--icon-url: url('{item.icon}')"- aria-hidden="true"- ></span>- <span>{$t(item.labelKey)}</span>- </button>- {/each}- </nav>- </aside>-- <div- class="oo-content"- role="tabpanel"- id="tabpanel-{activeTab}"- aria-labelledby="tab-{activeTab}"- >- <header class="oo-header">- <p class="oo-kicker">Nami</p>- <h1 class="oo-title">- {$t(NAV_ITEMS.find((i) => i.key === activeTab)?.labelKey ?? 'nami.tab_download')}- </h1>- <p class="oo-description">- {$t(DESCRIPTION_KEYS[activeTab])}- </p>- </header>-+<div class="nami-container">+ <div class="nami-content" role="tabpanel" id="tabpanel-{activeTab}">{#if activeTab === 'download'}<DownloadManageronSwitchToProfiles={() => switchTab('profiles')}@@ -95,175 +58,26 @@</div><style>- .oo-shell {- --oo-accent: var(--accent);- --oo-border: var(--content-border);- --oo-sidebar-bg: var(--sidebar-bg);- --oo-content-bg: var(--button-elevated);- --oo-group-bg: var(--button);- --oo-text: var(--text);- --oo-text-secondary: var(--text-secondary);- --oo-radius-lg: calc(var(--border-radius) * 1.25);- --oo-radius: var(--border-radius);- --oo-radius-sm: calc(var(--border-radius) * 0.72);-- width: min(100%, 940px);- margin: clamp(16px, 4vh, 40px) auto;- display: grid;- grid-template-columns: 216px minmax(0, 1fr);- min-height: min(620px, calc(100dvh - 128px));- border: 1px solid var(--oo-border);- border-radius: var(--oo-radius-lg);- overflow: hidden;- box-sizing: border-box;- }-- .oo-sidebar {- background: var(--oo-sidebar-bg);- border-right: 1px solid var(--oo-border);- padding: calc(var(--padding) * 1.25) var(--padding);- box-sizing: border-box;- }-- .oo-nav {+ .nami-container {+ flex: 1;+ min-height: 0;+ width: 100%;display: flex;flex-direction: column;- gap: 4px;- }-- .oo-nav-item {- display: flex;- align-items: center;- gap: 10px;- min-height: 44px;- padding: 8px 10px;- border-radius: var(--oo-radius-sm);- font-size: 13px;- font-weight: 500;- color: var(--oo-text);- text-align: left;- background: transparent;- border: none;- cursor: pointer;- transition: background 150ms ease, color 150ms ease;- }-- .oo-nav-icon {- width: 20px;- height: 20px;- background-color: currentColor;- mask-image: var(--icon-url);- mask-size: contain;- mask-repeat: no-repeat;- mask-position: center;- -webkit-mask-image: var(--icon-url);- -webkit-mask-size: contain;- -webkit-mask-repeat: no-repeat;- -webkit-mask-position: center;- flex-shrink: 0;- }-- .oo-nav-item:not(.active):hover {- background: color-mix(in srgb, var(--oo-text) 6%, transparent);- }-- .oo-nav-item.active {- background: var(--oo-accent);- color: var(--on-accent);- }-- .oo-nav-item:focus-visible,- :global(.oo-shell button:focus-visible),- :global(.oo-shell input:focus-visible) {- outline: var(--focus-ring);- outline-offset: var(--focus-ring-offset);- }-- .oo-content {- min-width: 0;- padding: clamp(24px, 4vw, 40px);overflow-y: auto;- box-sizing: border-box;- }-- .oo-header {- max-width: 580px;- margin-bottom: 28px;- }-- .oo-kicker {- margin: 0 0 6px;- color: var(--oo-text-secondary);- font-size: 12px;- font-weight: 600;- letter-spacing: 0.04em;- text-transform: uppercase;- }-- .oo-title {- font-size: 24px;- font-weight: 500;- letter-spacing: -0.01em;- color: var(--oo-text);- margin: 0;- }-- .oo-description {- max-width: 52ch;- margin: 8px 0 0;- color: var(--oo-text-secondary);- font-size: 14px;- line-height: 1.55;- }-- :global(.oo-content > :not(.oo-header)) {- max-width: 580px;+ overscroll-behavior-y: contain;+ transform: translateZ(0);+ will-change: scroll-position;}- @media (max-width: 760px) {- .oo-shell {- grid-template-columns: 180px minmax(0, 1fr);- min-height: min(580px, calc(100dvh - 112px));- }- }-- @media (max-width: 600px) {- .oo-shell {- grid-template-columns: 1fr;- min-height: 0;- margin: var(--padding) auto;- }-- .oo-sidebar {- width: 100%;- border-right: 0;- border-bottom: 1px solid var(--oo-border);- padding: 8px;- }-- .oo-nav {- display: grid;- grid-template-columns: repeat(4, minmax(0, 1fr));- }-- .oo-nav-item {- justify-content: center;- gap: 7px;- min-height: 40px;- padding: 6px;- font-size: 12px;- }-- .oo-content {- padding: 24px 20px 28px;- }-- .oo-header {- margin-bottom: 22px;- }-- .oo-title {- font-size: 22px;- }+ .nami-content {+ width: 100%;+ max-width: 780px;+ margin: 0 auto;+ padding: var(--space-4) var(--space-5) var(--space-7);+ box-sizing: border-box;+ display: flex;+ flex-direction: column;+ gap: var(--space-4);}</style>diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelteindex 8cc5a29f..52963ecd 100644--- a/src/routes/settings/+page.svelte+++ b/src/routes/settings/+page.svelte@@ -185,6 +185,11 @@];let activeCategory = $state<SettingsCategory>("downloads");+ let visitedCategories = $state<Partial<Record<SettingsCategory, boolean>>>({ downloads: true });++ $effect(() => {+ visitedCategories[activeCategory] = true;+ });let tabApplied = false;$effect(() => {@@ -311,8 +316,13 @@});}+ let lastAppliedQuery = "";$effect(() => {const q = normalizedQuery;+ if (q === lastAppliedQuery) return;+ const hadSearch = lastAppliedQuery.length > 0;+ lastAppliedQuery = q;+if (typeof document === "undefined") return;let cancelled = false;@@ -323,7 +333,9 @@if (!content) return;if (!q) {- resetSettingsSearchDisplay(content);+ if (hadSearch) {+ resetSettingsSearchDisplay(content);+ }return;}@@ -626,26 +638,26 @@</header>{/if}- {#if isSearching || activeCategory === "appearance"}- <div class="settings-panel" data-settings-cat="appearance">+ {#if isSearching || visitedCategories.appearance}+ <div class="settings-panel" class:is-hidden={!isSearching && activeCategory !== "appearance"} data-settings-cat="appearance"><SettingsAppearance searchActive={isSearching} /></div>{/if}- {#if isSearching || activeCategory === "typography"}- <div class="settings-panel" data-settings-cat="typography">+ {#if isSearching || visitedCategories.typography}+ <div class="settings-panel" class:is-hidden={!isSearching && activeCategory !== "typography"} data-settings-cat="typography"><SettingsTypography /></div>{/if}- {#if isSearching || activeCategory === "downloads"}- <div class="settings-panel" data-settings-cat="downloads">+ {#if isSearching || visitedCategories.downloads}+ <div class="settings-panel" class:is-hidden={!isSearching && activeCategory !== "downloads"} data-settings-cat="downloads"><SettingsDownloads searchActive={isSearching} /></div>{/if}- {#if isSearching || activeCategory === "plugins"}- <div class="settings-panel" data-settings-cat="plugins">+ {#if isSearching || visitedCategories.plugins}+ <div class="settings-panel" class:is-hidden={!isSearching && activeCategory !== "plugins"} data-settings-cat="plugins"><SettingsPlugins{deps}{installingDep}@@ -655,33 +667,33 @@</div>{/if}- {#if isSearching || activeCategory === "network"}- <div class="settings-panel" data-settings-cat="network">+ {#if isSearching || visitedCategories.network}+ <div class="settings-panel" class:is-hidden={!isSearching && activeCategory !== "network"} data-settings-cat="network"><SettingsBrowserExtension /><SettingsNetwork /></div>{/if}- {#if isSearching || activeCategory === "cookies"}- <div class="settings-panel" data-settings-cat="cookies">+ {#if isSearching || visitedCategories.cookies}+ <div class="settings-panel" class:is-hidden={!isSearching && activeCategory !== "cookies"} data-settings-cat="cookies"><SettingsCookies /></div>{/if}- {#if isSearching || activeCategory === "channels"}- <div class="settings-panel" data-settings-cat="channels">+ {#if isSearching || visitedCategories.channels}+ <div class="settings-panel" class:is-hidden={!isSearching && activeCategory !== "channels"} data-settings-cat="channels"><SettingsChannels /></div>{/if}- {#if isSearching || activeCategory === "ai"}- <div class="settings-panel" data-settings-cat="ai">+ {#if isSearching || visitedCategories.ai}+ <div class="settings-panel" class:is-hidden={!isSearching && activeCategory !== "ai"} data-settings-cat="ai"><SettingsAI /></div>{/if}- {#if isSearching || activeCategory === "advanced"}- <div class="settings-panel" data-settings-cat="advanced">+ {#if isSearching || visitedCategories.advanced}+ <div class="settings-panel" class:is-hidden={!isSearching && activeCategory !== "advanced"} data-settings-cat="advanced"><SettingsRules /><SettingsStorage /><SettingsAdvanced {resetting} onReset={handleReset} searchActive={isSearching} />diff --git a/src/routes/tools/+page.svelte b/src/routes/tools/+page.svelteindex 4829aa0f..756b99c5 100644--- a/src/routes/tools/+page.svelte+++ b/src/routes/tools/+page.svelte@@ -23,6 +23,31 @@let ready = $derived(index.filter((e) => e.tool.status !== "soon"));let categories = $derived([...CATEGORIES].sort((a, b) => a.order - b.order));+ const BATCH_SIZE = 24;+ let visibleReadyCount = $state(BATCH_SIZE);+ let visibleReady = $derived(ready.slice(0, visibleReadyCount));+ let sentinelEl = $state<HTMLElement | null>(null);++ $effect(() => {+ if (!browsing) {+ visibleReadyCount = BATCH_SIZE;+ return;+ }+ if (!sentinelEl || visibleReadyCount >= ready.length) return;++ const observer = new IntersectionObserver(+ (entries) => {+ if (entries[0]?.isIntersecting) {+ visibleReadyCount = Math.min(ready.length, visibleReadyCount + BATCH_SIZE);+ }+ },+ { rootMargin: "400px" },+ );++ observer.observe(sentinelEl);+ return () => observer.disconnect();+ });+function countLabel(n: number): string {return n === 1 ? ($t("tools.hub.tool_count_one") as string) : ($t("tools.hub.tool_count", { count: n }) as string);}@@ -64,7 +89,7 @@<span class="section-header-title">{$t("tools.hub.ready_now")}</span></div><div class="tools-grid">- {#each ready as entry (entry.tool.id)}+ {#each visibleReady as entry (entry.tool.id)}<ToolTilehref={toolHref(entry.tool)}label={entry.name}@@ -77,6 +102,9 @@/>{/each}</div>+ {#if visibleReadyCount < ready.length}+ <div bind:this={sentinelEl} class="tools-sentinel" aria-hidden="true"></div>+ {/if}</div>{:else if groups.length === 0}<div class="tools-empty">@@ -189,4 +217,10 @@font-size: var(--text-base);color: var(--text-muted);}++ .tools-sentinel {+ height: 1px;+ width: 100%;+ pointer-events: none;+ }</style>diff --git a/static/emoji/satellite_antenna.png b/static/emoji/satellite_antenna.pngindex 862fd073..c5814af4 100644Binary files a/static/emoji/satellite_antenna.png and b/static/emoji/satellite_antenna.png differdiff --git a/static/icons/nav/about-32.png b/static/icons/nav/about-32.pngnew file mode 100644index 00000000..6699cd14Binary files /dev/null and b/static/icons/nav/about-32.png differdiff --git a/static/icons/nav/about-64.png b/static/icons/nav/about-64.pngnew file mode 100644index 00000000..f018b45dBinary files /dev/null and b/static/icons/nav/about-64.png differdiff --git a/static/icons/nav/convert-32.png b/static/icons/nav/convert-32.pngnew file mode 100644index 00000000..9dcb705aBinary files /dev/null and b/static/icons/nav/convert-32.png differdiff --git a/static/icons/nav/convert-64.png b/static/icons/nav/convert-64.pngnew file mode 100644index 00000000..85bc3db5Binary files /dev/null and b/static/icons/nav/convert-64.png differdiff --git a/static/icons/nav/courses-32.png b/static/icons/nav/courses-32.pngnew file mode 100644index 00000000..c763c02dBinary files /dev/null and b/static/icons/nav/courses-32.png differdiff --git a/static/icons/nav/courses-64.png b/static/icons/nav/courses-64.pngnew file mode 100644index 00000000..9a6abd7eBinary files /dev/null and b/static/icons/nav/courses-64.png differdiff --git a/static/icons/nav/downloads-32.png b/static/icons/nav/downloads-32.pngnew file mode 100644index 00000000..b79dccabBinary files /dev/null and b/static/icons/nav/downloads-32.png differdiff --git a/static/icons/nav/downloads-64.png b/static/icons/nav/downloads-64.pngnew file mode 100644index 00000000..9a37b3f5Binary files /dev/null and b/static/icons/nav/downloads-64.png differdiff --git a/static/icons/nav/home-32.png b/static/icons/nav/home-32.pngnew file mode 100644index 00000000..c41294e2Binary files /dev/null and b/static/icons/nav/home-32.png differdiff --git a/static/icons/nav/home-64.png b/static/icons/nav/home-64.pngnew file mode 100644index 00000000..4475b166Binary files /dev/null and b/static/icons/nav/home-64.png differdiff --git a/static/icons/nav/marketplace-32.png b/static/icons/nav/marketplace-32.pngnew file mode 100644index 00000000..5b94cb68Binary files /dev/null and b/static/icons/nav/marketplace-32.png differdiff --git a/static/icons/nav/marketplace-64.png b/static/icons/nav/marketplace-64.pngnew file mode 100644index 00000000..6a076c49Binary files /dev/null and b/static/icons/nav/marketplace-64.png differdiff --git a/static/icons/nav/nami-32.png b/static/icons/nav/nami-32.pngnew file mode 100644index 00000000..bd38f5bfBinary files /dev/null and b/static/icons/nav/nami-32.png differdiff --git a/static/icons/nav/nami-64.png b/static/icons/nav/nami-64.pngnew file mode 100644index 00000000..e03de0b1Binary files /dev/null and b/static/icons/nav/nami-64.png differdiff --git a/static/icons/nav/settings-32.png b/static/icons/nav/settings-32.pngnew file mode 100644index 00000000..2db4567fBinary files /dev/null and b/static/icons/nav/settings-32.png differdiff --git a/static/icons/nav/settings-64.png b/static/icons/nav/settings-64.pngnew file mode 100644index 00000000..78813a4bBinary files /dev/null and b/static/icons/nav/settings-64.png differdiff --git a/static/icons/nav/telegram-32.png b/static/icons/nav/telegram-32.pngnew file mode 100644index 00000000..235983bcBinary files /dev/null and b/static/icons/nav/telegram-32.png differdiff --git a/static/icons/nav/telegram-64.png b/static/icons/nav/telegram-64.pngnew file mode 100644index 00000000..65eb397eBinary files /dev/null and b/static/icons/nav/telegram-64.png differdiff --git a/static/icons/nav/tools-32.png b/static/icons/nav/tools-32.pngnew file mode 100644index 00000000..5c5e7f0cBinary files /dev/null and b/static/icons/nav/tools-32.png differdiff --git a/static/icons/nav/tools-64.png b/static/icons/nav/tools-64.pngnew file mode 100644index 00000000..fd37eb07Binary files /dev/null and b/static/icons/nav/tools-64.png differ