Compare commits

...

23 Commits

Author SHA1 Message Date
contributor
cf0db872c3
Merge d51a0d415bb552ff7dc35547e06dbe83d9df4b8a into 64662d5215ea01f6634fd72b5ff7a77dbc7e9e7d 2025-12-01 14:34:17 +00:00
Adorian Doran
64662d5215 Merge branch 'main' of https://github.com/TriliumNext/Trilium
Some checks are pending
Checks / main (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Deploy Documentation / Build and Deploy Documentation (push) Waiting to run
Dev / Test development (push) Waiting to run
Dev / Build Docker image (push) Blocked by required conditions
Dev / Check Docker build (Dockerfile) (push) Blocked by required conditions
Dev / Check Docker build (Dockerfile.alpine) (push) Blocked by required conditions
/ Check Docker build (Dockerfile) (push) Waiting to run
/ Check Docker build (Dockerfile.alpine) (push) Waiting to run
/ Build Docker images (Dockerfile, ubuntu-24.04-arm, linux/arm64) (push) Blocked by required conditions
/ Build Docker images (Dockerfile.alpine, ubuntu-latest, linux/amd64) (push) Blocked by required conditions
/ Build Docker images (Dockerfile.legacy, ubuntu-24.04-arm, linux/arm/v7) (push) Blocked by required conditions
/ Build Docker images (Dockerfile.legacy, ubuntu-24.04-arm, linux/arm/v8) (push) Blocked by required conditions
/ Merge manifest lists (push) Blocked by required conditions
playwright / E2E tests on linux-arm64 (push) Waiting to run
playwright / E2E tests on linux-x64 (push) Waiting to run
2025-12-01 16:33:41 +02:00
Adorian Doran
31cedad976 documentation: mark "calendar:color" as deprecated 2025-12-01 16:33:31 +02:00
Elian Doran
12ac5147d3
Merge branch 'main' of github.com:TriliumNext/Trilium 2025-12-01 14:40:25 +02:00
Elian Doran
17291ff61d
chore(deps): remove unnecessary package 2025-12-01 14:34:55 +02:00
Adorian Doran
f3e334470e style: refactor 2025-12-01 14:27:49 +02:00
Adorian Doran
9407051f1e style: refactor 2025-12-01 14:24:13 +02:00
Adorian Doran
08a6d36153 style/calendar collection/list view: use separate style for the archived events 2025-12-01 14:13:23 +02:00
Adorian Doran
f906fb9b4c Merge branch 'main' of https://github.com/TriliumNext/Trilium 2025-12-01 14:08:32 +02:00
Adorian Doran
b4a6356724 style/calendar collection/list view: fix dot colors 2025-12-01 14:08:24 +02:00
contributor
d51a0d415b fix auto generated data-list-item-id attributes in docs 2025-11-26 10:25:51 +02:00
contributor
a79c8b4add add autoExecuteSearch user guide docs 2025-11-26 10:25:51 +02:00
contributor
b359b48ec3 add attribute autoExecuteSearch help string 2025-11-26 10:25:51 +02:00
contributor
a0e1cc4154 add autoExecuteSearch label typing 2025-11-26 10:21:10 +02:00
contributor
625c0ed7dc do not activate collections tab for empty search result 2025-11-26 00:45:47 +02:00
contributor
1ac241ad1b tidy up code 2025-11-26 00:45:47 +02:00
contributor
2c447a4293 use module level var instead of sessionStorage 2025-11-26 00:45:47 +02:00
contributor
6c1886c5ca do not activate collections tab for mobile 2025-11-26 00:45:47 +02:00
contributor
9c86145ff8 use session storage for state
f2
2025-11-26 00:45:46 +02:00
contributor
6dcc3a7e81 only exec for search note type 2025-11-26 00:45:46 +02:00
contributor
921b56a89e use search results for state 2025-11-26 00:45:46 +02:00
contributor
9d0b532aeb fixing first tab cannot be open 2025-11-26 00:45:46 +02:00
contributor
cc468d964f add ability to auto execute search note 2025-11-26 00:45:46 +02:00
9 changed files with 195 additions and 1197 deletions

View File

@ -386,6 +386,7 @@
"workspace_template": "This note will appear in the selection of available template when creating new note, but only when hoisted into a workspace containing this template", "workspace_template": "This note will appear in the selection of available template when creating new note, but only when hoisted into a workspace containing this template",
"search_home": "new search notes will be created as children of this note", "search_home": "new search notes will be created as children of this note",
"workspace_search_home": "new search notes will be created as children of this note when hoisted to some ancestor of this workspace note", "workspace_search_home": "new search notes will be created as children of this note when hoisted to some ancestor of this workspace note",
"auto_execute_search": "Automatically executes the search defined in a saved search note and switches to the Collection Properties tab if any notes match the query",
"inbox": "default inbox location for new notes - when you create a note using \"new note\" button in the sidebar, notes will be created as child notes in the note marked as with <code>#inbox</code> label.", "inbox": "default inbox location for new notes - when you create a note using \"new note\" button in the sidebar, notes will be created as child notes in the note marked as with <code>#inbox</code> label.",
"workspace_inbox": "default inbox location for new notes when hoisted to some ancestor of this workspace note", "workspace_inbox": "default inbox location for new notes when hoisted to some ancestor of this workspace note",
"sql_console_home": "default location of SQL console notes", "sql_console_home": "default location of SQL console notes",

View File

@ -236,6 +236,7 @@ const ATTR_HELP: Record<string, Record<string, string>> = {
workspaceTemplate: t("attribute_detail.workspace_template"), workspaceTemplate: t("attribute_detail.workspace_template"),
searchHome: t("attribute_detail.search_home"), searchHome: t("attribute_detail.search_home"),
workspaceSearchHome: t("attribute_detail.workspace_search_home"), workspaceSearchHome: t("attribute_detail.workspace_search_home"),
autoExecuteSearch: t("attribute_detail.auto_execute_search"),
inbox: t("attribute_detail.inbox"), inbox: t("attribute_detail.inbox"),
workspaceInbox: t("attribute_detail.workspace_inbox"), workspaceInbox: t("attribute_detail.workspace_inbox"),
sqlConsoleHome: t("attribute_detail.sql_console_home"), sqlConsoleHome: t("attribute_detail.sql_console_home"),

View File

@ -49,30 +49,6 @@
z-index: 50; z-index: 50;
} }
.calendar-container a.fc-event {
text-decoration: none;
}
.calendar-container a.fc-event.archived {
opacity: .65;
}
.calendar-container a.fc-event.archived::after {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
--c1: transparent;
--c2: var(--callendar-coll-event-archived-sripe-color);
background: repeating-linear-gradient(45deg, var(--c1), var(--c1) 8px,
var(--c2) 8px, var(--c2) 16px) !important;
}
.calendar-container .fc-button { .calendar-container .fc-button {
padding: 0.2em 0.5em; padding: 0.2em 0.5em;
} }
@ -113,15 +89,38 @@ body.desktop:not(.zen) .calendar-view .calendar-header {
/* #region Events */ /* #region Events */
.calendar-view a.fc-timegrid-event, /*
.calendar-view a.fc-daygrid-event, * week, month, year views
.fc-daygrid-dot-event .fc-event-title { */
font-weight: 500;
.calendar-container a.fc-event {
text-decoration: none;
} }
.calendar-view a.fc-timegrid-event:focus-visible, .calendar-container a.fc-event.archived {
.calendar-view a.fc-daygrid-event:focus-visible { opacity: .65;
outline: none; }
.calendar-container a.fc-event.archived::after {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
--c1: transparent;
--c2: var(--callendar-coll-event-archived-sripe-color);
background: repeating-linear-gradient(45deg, var(--c1), var(--c1) 8px,
var(--c2) 8px, var(--c2) 16px);
}
.calendar-view a.fc-timegrid-event,
.calendar-view a.fc-daygrid-event,
.calendar-view .fc-daygrid-dot-event .fc-event-title {
font-weight: 500;
} }
.calendar-view a.fc-timegrid-event, .calendar-view a.fc-timegrid-event,
@ -137,6 +136,20 @@ body.desktop:not(.zen) .calendar-view .calendar-header {
padding-left: 8px; padding-left: 8px;
} }
.calendar-view .fc-timegrid-event.with-hue,
.calendar-view .fc-daygrid-event.with-hue {
--fc-event-text-color: var(--custom-color);
--fc-event-bg-color: hsl(var(--custom-color-hue),
var(--calendar-coll-event-background-saturation),
var(--calendar-coll-event-background-lightness)) !important;
}
.calendar-view a.fc-timegrid-event:focus-visible,
.calendar-view a.fc-daygrid-event:focus-visible {
outline: none;
}
.calendar-view a.fc-timegrid-event.fc-event-selected, .calendar-view a.fc-timegrid-event.fc-event-selected,
.calendar-view a.fc-timegrid-event.fc-event:focus, .calendar-view a.fc-timegrid-event.fc-event:focus,
.calendar-view a.fc-daygrid-event.fc-event-selected, .calendar-view a.fc-daygrid-event.fc-event-selected,
@ -153,21 +166,26 @@ body.desktop:not(.zen) .calendar-view .calendar-header {
opacity: 1; opacity: 1;
} }
.calendar-view .fc-timegrid-event.with-hue, .calendar-view .fc-daygrid-event-dot {
.calendar-view .fc-daygrid-event.with-hue { display: none;
--fc-event-text-color: var(--custom-color);
--fc-event-bg-color: hsl(var(--custom-color-hue),
var(--calendar-coll-event-background-saturation),
var(--calendar-coll-event-background-lightness)) !important;
} }
.calendar-view .fc-event-time { .calendar-view .fc-event-time {
opacity: .75; opacity: .75;
} }
.fc-daygrid-event-dot { /*
display: none; * List view
*/
.fc-list-table tr.fc-event.archived {
opacity: .5;
}
.fc-list-table .fc-list-event-dot {
/* Apply note colors to the list item dots */
--fc-event-border-color: var(--custom-color);
} }
/* #endregion */ /* #endregion */

