Repository navigation
feat(sidecar): implement antigravity 2.0 standalone http sidecar server and responsive layout - #5
Merged
Conversation
…d inter-chapter transition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Ringkasan Perubahan Utama (Summary)
PR ini mengimplementasikan server HTTP lokal mandiri di
src/antigravity/sidecar-server.tsyang bertindak sebagai proses Sidecar UI untuk Antigravity 2.0 (Auxiliary Pane viasidecar://). Server ini memanfaatkan modul nativenode:http(ringan, < 35 MB RSS, startup ~20ms, tanpa dependensi framework luar) dan menyediakan antarmuka web reader responsif dengan REST & Server-Sent Events (SSE) API untuk pemuatan dokumen, navigasi bab, ekstraksi catatan kaki instan, dan live hot-reload.✨ Fitur Baru & Pembaruan (Features & Updates)
SidecarServerdisrc/antigravity/sidecar-server.tsmenggunakannode:http.ANTIGRAVITY_SIDECAR_WEB_PORT(fallback port default 5890).SIGINTdanSIGTERM, serta pembersihan client SSE dan direktori cache EPUB otomatis.GET /: Menyajikan antarmuka pembaca XHTML/EPUB interaktif (readerShell) atau halaman Empty State jika belum ada buku yang dimuat.GET /api/status: Mengembalikan metadata JSON mengenai status muat, info buku, bab aktif, total spine, dan port server.POST /api/open: Membuka file.epub, folder EPUB hasil ekstraksi, atau berkas.xhtml/.htmlmandiri secara dinamis.GET /api/events: Stream SSE (Server-Sent Events) untuk menyiarkan eventbookLoadeddanchapterChangedke client.POST /api/message: Menangani komunikasi dua arah dari reader (navigasiprevChapter,nextChapter,openLink,savePreferences,saveReadingPosition, danrequestFootnote).GET /assets/*: Melayani aset statis buku (gambar, font, css) dari direktori root buku secara terisolasi.isSafePathserta pemblokiran URL dengan segmen..atau%2e%2epada/assets/*untuk mencegah eksfiltrasi file di luar direktori buku.@media (max-width: 520px)disrc/core/reader-shell.tsagar toolbar dan popover settings tampil rapi pada Auxiliary Pane (~320px - 480px).connect-src 'self' ${webview.cspSource};untuk mengizinkanfetchdanEventSourcedi browser.footnoteResponsedan safety recovery timeout pada transisi overscroll.📦 Maintenance & Testing
package.json:build:sidecarberbasisesbuildyang mem-bundlesrc/antigravity/sidecar-server.tsmenjadidist/sidecar-server.cjs(format CommonJS Node).test/sidecar-server.test.mjs):Catatan Reviewer / Dev Notes:
feature/018-antigravity-sidecar-http-servermain.