feat(pwa): app icon shortcuts for Quick Dump, new task and shopping list open their input
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m31s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
sandrodachandClaude Opus 5.5 committed 2026-10-31 11:16:46 +01:00
1 parent c6a2cfb85c
commit 3d367ce633
9 files changed
+74 -13

No files matched your search

+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "mindsift-frontend",
"version": "0.19.0",
"version": "0.20.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mindsift-frontend",
"version": "0.19.0",
"version": "0.20.0",
"license": "Unlicense",
"dependencies": {
"@fontsource-variable/inter": "5.3.0",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "mindsift-frontend",
"private": true,
"version": "0.19.0",
"version": "0.20.0",
"license": "Unlicense",
"type": "module",
"scripts": {
+35 -8
View File
@@ -65,16 +65,43 @@
},
"shortcuts": [
{
"name": "Gedanke sofort erfassen",
"short_name": "Capture",
"description": "Öffnet MindSift mit Fokus im Eingabefeld",
"url": "/?mode=capture"
"name": "Quick Dump",
"short_name": "Quick Dump",
"description": "Gedanken schnell in die Triage werfen",
"url": "/?shortcut=quickdump",
"icons": [
{
"src": "/shortcut-quickdump.png",
"sizes": "192x192",
"type": "image/png"
}
]
},
{
"name": "Triage starten",
"short_name": "Triage",
"description": "Gedanken im Kartendeck aussortieren",
"url": "/?tab=triage"
"name": "Neue Aufgabe",
"short_name": "Aufgabe",
"description": "Direkt eine neue Aufgabe anlegen",
"url": "/?shortcut=task",
"icons": [
{
"src": "/shortcut-task.png",
"sizes": "192x192",
"type": "image/png"
}
]
},
{
"name": "Einkaufsliste",
"short_name": "Einkaufsliste",
"description": "Einen Eintrag zur Einkaufsliste hinzufügen",
"url": "/?shortcut=list",
"icons": [
{
"src": "/shortcut-list.png",
"sizes": "192x192",
"type": "image/png"
}
]
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

+28
View File
@@ -245,6 +245,34 @@ export const App: React.FC = () => {
};
const { isMenuOpen, setIsMenuOpen, closeMenu, setGroups, primaryAction, setPrimaryAction } = useMobileActions();
const primaryActionRef = useRef(primaryAction);
primaryActionRef.current = primaryAction;
// App icon shortcuts (manifest "shortcuts", long-press on the icon): open the tab and its input right away.
// ?shortcut=quickdump|task|list; the old links (?mode=capture, ?tab=triage) still lead to the Quick Dump.
const [pendingShortcut, setPendingShortcut] = useState<ActiveTab | null>(() => {
const params = new URLSearchParams(window.location.search);
const target = params.get('shortcut') || (params.get('mode') === 'capture' || params.get('tab') === 'triage' ? 'quickdump' : '');
return ({ quickdump: 'triage', task: 'tasks', list: 'lists' } as Record<string, ActiveTab>)[target] || null;
});
useEffect(() => {
if (!pendingShortcut || !user) return;
if (activeTab !== pendingShortcut) {
setActiveTab(pendingShortcut);
return;
}
const target = pendingShortcut;
setPendingShortcut(null);
const url = new URL(window.location.href);
['shortcut', 'mode', 'tab'].forEach((k) => url.searchParams.delete(k));
window.history.replaceState({}, '', url.pathname + url.search + url.hash);
// The view registers its "+" action once it is mounted, so wait a moment (no cleanup: resetting
// pendingShortcut above re-runs this effect and must not cancel the timer)
window.setTimeout(() => {
if (target === 'triage') handleTriggerAddButton();
else if (window.innerWidth < 640 || target === 'lists') primaryActionRef.current?.();
}, 400);
}, [pendingShortcut, user?.id, activeTab]);
useEffect(() => {
closeMenu();