mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-03 12:52:39 +02:00
fix merge conflicts
This commit is contained in:
parent
d7315e7f27
commit
a180bf5576
5 changed files with 18 additions and 18 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
"""117_add_vision_llm_id_to_search_spaces
|
"""119_add_vision_llm_id_to_search_spaces
|
||||||
|
|
||||||
Revision ID: 117
|
Revision ID: 119
|
||||||
Revises: 116
|
Revises: 118
|
||||||
|
|
||||||
Adds vision_llm_id column to search_spaces for vision/screenshot analysis
|
Adds vision_llm_id column to search_spaces for vision/screenshot analysis
|
||||||
LLM role assignment. Defaults to 0 (Auto mode), same convention as
|
LLM role assignment. Defaults to 0 (Auto mode), same convention as
|
||||||
|
|
@ -16,8 +16,8 @@ import sqlalchemy as sa
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
|
|
||||||
revision: str = "117"
|
revision: str = "119"
|
||||||
down_revision: str | None = "116"
|
down_revision: str | None = "118"
|
||||||
branch_labels: str | Sequence[str] | None = None
|
branch_labels: str | Sequence[str] | None = None
|
||||||
depends_on: str | Sequence[str] | None = None
|
depends_on: str | Sequence[str] | None = None
|
||||||
|
|
||||||
|
|
@ -220,6 +220,6 @@ async def stream_vision_autocomplete(
|
||||||
logger.warning(f"Vision autocomplete: selected model does not support vision: {e}")
|
logger.warning(f"Vision autocomplete: selected model does not support vision: {e}")
|
||||||
yield streaming.format_error(vision_error_msg)
|
yield streaming.format_error(vision_error_msg)
|
||||||
else:
|
else:
|
||||||
logger.error(f"Vision autocomplete streaming error: {e}")
|
logger.error(f"Vision autocomplete streaming error: {e}", exc_info=True)
|
||||||
yield streaming.format_error(str(e))
|
yield streaming.format_error("Autocomplete failed. Please try again.")
|
||||||
yield streaming.format_done()
|
yield streaming.format_done()
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ const SHORTCUT = 'CommandOrControl+Shift+Space';
|
||||||
let autocompleteEnabled = true;
|
let autocompleteEnabled = true;
|
||||||
let savedClipboard = '';
|
let savedClipboard = '';
|
||||||
let sourceApp = '';
|
let sourceApp = '';
|
||||||
|
let lastSearchSpaceId: string | null = null;
|
||||||
|
|
||||||
function isSurfSenseWindow(): boolean {
|
function isSurfSenseWindow(): boolean {
|
||||||
const app = getFrontmostApp();
|
const app = getFrontmostApp();
|
||||||
|
|
@ -36,19 +37,24 @@ async function triggerAutocomplete(): Promise<void> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cursor = screen.getCursorScreenPoint();
|
|
||||||
const win = createSuggestionWindow(cursor.x, cursor.y);
|
|
||||||
|
|
||||||
let searchSpaceId = '1';
|
|
||||||
const mainWin = getMainWindow();
|
const mainWin = getMainWindow();
|
||||||
if (mainWin && !mainWin.isDestroyed()) {
|
if (mainWin && !mainWin.isDestroyed()) {
|
||||||
const mainUrl = mainWin.webContents.getURL();
|
const mainUrl = mainWin.webContents.getURL();
|
||||||
const match = mainUrl.match(/\/dashboard\/(\d+)/);
|
const match = mainUrl.match(/\/dashboard\/(\d+)/);
|
||||||
if (match) {
|
if (match) {
|
||||||
searchSpaceId = match[1];
|
lastSearchSpaceId = match[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!lastSearchSpaceId) {
|
||||||
|
console.warn('[autocomplete] No active search space. Open a search space first.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const searchSpaceId = lastSearchSpaceId;
|
||||||
|
const cursor = screen.getCursorScreenPoint();
|
||||||
|
const win = createSuggestionWindow(cursor.x, cursor.y);
|
||||||
|
|
||||||
win.webContents.once('did-finish-load', () => {
|
win.webContents.once('did-finish-load', () => {
|
||||||
const sw = getSuggestionWindow();
|
const sw = getSuggestionWindow();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
|
||||||
|
|
@ -96,9 +96,6 @@ export function EditorPanelContent({
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await authenticatedFetch(
|
|
||||||
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/search-spaces/${searchSpaceId}/documents/${documentId}/editor-content`,
|
|
||||||
{ method: "GET", signal: controller.signal }
|
|
||||||
const url = new URL(
|
const url = new URL(
|
||||||
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/search-spaces/${searchSpaceId}/documents/${documentId}/editor-content`
|
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/search-spaces/${searchSpaceId}/documents/${documentId}/editor-content`
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -81,9 +81,6 @@ export function DocumentTabContent({ documentId, searchSpaceId, title }: Documen
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await authenticatedFetch(
|
|
||||||
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/search-spaces/${searchSpaceId}/documents/${documentId}/editor-content`,
|
|
||||||
{ method: "GET", signal: controller.signal }
|
|
||||||
const url = new URL(
|
const url = new URL(
|
||||||
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/search-spaces/${searchSpaceId}/documents/${documentId}/editor-content`
|
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/search-spaces/${searchSpaceId}/documents/${documentId}/editor-content`
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue