chore(react/ribbon): save search to note

This commit is contained in:
Elian Doran
2025-08-24 16:56:22 +03:00
parent 3f105f7b8b
commit 04fbc82d7c
6 changed files with 35 additions and 59 deletions

View File

@@ -14,12 +14,12 @@ import TaskContext from "../../services/task_context.js";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc.js";
import eventService from "../../services/events.js";
import type { AttachmentRow, AttributeType, NoteRow, NoteType, RevisionRow } from "@triliumnext/commons";
import type { AttachmentRow, AttributeType, CloneResponse, NoteRow, NoteType, RevisionRow } from "@triliumnext/commons";
import type BBranch from "./bbranch.js";
import BAttribute from "./battribute.js";
import type { NotePojo } from "../becca-interface.js";
import searchService from "../../services/search/services/search.js";
import cloningService, { type CloneResponse } from "../../services/cloning.js";
import cloningService from "../../services/cloning.js";
import noteService from "../../services/notes.js";
import handlers from "../../services/handlers.js";
dayjs.extend(utc);

View File

@@ -6,13 +6,7 @@ import treeService from "./tree.js";
import BBranch from "../becca/entities/bbranch.js";
import becca from "../becca/becca.js";
import log from "./log.js";
export interface CloneResponse {
success: boolean;
message?: string;
branchId?: string;
notePath?: string;
}
import { CloneResponse } from "@triliumnext/commons";
function cloneNoteToParentNote(noteId: string, parentNoteId: string, prefix: string | null = null): CloneResponse {
if (!(noteId in becca.notes) || !(parentNoteId in becca.notes)) {

View File

@@ -10,6 +10,7 @@ import SearchContext from "./search/search_context.js";
import { LBTPL_NOTE_LAUNCHER, LBTPL_CUSTOM_WIDGET, LBTPL_SPACER, LBTPL_SCRIPT } from "./hidden_subtree.js";
import { t } from "i18next";
import { BNote } from "./backend_script_entrypoint.js";
import { SaveSearchNoteResponse } from "@triliumnext/commons";
function getInboxNote(date: string) {
const workspaceNote = hoistedNoteService.getWorkspaceNote();
@@ -119,7 +120,7 @@ function saveSearchNote(searchNoteId: string) {
}
}
return result;
return result satisfies SaveSearchNoteResponse;
}
function getMonthlyParentNoteId(rootNoteId: string, prefix: string) {