Skip to content

Build your personal knowledge base with Trilium Notes

remove "hide included images" feature since with attachments it's no longer necessary

zadam0b270ee87ac0
diff --git a/db/migrations/0219__remove_hideIncludedImages_main_option.sql b/db/migrations/0219__remove_hideIncludedImages_main_option.sql
new file mode 100644
index 0000000000..5e4ec083b0
--- /dev/null
+++ b/db/migrations/0219__remove_hideIncludedImages_main_option.sql
@@ -0,0 +1,2 @@
+DELETE FROM options WHERE name = 'hideIncludedImages_main';
+DELETE FROM entity_changes WHERE entityName = 'options' AND entityId = 'hideIncludedImages_main';
\ No newline at end of file
diff --git a/src/public/app/entities/fnote.js b/src/public/app/entities/fnote.js
index 1f44a97bfd..6cf6d1b580 100644
--- a/src/public/app/entities/fnote.js
+++ b/src/public/app/entities/fnote.js
@@ -490,13 +490,6 @@ class FNote {
return;
}
- if (options.is("hideIncludedImages_main")) {
- const imageLinks = this.getRelations('imageLink');
-
- // image is already visible in the parent note so no need to display it separately in the book
- childBranches = childBranches.filter(branch => !imageLinks.find(rel => rel.value === branch.noteId));
- }
-
// we're not checking hideArchivedNotes since that would mean we need to lazy load the child notes
// which would seriously slow down everything.
// we check this flag only once user chooses to expand the parent. This has the negative consequence that
diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js
index 43d2ee8f8e..ed6c03bfe2 100644
--- a/src/public/app/widgets/note_tree.js
+++ b/src/public/app/widgets/note_tree.js
@@ -119,15 +119,6 @@ const TPL = `
Hide archived notes
</label>
</div>
- <div class="form-check">
- <label class="form-check-label">
- <input class="form-check-input hide-included-images" type="checkbox" value="">
-
- Hide images included in a note
- <span class="bx bx-info-circle"
- title="Images which are shown in the parent text note will not be displayed in the tree"></span>
- </label>
- </div>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input auto-collapse-note-tree" type="checkbox" value="">
@@ -194,7 +185,6 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
this.$treeSettingsPopup = this.$widget.find('.tree-settings-popup');
this.$hideArchivedNotesCheckbox = this.$treeSettingsPopup.find('.hide-archived-notes');
- this.$hideIncludedImages = this.$treeSettingsPopup.find('.hide-included-images');
this.$autoCollapseNoteTree = this.$treeSettingsPopup.find('.auto-collapse-note-tree');
this.$treeSettingsButton = this.$widget.find('.tree-settings-button');
@@ -205,7 +195,6 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
}
this.$hideArchivedNotesCheckbox.prop("checked", this.hideArchivedNotes);
- this.$hideIncludedImages.prop("checked", this.hideIncludedImages);
this.$autoCollapseNoteTree.prop("checked", this.autoCollapseNoteTree);
const top = this.$treeActions[0].offsetTop - (this.$treeSettingsPopup.outerHeight());
@@ -229,7 +218,6 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
this.$saveTreeSettingsButton = this.$treeSettingsPopup.find('.save-tree-settings-button');
this.$saveTreeSettingsButton.on('click', async () => {
await this.setHideArchivedNotes(this.$hideArchivedNotesCheckbox.prop("checked"));
- await this.setHideIncludedImages(this.$hideIncludedImages.prop("checked"));
await this.setAutoCollapseNoteTree(this.$autoCollapseNoteTree.prop("checked"));
this.$treeSettingsPopup.hide();
@@ -279,14 +267,6 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
await options.save(`hideArchivedNotes_${this.treeName}`, val.toString());
}
- get hideIncludedImages() {
- return options.is(`hideIncludedImages_${this.treeName}`);
- }
-
- async setHideIncludedImages(val) {
- await options.save(`hideIncludedImages_${this.treeName}`, val.toString());
- }
-
get autoCollapseNoteTree() {
return options.is("autoCollapseNoteTree");
}
diff --git a/src/routes/api/options.js b/src/routes/api/options.js
index ddb4321ecc..c4109f2a7f 100644
--- a/src/routes/api/options.js
+++ b/src/routes/api/options.js
@@ -136,8 +136,7 @@ function isAllowed(name) {
return ALLOWED_OPTIONS.has(name)
|| name.startsWith("keyboardShortcuts")
|| name.endsWith("Collapsed")
- || name.startsWith("hideArchivedNotes")
- || name.startsWith("hideIncludedImages");
+ || name.startsWith("hideArchivedNotes");
}
module.exports = {
diff --git a/src/services/app_info.js b/src/services/app_info.js
index c943d17ad9..1a4313229e 100644
--- a/src/services/app_info.js
+++ b/src/services/app_info.js
@@ -4,7 +4,7 @@ const build = require('./build');
const packageJson = require('../../package');
const {TRILIUM_DATA_DIR} = require('./data_dir');
-const APP_DB_VERSION = 218;
+const APP_DB_VERSION = 219;
const SYNC_VERSION = 30;
const CLIPPER_PROTOCOL_VERSION = "1.0";
diff --git a/src/services/options_init.js b/src/services/options_init.js
index fd66718f8c..c22a0567f1 100644
--- a/src/services/options_init.js
+++ b/src/services/options_init.js
@@ -71,7 +71,6 @@ const defaultOptions = [
{ name: 'nativeTitleBarVisible', value: 'false', isSynced: false },
{ name: 'eraseEntitiesAfterTimeInSeconds', value: '604800', isSynced: true }, // default is 7 days
{ name: 'hideArchivedNotes_main', value: 'false', isSynced: false },
- { name: 'hideIncludedImages_main', value: 'true', isSynced: false },
{ name: 'attributeListExpanded', value: 'false', isSynced: false },
{ name: 'promotedAttributesExpanded', value: 'true', isSynced: true },
{ name: 'similarNotesExpanded', value: 'true', isSynced: true },