From 07febd7dc7b29bb70568d62be001bc2fdfd14993 Mon Sep 17 00:00:00 2001 From: Timothy Cardoza Date: Tue, 17 Feb 2026 19:01:41 -0600 Subject: [PATCH] auto tag bsed on bucket viewing --- src/components/QuickEntry.tsx | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/components/QuickEntry.tsx b/src/components/QuickEntry.tsx index 991fdca..4327d50 100644 --- a/src/components/QuickEntry.tsx +++ b/src/components/QuickEntry.tsx @@ -1,5 +1,5 @@ import { type Component, createSignal, createEffect, onCleanup, onMount, For, Show } from "solid-js"; -import { addTask, calculateDateFromUrgency, calculateUrgencyFromDate, store, upsertTagDefinition, type TaskTemplate } from "@/store"; +import { addTask, calculateDateFromUrgency, calculateUrgencyFromDate, store, upsertTagDefinition, currentTaskContext, type TaskTemplate } from "@/store"; import { Search, Command, Clock, ArrowUpCircle, Plus, Copy, ChevronDown, Gauge, X } from "lucide-solid"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; @@ -30,6 +30,28 @@ export const QuickEntry: Component = () => { const [editorInstance, setEditorInstance] = createSignal(null); const [size, setSize] = createSignal("5"); + // Autofill tags based on context when opening + createEffect(() => { + if (isOpen()) { + const ctx = currentTaskContext(); + if (typeof ctx === 'object') { + if ('bucketId' in ctx) { + // Bucket View: Autofill bucket name + const bucketName = ctx.name; + if (bucketName && !tags().includes(bucketName)) { + setTags(prev => [...prev, bucketName]); + } + } else if ('userId' in ctx) { + // Shared User View: Autofill user name (assuming name IS the tag for sharing) + const userName = ctx.name; + if (userName && !tags().includes(userName)) { + setTags(prev => [...prev, userName]); + } + } + } + } + }); + // Reactive shorthand parsing createEffect(() => { const text = input();