Compare commits

...

3 Commits

Author SHA1 Message Date
tcardoza 42531b37a5 bucket picker fix 2026-03-03 12:51:34 -06:00
tcardoza 7ee6b795f7 bucket handling fixes better 2026-03-03 10:18:41 -06:00
tcardoza d9a2b05bb1 bucket handling fixes 2026-03-03 10:15:41 -06:00
4 changed files with 54 additions and 30 deletions
+7 -1
View File
@@ -20,6 +20,7 @@ interface LayoutProps {
export const Layout: Component<LayoutProps> = (props) => {
const [isSidebarLocked, setIsSidebarLocked] = createSignal(true);
const [isSidebarPeeking, setIsSidebarPeeking] = createSignal(false);
const [isDropdownOpen, setIsDropdownOpen] = createSignal(false);
// Lift selectedNoteId up to Layout so it can be passed to NotesSidebar and NotepadView
const [selectedNoteId, setSelectedNoteId] = createSignal<string | null>(null);
@@ -64,7 +65,11 @@ export const Layout: Component<LayoutProps> = (props) => {
!isSidebarLocked() && (isSidebarPeeking() || (store.isNotepadMode && !selectedNoteId())) && "translate-x-0 shadow-2xl ring-1 ring-border"
)}
onMouseEnter={() => !isSidebarLocked() && setIsSidebarPeeking(true)}
onMouseLeave={() => !isSidebarLocked() && setIsSidebarPeeking(false)}>
onMouseLeave={() => {
if (!isSidebarLocked() && !isDropdownOpen()) {
setIsSidebarPeeking(false);
}
}}>
<div class="relative flex-1 flex flex-col min-h-0">
{/* Task Sidebar Wrapper */}
@@ -82,6 +87,7 @@ export const Layout: Component<LayoutProps> = (props) => {
isPeeking={isSidebarPeeking()}
setIsPeeking={setIsSidebarPeeking}
isEmbed={true}
onDropdownOpenChange={setIsDropdownOpen}
/>
</div>
+5 -1
View File
@@ -300,6 +300,7 @@ export const Sidebar: Component<{
isPeeking: boolean;
setIsPeeking: (v: boolean) => void;
isEmbed?: boolean;
onDropdownOpenChange?: (open: boolean) => void;
}> = (props) => {
const [switcherOpen, setSwitcherOpen] = createSignal(false);
@@ -374,7 +375,10 @@ export const Sidebar: Component<{
isLocked={props.isLocked}
isPeeking={props.isPeeking}
setIsPeeking={props.setIsPeeking}
onOpenChange={setSwitcherOpen}
onOpenChange={(open) => {
setSwitcherOpen(open);
props.onDropdownOpenChange?.(open);
}}
/>
</div>
+8 -9
View File
@@ -1,4 +1,4 @@
import { type Component, createSignal, createEffect, onCleanup, onMount } from "solid-js";
import { type Component, createSignal, createMemo, onCleanup, onMount } from "solid-js";
import { store, currentTaskContext } from "@/store";
import { Plus, X } from "lucide-solid";
import { Button } from "@/components/ui/button";
@@ -7,13 +7,13 @@ import { QuickEntryForm } from "./QuickEntryForm";
export const QuickEntry: Component = () => {
const [isOpen, setIsOpen] = createSignal(false);
const [initialTags, setInitialTags] = createSignal<string[]>([]);
// Autofill tags based on context when opening
createEffect(() => {
if (isOpen()) {
const initialTags = createMemo(() => {
if (!isOpen()) return [];
const tags: string[] = [];
const ctx = currentTaskContext();
if (store.isNotepadMode) {
// Not in a specific context, but in Notes mode.
// We use global window variable set by Layout to get the active note id
@@ -29,15 +29,14 @@ export const QuickEntry: Component = () => {
if ('bucketId' in ctx) {
// Bucket View: Autofill bucket name
const bucketName = ctx.name;
if (bucketName) tags.push(bucketName);
if (bucketName) tags.push(`@${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.push(userName);
if (userName) tags.push(`@${userName}`);
}
}
setInitialTags(tags);
}
return tags;
});
const handleKeyDown = (e: KeyboardEvent) => {
+15
View File
@@ -43,6 +43,21 @@ export const QuickEntryForm: Component<QuickEntryFormProps> = (props) => {
}
});
// Reactive sync from props (handles context changes while open)
createEffect(() => {
const initial = props.initialTags || [];
if (initial.length > 0) {
setTags(prev => {
// Merge initial tags if not already present
const next = [...prev];
initial.forEach(t => {
if (!next.includes(t)) next.push(t);
});
return next;
});
}
});
// Reactive shorthand parsing
createEffect(() => {
const text = input();