Compare commits
3 Commits
8020e16ca1
...
42531b37a5
| Author | SHA1 | Date | |
|---|---|---|---|
| 42531b37a5 | |||
| 7ee6b795f7 | |||
| d9a2b05bb1 |
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -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,13 +7,13 @@ 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 tags: string[] = [];
|
||||||
const ctx = currentTaskContext();
|
const ctx = currentTaskContext();
|
||||||
|
|
||||||
if (store.isNotepadMode) {
|
if (store.isNotepadMode) {
|
||||||
// Not in a specific context, but in Notes mode.
|
// Not in a specific context, but in Notes mode.
|
||||||
// We use global window variable set by Layout to get the active note id
|
// 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) {
|
if ('bucketId' in ctx) {
|
||||||
// Bucket View: Autofill bucket name
|
// Bucket View: Autofill bucket name
|
||||||
const bucketName = ctx.name;
|
const bucketName = ctx.name;
|
||||||
if (bucketName) tags.push(bucketName);
|
if (bucketName) tags.push(`@${bucketName}`);
|
||||||
} else if ('userId' in ctx) {
|
} else if ('userId' in ctx) {
|
||||||
// Shared User View: Autofill user name (assuming name IS the tag for sharing)
|
// Shared User View: Autofill user name (assuming name IS the tag for sharing)
|
||||||
const userName = ctx.name;
|
const userName = ctx.name;
|
||||||
if (userName) tags.push(userName);
|
if (userName) tags.push(`@${userName}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setInitialTags(tags);
|
return tags;
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleKeyDown = (e: KeyboardEvent) => {
|
const handleKeyDown = (e: KeyboardEvent) => {
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user