From 0248cfbb6caa505cf7f337270062455b0c7a1270 Mon Sep 17 00:00:00 2001 From: mARTin Date: Tue, 17 Mar 2026 10:55:52 +0100 Subject: [PATCH] feat: add responsive header with overflow menu for tablet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Desktop shows all action buttons inline. On tablet (≤1024px), secondary actions collapse into a dropdown overflow menu with proper touch targets, dark mode support, and fade-in animation. v1.42.0 --- package.json | 2 +- src/app/globals.css | 84 +++++++++++++++ src/components/WeeklyView.tsx | 192 +++++++++------------------------- 3 files changed, 136 insertions(+), 142 deletions(-) diff --git a/package.json b/package.json index 60c3be1..5adcb2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.41.0", + "version": "1.42.0", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view", "main": "index.js", "scripts": { diff --git a/src/app/globals.css b/src/app/globals.css index 4dbbe73..a274aaf 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -3693,6 +3693,90 @@ h3 { opacity: 0; } +/* Responsive header sections */ +.header-desktop-only { + display: flex; +} +.header-tablet-only { + display: none; +} + +@media (max-width: 1024px) { + .header-desktop-only { + display: none !important; + } + .header-tablet-only { + display: block !important; + } + /* Make controls visible on tablet (no hover on touch devices) */ + .weekly-header-controls { + opacity: 1 !important; + transition: none !important; + } +} + +/* Header overflow menu (tablet) */ +.header-overflow-menu { + position: absolute; + top: 100%; + right: 0; + z-index: 100; + min-width: 200px; + padding: 6px; + margin-top: 4px; + background: #fff; + border: 1px solid #e5e7eb; + border-radius: 12px; + box-shadow: 0 8px 24px rgba(0,0,0,0.12); + display: flex; + flex-direction: column; + gap: 2px; + animation: menuFadeIn 0.15s ease; +} + +.dark-mode .header-overflow-menu { + background: #1f2937; + border-color: #374151; + box-shadow: 0 8px 24px rgba(0,0,0,0.4); +} + +.header-overflow-menu button { + display: flex; + align-items: center; + gap: 10px; + width: 100%; + padding: 10px 12px; + border: none; + background: transparent; + border-radius: 8px; + font-size: 13px; + color: #374151; + cursor: pointer; + transition: background 0.15s; +} + +.header-overflow-menu button:hover { + background: #f3f4f6; +} + +.header-overflow-menu button:disabled { + opacity: 0.35; + cursor: default; +} + +.dark-mode .header-overflow-menu button { + color: #d1d5db; +} + +.dark-mode .header-overflow-menu button:hover { + background: #374151; +} + +@keyframes menuFadeIn { + from { opacity: 0; transform: translateY(-4px); } + to { opacity: 1; transform: translateY(0); } +} + /* List View (formerly Grid/App View - no vertical lines) */ .list-view.time-grid-off .weekly-day-column { border-right: none !important; diff --git a/src/components/WeeklyView.tsx b/src/components/WeeklyView.tsx index 27d8033..7bf76f5 100644 --- a/src/components/WeeklyView.tsx +++ b/src/components/WeeklyView.tsx @@ -1795,6 +1795,7 @@ export default function WeeklyView() { const [showMobileFabSheet, setShowMobileFabSheet] = useState(false); const [showMobileFabMenu, setShowMobileFabMenu] = useState(false); + const [showHeaderMore, setShowHeaderMore] = useState(false); const [fabTaskTitle, setFabTaskTitle] = useState(""); const fabTextareaRef = useRef(null); @@ -6021,163 +6022,72 @@ export default function WeeklyView() { {/* RIGHT SECTION: Navigation & Tools */} -
- {/* Undo/Redo */} - - - {/* Add Event Button */} - - - - {/* Focus Mode Toggle */} - - - {/* Day/Night Mode Switch */} - - - {/* Navigation Controls */} -
- - - - - +
+ {/* Navigation Controls — always visible */} +
+ + + + + +
- {/* Search */} - + {/* Always visible: Search, Settings, User */} + + - {/* Recurring Tasks */} - + {/* Overflow menu — visible on tablet, hidden on desktop */} +
+ + {showHeaderMore && ( + <> +
setShowHeaderMore(false)} /> +
+ + + + + + + +
+ + )} +
- + {/* Recurring Tasks — desktop only */} + {/* User Menu */} setShowSettings(true)} language={profile.language} - trigger={ - - } + trigger={} />