Open
Conversation
…d document sync, and note sharing UI.
lishaduck
requested changes
Dec 9, 2025
|
|
||
| import { Compartment } from "@codemirror/state"; | ||
|
|
||
| // ... |
Comment on lines
+31
to
+37
| $effect(() => { | ||
| if (editorView) { | ||
| editorView.dispatch({ | ||
| effects: extensionCompartment.reconfigure(extensions), | ||
| }); | ||
| } | ||
| }); |
Comment on lines
+21
to
+41
| // ... existing imports ... | ||
|
|
||
| interface Props { | ||
| manager: LoroNoteManager | undefined; | ||
| notesList?: NoteOrFolder[]; | ||
| user: User | undefined; | ||
| handleOpenInHomeserver: (input: string | null) => void; | ||
| noteId: string; | ||
| noteTitle: string; | ||
| } | ||
|
|
||
| let { | ||
| manager, | ||
| notesList = [], | ||
| user, | ||
| handleOpenInHomeserver, | ||
| noteId, | ||
| noteTitle, | ||
| }: Props = $props(); | ||
|
|
||
| // ... (existing code) ... |
Member
There was a problem hiding this comment.
Suggested change
| // ... existing imports ... | |
| interface Props { | |
| manager: LoroNoteManager | undefined; | |
| notesList?: NoteOrFolder[]; | |
| user: User | undefined; | |
| handleOpenInHomeserver: (input: string | null) => void; | |
| noteId: string; | |
| noteTitle: string; | |
| } | |
| let { | |
| manager, | |
| notesList = [], | |
| user, | |
| handleOpenInHomeserver, | |
| noteId, | |
| noteTitle, | |
| }: Props = $props(); | |
| // ... (existing code) ... |
Comment on lines
-42
to
-48
| interface Props { | ||
| manager: LoroNoteManager | undefined; | ||
| notesList?: NoteOrFolder[]; | ||
| user: User | undefined; | ||
| } | ||
|
|
||
| let { manager, notesList = [], user }: Props = $props(); |
Member
There was a problem hiding this comment.
Suggested change
| interface Props { | |
| manager: LoroNoteManager | undefined; | |
| notesList?: NoteOrFolder[]; | |
| user: User | undefined; | |
| } | |
| let { manager, notesList = [], user }: Props = $props(); | |
| interface Props { | |
| manager: LoroNoteManager | undefined; | |
| notesList?: NoteOrFolder[]; | |
| user: User | undefined; | |
| handleOpenInHomeserver: (input: string | null) => void; | |
| noteId: string; | |
| noteTitle: string; | |
| } | |
| let { | |
| manager, | |
| notesList = [], | |
| user, | |
| handleOpenInHomeserver, | |
| noteId, | |
| noteTitle, | |
| }: Props = $props(); |
Comment on lines
+129
to
+151
| $effect(() => { | ||
| if (manager !== undefined && user !== undefined) { | ||
| const ephemeral = new EphemeralStore(); | ||
| const undoManager = new UndoManager(manager.doc, {}); | ||
|
|
||
| loroExtensions = LoroExtensions( | ||
| manager.doc, | ||
| { | ||
| ephemeral, | ||
| user: { name: user.username, colorClassName: "bg-primary" }, | ||
| }, | ||
| undoManager, | ||
| LoroNoteManager.getTextFromDoc, | ||
| ); | ||
|
|
||
| return () => { | ||
| ephemeral.destroy(); | ||
| }; | ||
| } else { | ||
| loroExtensions = []; | ||
| return; | ||
| } | ||
| }); |
Member
There was a problem hiding this comment.
Does this really need an effect tho?
src/lib/components/Sidebar.svelte
Outdated
| } | ||
| import ConfirmationModal from "./ConfirmationModal.svelte"; | ||
|
|
||
| // ... (Props definition) |
| const redirectTo = url.searchParams.get("redirectTo") || "/"; | ||
| // Validate redirectTo to prevent open redirect attacks | ||
| const safeRedirect = redirectTo.startsWith("/") ? redirectTo : "/"; | ||
| throw redirect(302, safeRedirect); |
Member
There was a problem hiding this comment.
Suggested change
| throw redirect(302, safeRedirect); | |
| redirect(302, safeRedirect); |
Comment on lines
+1
to
+2
| import { Database } from "bun:sqlite"; // or better, just use drizzle or direct sqlite driver if available | ||
| // Actually, I can rely on the app's db module if I run with vite-node |
Member
There was a problem hiding this comment.
Suggested change
| import { Database } from "bun:sqlite"; // or better, just use drizzle or direct sqlite driver if available | |
| // Actually, I can rely on the app's db module if I run with vite-node |
Member
There was a problem hiding this comment.
Do we still need all these? If yes, move them to scripts/.
Comment on lines
+1
to
+6
| import { ed25519, x25519 } from "@noble/curves/ed25519.js"; | ||
| import { xchacha20poly1305 } from "@noble/ciphers/chacha.js"; | ||
| import { encodeBase64, decodeBase64 } from "@oslojs/encoding"; | ||
| import { hkdf } from "@noble/hashes/hkdf.js"; | ||
| import { sha256 } from "@noble/hashes/sha2.js"; | ||
|
|
…and display status in UI, enhancing SSE stream robustness for local and federated documents.
… and enhanced crypto utilities.
Draft
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.
No description provided.