From 221fd3c29707c490af4df111e19128c60a6d2e15 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Sat, 30 Nov 2024 19:10:44 +0200 Subject: [PATCH 01/11] style(next): update colors --- src/public/stylesheets/theme-next.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/public/stylesheets/theme-next.css b/src/public/stylesheets/theme-next.css index 22556aba9..8f679d8e7 100644 --- a/src/public/stylesheets/theme-next.css +++ b/src/public/stylesheets/theme-next.css @@ -101,7 +101,7 @@ --menu-text-color: #272727; --menu-background-color: #ffffffd9; - --menu-item-icon-color: #505050; + --menu-item-icon-color: #727272; --menu-item-disabled-opacity: .5; --menu-item-keyboard-shortcut-color: #666666a8; --menu-item-arrow-color: #00000080; @@ -131,7 +131,7 @@ --left-pane-item-selected-action-button-hover-shadow: 2px 2px 10px rgba(0, 0, 0, .25); --launcher-pane-background-color: #e8e8e8; - --launcher-pane-text-color: #464646; + --launcher-pane-text-color: #000000bd; --launcher-pane-button-hover-color: black; --launcher-pane-button-hover-background: white; --launcher-pane-button-hover-shadow: 4px 4px 4px rgba(0, 0, 0, .075); From 091f06253f73a2ab4bc1cc5c3742f982ed25aa25 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 21 Jul 2024 22:10:19 +0300 Subject: [PATCH 02/11] feat(electron): support live reload in dist/src/public --- src/services/ws.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/ws.ts b/src/services/ws.ts index 06ee20d58..8f9f5b418 100644 --- a/src/services/ws.ts +++ b/src/services/ws.ts @@ -18,7 +18,7 @@ if (env.isDev()) { const debounce = (await import("debounce")).default; const debouncedReloadFrontend = debounce(() => reloadFrontend("source code change"), 200); chokidar - .watch('src/public') + .watch(utils.isElectron() ? 'dist/src/public' : 'src/public') .on('add', debouncedReloadFrontend) .on('change', debouncedReloadFrontend) .on('unlink', debouncedReloadFrontend); From e7c4e037e04506f0a48840ed20046a6d1bdf9a92 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 21 Jul 2024 22:20:02 +0300 Subject: [PATCH 03/11] feat(electron): add script to watch for src/public changes --- bin/watch-dist.ts | 18 ++++++++++++++++++ package.json | 1 + 2 files changed, 19 insertions(+) create mode 100644 bin/watch-dist.ts diff --git a/bin/watch-dist.ts b/bin/watch-dist.ts new file mode 100644 index 000000000..490ffbe5d --- /dev/null +++ b/bin/watch-dist.ts @@ -0,0 +1,18 @@ +import chokidar from "chokidar"; +import fs from "fs"; +import path from "path"; + +const emptyCallback = () => {}; + +function onFileChanged(sourceFile: string) { + const destFile = path.join("dist", sourceFile); + console.log(`${sourceFile} -> ${destFile}`); + fs.copyFile(sourceFile, destFile, emptyCallback); +} + +const sourceDir = "src/public"; + +chokidar + .watch(sourceDir) + .on("change", onFileChanged); +console.log(`Watching for changes to ${sourceDir}...`); \ No newline at end of file diff --git a/package.json b/package.json index bb30df31c..df0468fe5 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "make-electron": "npm run webpack && npm run prepare-dist && electron-forge make", "package-electron": "electron-forge package", "prepare-dist": "rimraf ./dist && tsc && tsx ./bin/copy-dist.ts", + "watch-dist": "tsx ./bin/watch-dist.ts", "update-build-info": "tsx bin/update-build-info.ts", "errors": "tsc --watch --noEmit", "integration-edit-db": "cross-env TRILIUM_INTEGRATION_TEST=edit TRILIUM_PORT=8081 TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts", From c4085b07298d3f56ed16598639c65c3164e7eb1c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 1 Dec 2024 09:53:15 +0200 Subject: [PATCH 04/11] style(next): joined tabs to launch bar on horizontal layout --- src/public/stylesheets/theme-next.css | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/public/stylesheets/theme-next.css b/src/public/stylesheets/theme-next.css index 8f679d8e7..25ce4faff 100644 --- a/src/public/stylesheets/theme-next.css +++ b/src/public/stylesheets/theme-next.css @@ -653,6 +653,10 @@ html body #left-pane .quick-search:focus-within .search-button:hover, height: var(--tab-height) !important; } +#root-widget.horizontal-layout .tab-row-widget-container { + margin-top: calc((var(--tab-bar-height) - var(--tab-height))); +} + .tab-row-widget .note-tab .note-tab-wrapper { height: var(--tab-height) !important; transition: background 75ms ease-in, @@ -663,6 +667,11 @@ html body #left-pane .quick-search:focus-within .search-button:hover, transition: none; } +#root-widget.horizontal-layout .tab-row-widget .note-tab .note-tab-wrapper { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} + .tab-row-widget .note-tab:nth-child(1) { transform: translate3d(var(--tab-first-item-horiz-offset), 0, 0); } From ad62611e90ca5be4282303c462fb00de6c863953 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 1 Dec 2024 09:58:04 +0200 Subject: [PATCH 05/11] style(next): apply same color to tab and launch bar --- src/public/stylesheets/theme-next.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/public/stylesheets/theme-next.css b/src/public/stylesheets/theme-next.css index 25ce4faff..45badb33d 100644 --- a/src/public/stylesheets/theme-next.css +++ b/src/public/stylesheets/theme-next.css @@ -131,6 +131,7 @@ --left-pane-item-selected-action-button-hover-shadow: 2px 2px 10px rgba(0, 0, 0, .25); --launcher-pane-background-color: #e8e8e8; + --launcher-pane-horizontal-background-color: #fafafa; --launcher-pane-text-color: #000000bd; --launcher-pane-button-hover-color: black; --launcher-pane-button-hover-background: white; @@ -341,6 +342,11 @@ background-color: var(--root-background); } +#root-widget.horizontal-layout { + --launcher-pane-background-color: var(--launcher-pane-horizontal-background-color); + --active-tab-background-color: var(--launcher-pane-background-color); +} + /* Matches when the left pane is collapsed */ :has(#left-pane.hidden-int) { --center-pane-border-radius: 0; @@ -361,7 +367,7 @@ } #launcher-pane.horizontal { - height: var(--launcher-pane-size) !important; + height: var(--launcher-pane-size) !important; } #launcher-pane .launcher-button { From 6da50670032b0bb7f70b92e7d340ebd4b8f5786c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 1 Dec 2024 10:01:46 +0200 Subject: [PATCH 06/11] style(next): add a border between tab bar and launcher on horizontal --- src/public/stylesheets/theme-next.css | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/public/stylesheets/theme-next.css b/src/public/stylesheets/theme-next.css index 45badb33d..73b094929 100644 --- a/src/public/stylesheets/theme-next.css +++ b/src/public/stylesheets/theme-next.css @@ -68,6 +68,7 @@ --main-background-color: white; --main-text-color: black; --main-border-color: #dbdbdb; + --subtle-border-color: rgba(0, 0, 0, 0.1); --dropdown-border-color: #ccc; --dropdown-shadow-opacity: .2; --dropdown-item-icon-destructive-color: #ec5138; @@ -654,6 +655,20 @@ html body #left-pane .quick-search:focus-within .search-button:hover, margin: 13px 10px !important; } +.tab-row-container { + position: relative; +} + +#root-widget.horizontal-layout .tab-row-container:after { + content: ""; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 1px; + background: var(--subtle-border-color); +} + .tab-row-widget-container { margin-top: calc((var(--tab-bar-height) - var(--tab-height)) / 2); height: var(--tab-height) !important; @@ -661,6 +676,7 @@ html body #left-pane .quick-search:focus-within .search-button:hover, #root-widget.horizontal-layout .tab-row-widget-container { margin-top: calc((var(--tab-bar-height) - var(--tab-height))); + position: relative; } .tab-row-widget .note-tab .note-tab-wrapper { From f8f61c1c3e92b1ca11a7348b870c4e613fec638a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 1 Dec 2024 10:13:30 +0200 Subject: [PATCH 07/11] style(next): improve horizontal layout slightly --- src/public/stylesheets/theme-next.css | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/public/stylesheets/theme-next.css b/src/public/stylesheets/theme-next.css index 73b094929..332c56897 100644 --- a/src/public/stylesheets/theme-next.css +++ b/src/public/stylesheets/theme-next.css @@ -39,6 +39,7 @@ --left-pane-item-selected-shadow-size: 2px; --launcher-pane-size: 58px; + --launcher-pane-horizontal-size: 54px; --launcher-pane-button-margin: 6px; --launcher-pane-button-gap: 3px; @@ -345,6 +346,7 @@ #root-widget.horizontal-layout { --launcher-pane-background-color: var(--launcher-pane-horizontal-background-color); + --launcher-pane-size: var(--launcher-pane-horizontal-size); --active-tab-background-color: var(--launcher-pane-background-color); } @@ -361,6 +363,10 @@ /* * Launcher pane */ +#launcher-container, +#root-widget.horizontal-layout > .horizontal { + align-items: center; +} #launcher-pane.vertical { width: var(--launcher-pane-size) !important; @@ -368,13 +374,18 @@ } #launcher-pane.horizontal { - height: var(--launcher-pane-size) !important; + height: var(--launcher-pane-size) !important; + border-bottom: 1px solid var(--subtle-border-color); } -#launcher-pane .launcher-button { +#launcher-pane .launcher-button, +#launcher-pane .dropdown { width: calc(var(--launcher-pane-size) - (var(--launcher-pane-button-margin) * 2)) !important; height: calc(var(--launcher-pane-size) - (var(--launcher-pane-button-margin) * 2)) !important; margin: var(--launcher-pane-button-gap) var(--launcher-pane-button-margin); +} + +#launcher-pane .launcher-button { padding: 0 !important; border-radius: 8px; transition: background-color 300ms ease-out, @@ -383,6 +394,10 @@ cursor: default; } +#launcher-pane .dropdown .launcher-button { + margin: 0; +} + #launcher-pane .launcher-button:active, #launcher-pane .launcher-button.show { transform: scale(0.9); From a883744237385c6cca824409ae17f7b3146c861c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 1 Dec 2024 10:19:14 +0200 Subject: [PATCH 08/11] fix(launcher): tooltip position for bookmark buttons --- src/public/app/widgets/bookmark_buttons.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/public/app/widgets/bookmark_buttons.js b/src/public/app/widgets/bookmark_buttons.js index 9329f4761..ff5ece915 100644 --- a/src/public/app/widgets/bookmark_buttons.js +++ b/src/public/app/widgets/bookmark_buttons.js @@ -8,6 +8,7 @@ export default class BookmarkButtons extends FlexContainer { super(isHorizontalLayout ? "row" : "column"); this.contentSized(); + this.settings = {}; } async refresh() { @@ -24,6 +25,10 @@ export default class BookmarkButtons extends FlexContainer { ? new BookmarkFolderWidget(note) : new OpenNoteButtonWidget(note) .class("launcher-button"); + if (!buttonWidget.settings) { + buttonWidget = {}; + } + buttonWidget.settings.titlePlacement = this.settings.titlePlacement; this.child(buttonWidget); From 6c035c7756175cb9c0f3494ae7ad00c59eb3936c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 1 Dec 2024 10:25:38 +0200 Subject: [PATCH 09/11] style(next): improve tab hover color and alignment --- src/public/stylesheets/theme-next.css | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/public/stylesheets/theme-next.css b/src/public/stylesheets/theme-next.css index 332c56897..b354247d6 100644 --- a/src/public/stylesheets/theme-next.css +++ b/src/public/stylesheets/theme-next.css @@ -348,6 +348,7 @@ --launcher-pane-background-color: var(--launcher-pane-horizontal-background-color); --launcher-pane-size: var(--launcher-pane-horizontal-size); --active-tab-background-color: var(--launcher-pane-background-color); + --active-tab-hover-background-color: var(--active-tab-background-color); } /* Matches when the left pane is collapsed */ @@ -667,7 +668,7 @@ html body #left-pane .quick-search:focus-within .search-button:hover, } .tab-row-container .toggle-button { - margin: 13px 10px !important; + margin: 6px 10px !important; } .tab-row-container { @@ -687,10 +688,15 @@ html body #left-pane .quick-search:focus-within .search-button:hover, .tab-row-widget-container { margin-top: calc((var(--tab-bar-height) - var(--tab-height)) / 2); height: var(--tab-height) !important; + overflow: hidden; +} + +#root-widget.horizontal-layout .tab-row-container { + padding-top: calc((var(--tab-bar-height) - var(--tab-height))); } #root-widget.horizontal-layout .tab-row-widget-container { - margin-top: calc((var(--tab-bar-height) - var(--tab-height))); + margin-top: 0; position: relative; } From 082cb71e830a20b6055aa978e0d2fa8a27c44854 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 1 Dec 2024 10:31:00 +0200 Subject: [PATCH 10/11] style(next): tweak launcher bar height --- src/public/stylesheets/theme-next.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/public/stylesheets/theme-next.css b/src/public/stylesheets/theme-next.css index b354247d6..39ca9bd94 100644 --- a/src/public/stylesheets/theme-next.css +++ b/src/public/stylesheets/theme-next.css @@ -40,6 +40,7 @@ --launcher-pane-size: 58px; --launcher-pane-horizontal-size: 54px; + --launcher-pane-horizontal-icon-size: 20px; --launcher-pane-button-margin: 6px; --launcher-pane-button-gap: 3px; @@ -415,6 +416,10 @@ box-shadow 100ms ease-in; } +#launcher-pane.horizontal .launcher-button { + font-size: var(--launcher-pane-horizontal-icon-size); +} + #launcher-pane .global-menu-button { --hover-item-background-color: transparent; } From 947cff58050dbae5e416fc193df4bce1086debb0 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 1 Dec 2024 10:32:22 +0200 Subject: [PATCH 11/11] style(next): tweak add new tab background --- src/public/stylesheets/theme-next.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/public/stylesheets/theme-next.css b/src/public/stylesheets/theme-next.css index 39ca9bd94..e4af65960 100644 --- a/src/public/stylesheets/theme-next.css +++ b/src/public/stylesheets/theme-next.css @@ -350,6 +350,7 @@ --launcher-pane-size: var(--launcher-pane-horizontal-size); --active-tab-background-color: var(--launcher-pane-background-color); --active-tab-hover-background-color: var(--active-tab-background-color); + --new-tab-button-background: transparent; } /* Matches when the left pane is collapsed */