Skip to content

Commit a180bf5

Browse files
committed
fix merge conflicts
1 parent d7315e7 commit a180bf5

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

surfsense_backend/alembic/versions/117_add_vision_llm_id_to_search_spaces.py renamed to surfsense_backend/alembic/versions/119_add_vision_llm_id_to_search_spaces.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
"""117_add_vision_llm_id_to_search_spaces
1+
"""119_add_vision_llm_id_to_search_spaces
22
3-
Revision ID: 117
4-
Revises: 116
3+
Revision ID: 119
4+
Revises: 118
55
66
Adds vision_llm_id column to search_spaces for vision/screenshot analysis
77
LLM role assignment. Defaults to 0 (Auto mode), same convention as
@@ -16,8 +16,8 @@
1616

1717
from alembic import op
1818

19-
revision: str = "117"
20-
down_revision: str | None = "116"
19+
revision: str = "119"
20+
down_revision: str | None = "118"
2121
branch_labels: str | Sequence[str] | None = None
2222
depends_on: str | Sequence[str] | None = None
2323

surfsense_backend/app/services/vision_autocomplete_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,6 @@ async def stream_vision_autocomplete(
220220
logger.warning(f"Vision autocomplete: selected model does not support vision: {e}")
221221
yield streaming.format_error(vision_error_msg)
222222
else:
223-
logger.error(f"Vision autocomplete streaming error: {e}")
224-
yield streaming.format_error(str(e))
223+
logger.error(f"Vision autocomplete streaming error: {e}", exc_info=True)
224+
yield streaming.format_error("Autocomplete failed. Please try again.")
225225
yield streaming.format_done()

surfsense_desktop/src/modules/autocomplete/index.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const SHORTCUT = 'CommandOrControl+Shift+Space';
1111
let autocompleteEnabled = true;
1212
let savedClipboard = '';
1313
let sourceApp = '';
14+
let lastSearchSpaceId: string | null = null;
1415

1516
function isSurfSenseWindow(): boolean {
1617
const app = getFrontmostApp();
@@ -36,19 +37,24 @@ async function triggerAutocomplete(): Promise<void> {
3637
return;
3738
}
3839

39-
const cursor = screen.getCursorScreenPoint();
40-
const win = createSuggestionWindow(cursor.x, cursor.y);
41-
42-
let searchSpaceId = '1';
4340
const mainWin = getMainWindow();
4441
if (mainWin && !mainWin.isDestroyed()) {
4542
const mainUrl = mainWin.webContents.getURL();
4643
const match = mainUrl.match(/\/dashboard\/(\d+)/);
4744
if (match) {
48-
searchSpaceId = match[1];
45+
lastSearchSpaceId = match[1];
4946
}
5047
}
5148

49+
if (!lastSearchSpaceId) {
50+
console.warn('[autocomplete] No active search space. Open a search space first.');
51+
return;
52+
}
53+
54+
const searchSpaceId = lastSearchSpaceId;
55+
const cursor = screen.getCursorScreenPoint();
56+
const win = createSuggestionWindow(cursor.x, cursor.y);
57+
5258
win.webContents.once('did-finish-load', () => {
5359
const sw = getSuggestionWindow();
5460
setTimeout(() => {

surfsense_web/components/editor-panel/editor-panel.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ export function EditorPanelContent({
9696
}
9797

9898
try {
99-
const response = await authenticatedFetch(
100-
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/search-spaces/${searchSpaceId}/documents/${documentId}/editor-content`,
101-
{ method: "GET", signal: controller.signal }
10299
const url = new URL(
103100
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/search-spaces/${searchSpaceId}/documents/${documentId}/editor-content`
104101
);

surfsense_web/components/layout/ui/tabs/DocumentTabContent.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ export function DocumentTabContent({ documentId, searchSpaceId, title }: Documen
8181
}
8282

8383
try {
84-
const response = await authenticatedFetch(
85-
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/search-spaces/${searchSpaceId}/documents/${documentId}/editor-content`,
86-
{ method: "GET", signal: controller.signal }
8784
const url = new URL(
8885
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/search-spaces/${searchSpaceId}/documents/${documentId}/editor-content`
8986
);

0 commit comments

Comments
 (0)