View File

@ -22,7 +22,7 @@ import RenameNoteBulkAction from "../bulk_actions/note/rename_note";
import { getErrorMessage } from "../../services/utils"; import { getErrorMessage } from "../../services/utils";
import "./SearchDefinitionTab.css"; import "./SearchDefinitionTab.css";
export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext) { export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext }: TabContext) {
const parentComponent = useContext(ParentComponent); const parentComponent = useContext(ParentComponent);
const [ searchOptions, setSearchOptions ] = useState<{ availableOptions: SearchOption[], activeOptions: SearchOption[] }>(); const [ searchOptions, setSearchOptions ] = useState<{ availableOptions: SearchOption[], activeOptions: SearchOption[] }>();
const [ error, setError ] = useState<{ message: string }>(); const [ error, setError ] = useState<{ message: string }>();
@ -73,6 +73,27 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext)
} }
}); });
useEffect(() => {
async function autoExecute() {
if (!note || note.type !== "search" || !note.hasLabel("autoExecuteSearch")) {
executionState.save("");
return;
}
const lastExecutedNoteId = executionState.load();
if (lastExecutedNoteId !== note.noteId) {
executionState.save(note.noteId);
await refreshResults();
if (noteContext?.viewScope?.viewMode === "default" && note.children.length > 0) {
parentComponent?.triggerCommand("toggleRibbonTabBookProperties", {});
}
}
}
autoExecute();
}, [note]);
return ( return (
<div className="search-definition-widget"> <div className="search-definition-widget">
<div className="search-settings"> <div className="search-settings">
@ -160,6 +181,14 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext)
) )
} }
const executionState = function() {
let lastAutoExecutedSearchNoteId = "";
return {
load: () => lastAutoExecutedSearchNoteId,
save: (noteId: string) => lastAutoExecutedSearchNoteId = noteId,
};
}();
function BulkActionsList({ note }: { note: FNote }) { function BulkActionsList({ note }: { note: FNote }) {
const [ bulkActions, setBulkActions ] = useState<RenameNoteBulkAction[]>(); const [ bulkActions, setBulkActions ] = useState<RenameNoteBulkAction[]>();

File diff suppressed because one or more lines are too long

View File

@ -63,7 +63,7 @@ For each note of the calendar, the following attributes can be used:
| `#startTime` | The time the event starts at. If this value is missing, then the event is considered a full-day event. The format is `HH:MM` (hours in 24-hour format and minutes). | | `#startTime` | The time the event starts at. If this value is missing, then the event is considered a full-day event. The format is `HH:MM` (hours in 24-hour format and minutes). |
| `#endTime` | Similar to `startTime`, it mentions the time at which the event ends (in relation with `endDate` if present, or `startDate`). | | `#endTime` | Similar to `startTime`, it mentions the time at which the event ends (in relation with `endDate` if present, or `startDate`). |
| `#color` | Displays the event with a specified color (named such as `red`, `gray` or hex such as `#FF0000`). This will also change the color of the note in other places such as the note tree. | | `#color` | Displays the event with a specified color (named such as `red`, `gray` or hex such as `#FF0000`). This will also change the color of the note in other places such as the note tree. |
| `#calendar:color` | Similar to `#color`, but applies the color only for the event in the calendar and not for other places such as the note tree. | | `#calendar:color` | Similar to `#color`, but applies the color only for the event in the calendar and not for other places such as the note tree. (*Deprecated*) |
| `#iconClass` | If present, the icon of the note will be displayed to the left of the event title. | | `#iconClass` | If present, the icon of the note will be displayed to the left of the event title. |
| `#calendar:title` | Changes the title of an event to point to an attribute of the note other than the title, can either a label or a relation (without the `#` or `~` symbol). See _Use-cases_ for more information. | | `#calendar:title` | Changes the title of an event to point to an attribute of the note other than the title, can either a label or a relation (without the `#` or `~` symbol). See _Use-cases_ for more information. |
| `#calendar:displayedAttributes` | Allows displaying the value of one or more attributes in the calendar like this:     <br> <br>![](9_Calendar_image.png)    <br> <br>`#weight="70" #Mood="Good" #calendar:displayedAttributes="weight,Mood"`   <br> <br>It can also be used with relations, case in which it will display the title of the target note:    <br> <br>`~assignee=@My assignee #calendar:displayedAttributes="assignee"` | | `#calendar:displayedAttributes` | Allows displaying the value of one or more attributes in the calendar like this:     <br> <br>![](9_Calendar_image.png)    <br> <br>`#weight="70" #Mood="Good" #calendar:displayedAttributes="weight,Mood"`   <br> <br>It can also be used with relations, case in which it will display the title of the target note:    <br> <br>`~assignee=@My assignee #calendar:displayedAttributes="assignee"` |

View File

@ -25,7 +25,6 @@
], ],
"devDependencies": { "devDependencies": {
"@ckeditor/ckeditor5-dev-build-tools": "43.1.0", "@ckeditor/ckeditor5-dev-build-tools": "43.1.0",
"@ckeditor/ckeditor5-dev-utils": "43.1.0",
"@ckeditor/ckeditor5-inspector": ">=4.1.0", "@ckeditor/ckeditor5-inspector": ">=4.1.0",
"@ckeditor/ckeditor5-package-tools": "5.0.1", "@ckeditor/ckeditor5-package-tools": "5.0.1",
"@typescript-eslint/eslint-plugin": "~8.48.0", "@typescript-eslint/eslint-plugin": "~8.48.0",

View File

@ -23,6 +23,7 @@ type Labels = {
ancestorDepth: string; ancestorDepth: string;
orderBy: string; orderBy: string;
orderDirection: string; orderDirection: string;
autoExecuteSearch: boolean;
// Collection-specific // Collection-specific
viewType: string; viewType: string;

1255
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff