mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-24 21:38:09 +02:00
Merge remote-tracking branch 'upstream/dev' into feat/api-key
This commit is contained in:
commit
3695e1d5c5
64 changed files with 1043 additions and 1852 deletions
|
|
@ -1,11 +1,6 @@
|
|||
import { atom } from "jotai";
|
||||
import { rightPanelCollapsedAtom, rightPanelTabAtom } from "@/atoms/layout/right-panel.atom";
|
||||
|
||||
export interface EditorLineRange {
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
|
||||
interface EditorPanelState {
|
||||
isOpen: boolean;
|
||||
kind: "document" | "local_file" | "memory";
|
||||
|
|
@ -14,10 +9,6 @@ interface EditorPanelState {
|
|||
searchSpaceId: number | null;
|
||||
memoryScope: "user" | "team" | null;
|
||||
title: string | null;
|
||||
// Citation line anchor: when set, the editor opens the raw source view
|
||||
// scrolled to and highlighting this 1-based inclusive line range.
|
||||
highlightLines: EditorLineRange | null;
|
||||
forceSourceView: boolean;
|
||||
}
|
||||
|
||||
const initialState: EditorPanelState = {
|
||||
|
|
@ -28,8 +19,6 @@ const initialState: EditorPanelState = {
|
|||
searchSpaceId: null,
|
||||
memoryScope: null,
|
||||
title: null,
|
||||
highlightLines: null,
|
||||
forceSourceView: false,
|
||||
};
|
||||
|
||||
export const editorPanelAtom = atom<EditorPanelState>(initialState);
|
||||
|
|
@ -44,14 +33,7 @@ export const openEditorPanelAtom = atom(
|
|||
get,
|
||||
set,
|
||||
payload:
|
||||
| {
|
||||
documentId: number;
|
||||
searchSpaceId: number;
|
||||
title?: string;
|
||||
kind?: "document";
|
||||
highlightLines?: EditorLineRange | null;
|
||||
forceSourceView?: boolean;
|
||||
}
|
||||
| { documentId: number; searchSpaceId: number; title?: string; kind?: "document" }
|
||||
| {
|
||||
kind: "local_file";
|
||||
localFilePath: string;
|
||||
|
|
@ -77,8 +59,6 @@ export const openEditorPanelAtom = atom(
|
|||
searchSpaceId: payload.searchSpaceId ?? null,
|
||||
memoryScope: null,
|
||||
title: payload.title ?? null,
|
||||
highlightLines: null,
|
||||
forceSourceView: false,
|
||||
});
|
||||
set(rightPanelTabAtom, "editor");
|
||||
set(rightPanelCollapsedAtom, false);
|
||||
|
|
@ -93,8 +73,6 @@ export const openEditorPanelAtom = atom(
|
|||
searchSpaceId: payload.searchSpaceId ?? null,
|
||||
memoryScope: payload.memoryScope,
|
||||
title: payload.title ?? null,
|
||||
highlightLines: null,
|
||||
forceSourceView: false,
|
||||
});
|
||||
set(rightPanelTabAtom, "editor");
|
||||
set(rightPanelCollapsedAtom, false);
|
||||
|
|
@ -108,8 +86,6 @@ export const openEditorPanelAtom = atom(
|
|||
searchSpaceId: payload.searchSpaceId,
|
||||
memoryScope: null,
|
||||
title: payload.title ?? null,
|
||||
highlightLines: payload.highlightLines ?? null,
|
||||
forceSourceView: payload.forceSourceView ?? false,
|
||||
});
|
||||
set(rightPanelTabAtom, "editor");
|
||||
set(rightPanelCollapsedAtom, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue