set size defualt to 3 - one hour
This commit is contained in:
@@ -28,7 +28,7 @@ export const QuickEntry: Component = () => {
|
|||||||
const [tags, setTags] = createSignal<string[]>([]);
|
const [tags, setTags] = createSignal<string[]>([]);
|
||||||
const [description, setDescription] = createSignal("");
|
const [description, setDescription] = createSignal("");
|
||||||
const [editorInstance, setEditorInstance] = createSignal<any>(null);
|
const [editorInstance, setEditorInstance] = createSignal<any>(null);
|
||||||
const [size, setSize] = createSignal<string>("5");
|
const [size, setSize] = createSignal<string>("3");
|
||||||
|
|
||||||
// Autofill tags based on context when opening
|
// Autofill tags based on context when opening
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
@@ -237,7 +237,7 @@ export const QuickEntry: Component = () => {
|
|||||||
setUrgency("");
|
setUrgency("");
|
||||||
setTags([]);
|
setTags([]);
|
||||||
setDescription("");
|
setDescription("");
|
||||||
setSize("5");
|
setSize("3");
|
||||||
lastParsedTags = [];
|
lastParsedTags = [];
|
||||||
setDateString("");
|
setDateString("");
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ export const TaskDetail: Component<TaskDetailProps> = (props) => {
|
|||||||
<div class="flex items-center gap-1 group shrink-0">
|
<div class="flex items-center gap-1 group shrink-0">
|
||||||
<span class="text-[0.625rem] uppercase font-bold tracking-wider text-muted-foreground/70 hidden sm:inline">Size</span>
|
<span class="text-[0.625rem] uppercase font-bold tracking-wider text-muted-foreground/70 hidden sm:inline">Size</span>
|
||||||
<Select<any>
|
<Select<any>
|
||||||
value={(props.task.size ?? 5).toString()}
|
value={(props.task.size ?? 3).toString()}
|
||||||
onChange={(val: any) => {
|
onChange={(val: any) => {
|
||||||
const value = typeof val === 'object' ? val?.value : val;
|
const value = typeof val === 'object' ? val?.value : val;
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -282,7 +282,7 @@ export const TaskDetail: Component<TaskDetailProps> = (props) => {
|
|||||||
<div class="flex items-center gap-1 sm:gap-1.5 text-foreground font-medium truncate">
|
<div class="flex items-center gap-1 sm:gap-1.5 text-foreground font-medium truncate">
|
||||||
<Gauge size={14} class="text-primary opacity-70 group-hover:opacity-100 transition-opacity shrink-0" />
|
<Gauge size={14} class="text-primary opacity-70 group-hover:opacity-100 transition-opacity shrink-0" />
|
||||||
<span class="text-xs sm:text-sm truncate">
|
<span class="text-xs sm:text-sm truncate">
|
||||||
{SIZE_OPTIONS.find(o => o.value === (props.task.size ?? 5).toString())?.label || props.task.size}
|
{SIZE_OPTIONS.find(o => o.value === (props.task.size ?? 3).toString())?.label || props.task.size}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
|
|||||||
+2
-2
@@ -371,7 +371,7 @@ export const calculateUrgencyFromDate = (dateStr: string): number => {
|
|||||||
|
|
||||||
export const getCombinedScore = (task: Task): number => {
|
export const getCombinedScore = (task: Task): number => {
|
||||||
// 1. Calculate an effective due date by subtracting size hours
|
// 1. Calculate an effective due date by subtracting size hours
|
||||||
const size = task.size ?? 5; // Default size 5
|
const size = task.size ?? 3; // Default size 3
|
||||||
const sizeHours = SIZE_HOURS[size] ?? 12;
|
const sizeHours = SIZE_HOURS[size] ?? 12;
|
||||||
const dueTime = new Date(task.dueDate).getTime();
|
const dueTime = new Date(task.dueDate).getTime();
|
||||||
if (isNaN(dueTime)) return 0;
|
if (isNaN(dueTime)) return 0;
|
||||||
@@ -1143,7 +1143,7 @@ export const addTask = async (title: string, options?: { dueDate?: Date | string
|
|||||||
const priority = options?.priority ?? 5;
|
const priority = options?.priority ?? 5;
|
||||||
const tags = options?.tags ?? ["work"];
|
const tags = options?.tags ?? ["work"];
|
||||||
const content = options?.content ?? "";
|
const content = options?.content ?? "";
|
||||||
const size = options?.size ?? 5;
|
const size = options?.size ?? 3;
|
||||||
|
|
||||||
const tempId = "temp-" + Date.now();
|
const tempId = "temp-" + Date.now();
|
||||||
const initialTask: Task = {
|
const initialTask: Task = {
|
||||||
|
|||||||
Reference in New Issue
Block a user