Skip to content

Commit 12f47e1

Browse files
author
Jakob Schlanstedt
committed
refactor(note_create): Inbox -> Default naming in functions, parameters and types
1 parent 37cae06 commit 12f47e1

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

apps/client/src/components/entrypoints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default class Entrypoints extends Component {
2626

2727
async createNoteIntoInboxCommand() {
2828
await noteCreateService.createNote(
29-
{ target: "inbox" }
29+
{ target: "default" }
3030
);
3131
}
3232

apps/client/src/services/note_create.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { CreateNoteAction } from "@triliumnext/commons";
3737
* Hierarchy (general → specific):
3838
* - CreateNoteOpts
3939
* - CreateNoteWithUrlOpts
40-
* - CreateNoteIntoInboxOpts
40+
* - CreateNoteIntoDefaultOpts
4141
*/
4242

4343
/** enforces a truth rule:
@@ -97,12 +97,12 @@ export type CreateNoteWithUrlOpts =
9797
targetBranchId: string;
9898
});
9999

100-
export type CreateNoteIntoInboxOpts = CreateNoteBase & {
101-
target: "inbox";
100+
export type CreateNoteIntoDefaultOpts = CreateNoteBase & {
101+
target: "default";
102102
parentNoteUrl?: never;
103103
};
104104

105-
export type CreateNoteOpts = CreateNoteWithUrlOpts | CreateNoteIntoInboxOpts;
105+
export type CreateNoteOpts = CreateNoteWithUrlOpts | CreateNoteIntoDefaultOpts;
106106

107107
interface Response {
108108
// TODO: Deduplicate with server once we have client/server architecture.
@@ -134,8 +134,8 @@ async function createNote(
134134

135135

136136
switch(resolvedOptions.target) {
137-
case "inbox":
138-
return createNoteIntoInbox(resolvedOptions);
137+
case "default":
138+
return createNoteIntoDefaultLocation(resolvedOptions);
139139
case "into":
140140
case "before":
141141
case "after":
@@ -154,7 +154,7 @@ async function createNoteFromAction(
154154
case CreateNoteAction.CreateNote: {
155155
const resp = await createNote(
156156
{
157-
target: "inbox",
157+
target: "default",
158158
title: title,
159159
activate: true,
160160
promptForType: promptForType,
@@ -165,7 +165,7 @@ async function createNoteFromAction(
165165
case CreateNoteAction.CreateAndLinkNote: {
166166
const resp = await createNote(
167167
{
168-
target: "inbox",
168+
target: "default",
169169
title,
170170
activate: false,
171171
promptForType: promptForType,
@@ -329,12 +329,12 @@ async function createNoteWithUrl(
329329
/**
330330
* Creates a new note inside the user's Inbox.
331331
*
332-
* @param {CreateNoteIntoInboxOpts} [options] - Optional settings such as title, type, template, or content.
332+
* @param {CreateNoteIntoDefaultOpts} [options] - Optional settings such as title, type, template, or content.
333333
* @returns {Promise<{ note: FNote | null; branch: FBranch | undefined }>}
334334
* Resolves with the created note and its branch, or `{ note: null, branch: undefined }` if the inbox is missing.
335335
*/
336-
async function createNoteIntoInbox(
337-
options: CreateNoteIntoInboxOpts
336+
async function createNoteIntoDefaultLocation(
337+
options: CreateNoteIntoDefaultOpts
338338
): Promise<{ note: FNote | null; branch: FBranch | undefined }> {
339339
const inboxNote = await dateNoteService.getInboxNote();
340340
if (!inboxNote) {

0 commit comments

Comments
 (0)