diff --git a/app/static/css/style.css b/app/static/css/style.css index 4fb93d0..7bdfad0 100644 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -1311,6 +1311,15 @@ main { transition: background-color 0.15s ease; } +.filter-bar-btn-me { + background-color: #e7f1ff; + color: #0d6efd; +} + +.filter-bar-btn-me:hover { + background-color: #cfe2ff; +} + .filter-bar-btn-clear { background-color: #f8f9fa; color: #6c757d; diff --git a/app/static/js/app.js b/app/static/js/app.js index 29a2add..96964f2 100644 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -2853,6 +2853,19 @@ function initializeFilter() { openFilterBar(); }); + // "Filter my messages" button - inserts current device name + const filterMeBtn = document.getElementById('filterMeBtn'); + if (filterMeBtn) { + filterMeBtn.addEventListener('click', () => { + const deviceName = window.MC_CONFIG?.deviceName || ''; + if (deviceName) { + filterInput.value = deviceName; + applyFilter(deviceName); + filterInput.focus(); + } + }); + } + // Filter as user types (debounced) - also check for @mentions let filterTimeout = null; filterInput.addEventListener('input', () => { diff --git a/app/static/js/dm.js b/app/static/js/dm.js index 92e6f00..50fe0ed 100644 --- a/app/static/js/dm.js +++ b/app/static/js/dm.js @@ -55,6 +55,9 @@ document.addEventListener('DOMContentLoaded', async function() { // Initialize filter functionality initializeDmFilter(); + // Initialize FAB toggle + initializeDmFabToggle(); + // Setup auto-refresh setupAutoRefresh(); }); @@ -932,6 +935,21 @@ let dmFilterActive = false; let currentDmFilterQuery = ''; let originalDmMessageContents = new Map(); +/** + * Initialize DM FAB toggle (collapse/expand) + */ +function initializeDmFabToggle() { + const toggle = document.getElementById('dmFabToggle'); + const container = document.getElementById('dmFabContainer'); + if (!toggle || !container) return; + + toggle.addEventListener('click', () => { + container.classList.toggle('collapsed'); + const isCollapsed = container.classList.contains('collapsed'); + toggle.title = isCollapsed ? 'Show buttons' : 'Hide buttons'; + }); +} + /** * Initialize DM filter functionality */ diff --git a/app/templates/dm.html b/app/templates/dm.html index 42c33bb..80edcd7 100644 --- a/app/templates/dm.html +++ b/app/templates/dm.html @@ -149,8 +149,11 @@ - -
+ +
+ diff --git a/app/templates/index.html b/app/templates/index.html index 5b27bd1..bd07e89 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -83,6 +83,9 @@
+