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) => { export const Layout: Component<LayoutProps> = (props) => {
const [isSidebarLocked, setIsSidebarLocked] = createSignal(true); const [isSidebarLocked, setIsSidebarLocked] = createSignal(true);
const [isSidebarPeeking, setIsSidebarPeeking] = createSignal(false); const [isSidebarPeeking, setIsSidebarPeeking] = createSignal(false);
const [isDropdownOpen, setIsDropdownOpen] = createSignal(false);
// Lift selectedNoteId up to Layout so it can be passed to NotesSidebar and NotepadView // Lift selectedNoteId up to Layout so it can be passed to NotesSidebar and NotepadView
const [selectedNoteId, setSelectedNoteId] = createSignal<string | null>(null); 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" !isSidebarLocked() && (isSidebarPeeking() || (store.isNotepadMode && !selectedNoteId())) && "translate-x-0 shadow-2xl ring-1 ring-border"
)} )}
onMouseEnter={() => !isSidebarLocked() && setIsSidebarPeeking(true)} 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"> <div class="relative flex-1 flex flex-col min-h-0">
{/* Task Sidebar Wrapper */} {/* Task Sidebar Wrapper */}
@@ -82,6 +87,7 @@ export const Layout: Component<LayoutProps> = (props) => {
isPeeking={isSidebarPeeking()} isPeeking={isSidebarPeeking()}
setIsPeeking={setIsSidebarPeeking} setIsPeeking={setIsSidebarPeeking}
isEmbed={true} isEmbed={true}
onDropdownOpenChange={setIsDropdownOpen}
/> />
</div> </div>
+5 -1
View File
@@ -300,6 +300,7 @@ export const Sidebar: Component<{
isPeeking: boolean; isPeeking: boolean;
setIsPeeking: (v: boolean) => void; setIsPeeking: (v: boolean) => void;
isEmbed?: boolean; isEmbed?: boolean;
onDropdownOpenChange?: (open: boolean) => void;
}> = (props) => { }> = (props) => {
const [switcherOpen, setSwitcherOpen] = createSignal(false); const [switcherOpen, setSwitcherOpen] = createSignal(false);
@@ -374,7 +375,10 @@ export const Sidebar: Component<{
isLocked={props.isLocked} isLocked={props.isLocked}
isPeeking={props.isPeeking} isPeeking={props.isPeeking}
setIsPeeking={props.setIsPeeking} setIsPeeking={props.setIsPeeking}
onOpenChange={setSwitcherOpen} onOpenChange={(open) => {
setSwitcherOpen(open);
props.onDropdownOpenChange?.(open);
}}
/> />
</div> </div>
+27 -28
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 { store, currentTaskContext } from "@/store";
import { Plus, X } from "lucide-solid"; import { Plus, X } from "lucide-solid";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
@@ -7,37 +7,36 @@ import { QuickEntryForm } from "./QuickEntryForm";
export const QuickEntry: Component = () => { export const QuickEntry: Component = () => {
const [isOpen, setIsOpen] = createSignal(false); const [isOpen, setIsOpen] = createSignal(false);
const [initialTags, setInitialTags] = createSignal<string[]>([]);
// Autofill tags based on context when opening // Autofill tags based on context when opening
createEffect(() => { const initialTags = createMemo(() => {
if (isOpen()) { if (!isOpen()) return [];
const tags: string[] = [];
const ctx = currentTaskContext(); const tags: string[] = [];
if (store.isNotepadMode) { const ctx = currentTaskContext();
// Not in a specific context, but in Notes mode.
// We use global window variable set by Layout to get the active note id if (store.isNotepadMode) {
const activeNoteId = (window as any)._activeNoteId; // Not in a specific context, but in Notes mode.
if (activeNoteId) { // We use global window variable set by Layout to get the active note id
const note = store.notes.find(n => n.id === activeNoteId); const activeNoteId = (window as any)._activeNoteId;
if (note && note.title) { if (activeNoteId) {
const noteTagName = note.title.trim(); const note = store.notes.find(n => n.id === activeNoteId);
if (noteTagName) tags.push(noteTagName); if (note && note.title) {
} const noteTagName = note.title.trim();
} if (noteTagName) tags.push(noteTagName);
} else if (typeof ctx === 'object') {
if ('bucketId' in ctx) {
// Bucket View: Autofill bucket name
const bucketName = ctx.name;
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);
} }
} }
setInitialTags(tags); } else if (typeof ctx === 'object') {
if ('bucketId' in ctx) {
// Bucket View: Autofill bucket name
const bucketName = ctx.name;
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}`);
}
} }
return tags;
}); });
const handleKeyDown = (e: KeyboardEvent) => { 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 // Reactive shorthand parsing
createEffect(() => { createEffect(() => {
const text = input(); const text = input();