From 6d7beef1b1efb46dade92d285275b77cd3a6e310 Mon Sep 17 00:00:00 2001 From: Gamosoft Date: Sat, 8 Nov 2025 17:21:37 +0100 Subject: [PATCH 1/2] try to make the docker build only when pushing into main (direct or PR merge) --- .github/workflows/docker-publish.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7d9c738..77fa84d 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -7,10 +7,6 @@ on: - master tags: - 'v*.*.*' - pull_request: - branches: - - main - - master workflow_dispatch: env: @@ -45,7 +41,6 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=ref,event=branch - type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} @@ -56,7 +51,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . - push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha From 1b4f3263f31b86550e40c7d434c632df631f97df Mon Sep 17 00:00:00 2001 From: Gamosoft Date: Sun, 9 Nov 2025 10:17:09 +0100 Subject: [PATCH 2/2] miscellaneous - changed docker build - light themes showing vertical lines - resizable panels when in split view mode - added funding yaml :-) --- .github/FUNDING.yml | 7 ++++ .github/workflows/docker-publish.yml | 13 +++++-- README.md | 18 ++++------ frontend/app.js | 54 ++++++++++++++++++++++++++++ frontend/index.html | 34 +++++++++++++++--- 5 files changed, 106 insertions(+), 20 deletions(-) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..686a5db --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,7 @@ +# GitHub Sponsors configuration +# This adds a "Sponsor" button to your repository + +# PayPal donation link (can add up to 4 custom links) +custom: + - 'https://paypal.me/gamosoft' + diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 77fa84d..153556f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,10 +1,13 @@ name: Build and Push Docker Image to GHCR on: - push: + pull_request: + types: + - closed branches: - main - master + push: tags: - 'v*.*.*' workflow_dispatch: @@ -15,6 +18,11 @@ env: jobs: build-and-push: + # Only run if PR was merged (not just closed) or if triggered by tag/manual + if: | + (github.event_name == 'pull_request' && github.event.pull_request.merged == true) || + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest permissions: contents: read @@ -40,11 +48,10 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=ref,event=branch type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=latest,enable=true - name: Build and push Docker image id: build-push diff --git a/README.md b/README.md index 7e3e73e..fc21226 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,8 @@ NoteDiscovery is a **lightweight, self-hosted note-taking application** that put Use the pre-built image directly from GHCR - no building required! +> **πŸ’‘ Tip**: Always use `ghcr.io/gamosoft/notediscovery:latest` to get the newest features and fixes. Images are automatically built when PRs are merged to main. + > **πŸ“ Important - Volume Mapping**: The container needs local folders/files to work: > - **Required**: `data` folder (your notes will be stored here) > - **Required**: `themes` folder with theme `.css` files (at least light.css and dark.css) @@ -200,6 +202,10 @@ Once you've started NoteDiscovery, you'll find comprehensive guides on: πŸ’‘ **Tip:** These documentation files are regular markdown notesβ€”edit them, add your own notes, or use them as templates. It's your knowledge base! +## πŸ’– Support Development + +If you find NoteDiscovery useful, consider [β˜• buying me a coffee](https://paypal.me/gamosoft) to help keep the project going. Every bit helps with new features, bug fixes, and improvements. Thank you! + ## πŸ”’ Security Considerations NoteDiscovery is designed for **self-hosted, private use**. Please keep these security considerations in mind: @@ -230,18 +236,6 @@ NoteDiscovery is designed for **self-hosted, private use**. Please keep these se **TL;DR**: Perfect for personal use on your local machine or home network. Add a reverse proxy with authentication if exposing to wider networks. -## πŸ’– Support Development - -If NoteDiscovery makes your life easier, consider buying me a coffee! Your support helps keep this project alive and growing. - -**[β˜• Buy Me a Coffee](https://paypal.me/gamosoft)** - -Every contribution, no matter how small, is deeply appreciated and helps fund: -- πŸ› οΈ New features and improvements -- πŸ› Bug fixes and maintenance -- πŸ“š Documentation and tutorials -- 🎨 Design enhancements - ## πŸ“„ License MIT License - Free to use, modify, and distribute. diff --git a/frontend/app.js b/frontend/app.js index ff54173..a10ef64 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -81,6 +81,10 @@ function noteApp() { sidebarWidth: CONFIG.DEFAULT_SIDEBAR_WIDTH, isResizing: false, + // Split view resize state + editorWidth: 50, // percentage + isResizingSplit: false, + // DOM element cache (to avoid repeated querySelector calls) _domCache: { editor: null, @@ -96,6 +100,7 @@ function noteApp() { await this.loadNotes(); await this.checkStatsPlugin(); this.loadSidebarWidth(); + this.loadEditorWidth(); this.loadViewMode(); // Parse URL and load specific note if provided @@ -2025,6 +2030,55 @@ function noteApp() { document.addEventListener('mouseup', stopResize); }, + // Start resizing split panes (editor/preview) + startSplitResize(event) { + this.isResizingSplit = true; + event.preventDefault(); + + const container = event.target.parentElement; + + const resize = (e) => { + if (!this.isResizingSplit) return; + + const containerRect = container.getBoundingClientRect(); + const mouseX = e.clientX - containerRect.left; + const percentage = (mouseX / containerRect.width) * 100; + + // Clamp between 20% and 80% + if (percentage >= 20 && percentage <= 80) { + this.editorWidth = percentage; + } + }; + + const stopResize = () => { + if (this.isResizingSplit) { + this.isResizingSplit = false; + this.saveEditorWidth(); + document.removeEventListener('mousemove', resize); + document.removeEventListener('mouseup', stopResize); + } + }; + + document.addEventListener('mousemove', resize); + document.addEventListener('mouseup', stopResize); + }, + + // Load editor width from localStorage + loadEditorWidth() { + const saved = localStorage.getItem('editorWidth'); + if (saved) { + const width = parseFloat(saved); + if (width >= 20 && width <= 80) { + this.editorWidth = width; + } + } + }, + + // Save editor width to localStorage + saveEditorWidth() { + localStorage.setItem('editorWidth', this.editorWidth.toString()); + }, + // Scroll to top of editor and preview scrollToTop() { // Disable scroll sync temporarily to prevent interference diff --git a/frontend/index.html b/frontend/index.html index 2db161c..6344f99 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -340,7 +340,7 @@ top: 0; bottom: 0; width: 1px; - background-color: var(--border-primary); + background-color: var(--text-tertiary); opacity: 0.4; } @@ -392,6 +392,21 @@ background-color: var(--accent-hover) !important; } + /* Split view resize handle */ + .split-resize-handle { + position: relative; + user-select: none; + flex-shrink: 0; + } + + .split-resize-handle:hover { + background-color: var(--accent-primary) !important; + } + + .split-resize-handle:active { + background-color: var(--accent-hover) !important; + } + /* Enhanced Shell/Bash Syntax Highlighting */ .markdown-preview pre code.language-shell .hljs-meta, .markdown-preview pre code.language-bash .hljs-meta, @@ -870,14 +885,13 @@ -
+
+ +
+