floq 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React, { useState, useEffect, useCallback } from 'react';
3
3
  import { Box, Text, useInput, useApp, useStdout } from 'ink';
4
4
  import TextInput from 'ink-text-input';
@@ -14,6 +14,7 @@ import { SearchResults } from './SearchResults.js';
14
14
  import { HelpModal } from './HelpModal.js';
15
15
  import { InsightsModal } from './InsightsModal.js';
16
16
  import { CalendarModal } from './CalendarModal.js';
17
+ import { StatusBadge } from './StatusBadge.js';
17
18
  import { Clock } from './Clock.js';
18
19
  import { CalendarEvents } from './CalendarEvents.js';
19
20
  import { PomodoroBattleUI, BattleMessage, getBattleMessage, BATTLE_COMMANDS } from './PomodoroBattleUI.js';
@@ -645,10 +646,20 @@ export function GtdDQ({ onOpenSettings }) {
645
646
  // Handle task-detail mode
646
647
  if (mode === 'task-detail') {
647
648
  if (key.escape || input === 'b' || input === 'h' || key.leftArrow) {
649
+ // If came from project-detail, go back to project-detail
650
+ if (selectedProject) {
651
+ setMode('project-detail');
652
+ const taskIndex = projectTasks.findIndex(t => t.id === selectedTask?.id);
653
+ if (taskIndex >= 0) {
654
+ setSelectedTaskIndex(taskIndex);
655
+ }
656
+ }
657
+ else {
658
+ setMode('normal');
659
+ }
648
660
  setSelectedTask(null);
649
661
  setTaskComments([]);
650
662
  setSelectedCommentIndex(0);
651
- setMode('normal');
652
663
  return;
653
664
  }
654
665
  // Navigate comments
@@ -868,6 +879,14 @@ export function GtdDQ({ onOpenSettings }) {
868
879
  });
869
880
  return;
870
881
  }
882
+ // Enter to view task details within project
883
+ if (key.return && projectTasks.length > 0) {
884
+ const task = projectTasks[selectedTaskIndex];
885
+ setSelectedTask(task);
886
+ loadTaskComments(task.id);
887
+ setMode('task-detail');
888
+ return;
889
+ }
871
890
  return;
872
891
  }
873
892
  if (message)
@@ -1006,7 +1025,7 @@ export function GtdDQ({ onOpenSettings }) {
1006
1025
  return;
1007
1026
  }
1008
1027
  // Move to inbox
1009
- if (input === 'i' && currentTab !== 'inbox' && currentTab !== 'projects' && currentTab !== 'done') {
1028
+ if (input === 'i' && currentTab !== 'inbox' && currentTab !== 'projects') {
1010
1029
  moveTaskToStatus(task, 'inbox').then(() => {
1011
1030
  if (selectedTaskIndex >= currentTasks.length - 1) {
1012
1031
  setSelectedTaskIndex(Math.max(0, selectedTaskIndex - 1));
@@ -1180,7 +1199,7 @@ export function GtdDQ({ onOpenSettings }) {
1180
1199
  ].join('');
1181
1200
  const availableWidth = rightPaneWidth - 6 - getDisplayWidth(prefix) - getDisplayWidth(focusPrefix) - getDisplayWidth(effortBadge) - getDisplayWidth(suffix);
1182
1201
  const displayTitle = truncateString(task.title, availableWidth);
1183
- return (_jsxs(Text, { color: isSelected ? theme.colors.textSelected : theme.colors.text, bold: isSelected, children: [prefix, focusPrefix, effortBadge, displayTitle, task.waitingFor && _jsxs(Text, { color: theme.colors.muted, children: [" (", task.waitingFor, ")"] }), task.context && _jsxs(Text, { color: theme.colors.muted, children: [" @", task.context] }), parentProject && _jsxs(Text, { color: theme.colors.muted, children: [" [", parentProject.title, "]"] }), progress && _jsxs(Text, { color: theme.colors.muted, children: [" [", progress.completed, "/", progress.total, "]"] })] }, task.id));
1202
+ return (_jsxs(Text, { color: isSelected ? theme.colors.textSelected : theme.colors.text, bold: isSelected, children: [prefix, mode === 'project-detail' && _jsxs(_Fragment, { children: [_jsx(StatusBadge, { status: task.status }), " "] }), focusPrefix, effortBadge, displayTitle, task.waitingFor && _jsxs(Text, { color: theme.colors.muted, children: [" (", task.waitingFor, ")"] }), task.context && _jsxs(Text, { color: theme.colors.muted, children: [" @", task.context] }), parentProject && _jsxs(Text, { color: theme.colors.muted, children: [" [", parentProject.title, "]"] }), progress && _jsxs(Text, { color: theme.colors.muted, children: [" [", progress.completed, "/", progress.total, "]"] })] }, task.id));
1184
1203
  })) }) })] })), (mode === 'add' || mode === 'add-to-project') && (_jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: theme.colors.secondary, bold: true, children: mode === 'add-to-project' && selectedProject
1185
1204
  ? `${i18n.tui.newTask}[${selectedProject.title}] `
1186
1205
  : i18n.tui.newTask }), _jsx(TextInput, { value: inputValue, onChange: setInputValue, onSubmit: handleInputSubmit, placeholder: i18n.tui.placeholder })] })), mode === 'move-to-waiting' && taskToWaiting && (_jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: theme.colors.secondary, bold: true, children: i18n.tui.waitingFor }), _jsx(TextInput, { value: inputValue, onChange: setInputValue, onSubmit: handleInputSubmit, placeholder: "" })] })), mode === 'add-context' && (_jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: theme.colors.secondary, bold: true, children: "New context: " }), _jsx(TextInput, { value: inputValue, onChange: setInputValue, onSubmit: handleInputSubmit, placeholder: "Enter context name..." })] })), mode === 'add-comment' && selectedTask && (_jsxs(Box, { marginTop: 1, children: [_jsxs(Text, { color: theme.colors.secondary, bold: true, children: [i18n.tui.addComment || 'Add comment', ": "] }), _jsx(TextInput, { value: inputValue, onChange: setInputValue, onSubmit: handleInputSubmit, placeholder: "Enter comment..." })] })), mode === 'search' && (_jsx(SearchBar, { value: searchQuery, onChange: handleSearchChange, onSubmit: handleInputSubmit })), mode === 'search' && searchQuery && (_jsx(SearchResults, { results: searchResults, selectedIndex: searchResultIndex, query: searchQuery })), message && mode === 'normal' && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.colors.textHighlight, children: message }) })), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: theme.colors.accent, children: "\u2328\uFE0F " }), _jsx(Text, { color: theme.colors.textMuted, children: mode === 'task-detail'
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useCallback } from 'react';
3
3
  import { Box, Text, useInput, useApp, useStdout } from 'ink';
4
4
  import TextInput from 'ink-text-input';
@@ -15,6 +15,7 @@ import { SearchResults } from './SearchResults.js';
15
15
  import { HelpModal } from './HelpModal.js';
16
16
  import { InsightsModal } from './InsightsModal.js';
17
17
  import { CalendarModal } from './CalendarModal.js';
18
+ import { StatusBadge } from './StatusBadge.js';
18
19
  import { MarioBoxInline } from './MarioBox.js';
19
20
  import { Clock } from './Clock.js';
20
21
  import { CalendarEvents } from './CalendarEvents.js';
@@ -568,10 +569,20 @@ export function GtdMario({ onOpenSettings }) {
568
569
  }
569
570
  if (mode === 'task-detail') {
570
571
  if (key.escape || input === 'b' || input === 'h' || key.leftArrow) {
572
+ // If came from project-detail, go back to project-detail
573
+ if (selectedProject) {
574
+ setMode('project-detail');
575
+ const taskIndex = projectTasks.findIndex(t => t.id === selectedTask?.id);
576
+ if (taskIndex >= 0) {
577
+ setSelectedTaskIndex(taskIndex);
578
+ }
579
+ }
580
+ else {
581
+ setMode('normal');
582
+ }
571
583
  setSelectedTask(null);
572
584
  setTaskComments([]);
573
585
  setSelectedCommentIndex(0);
574
- setMode('normal');
575
586
  return;
576
587
  }
577
588
  if (key.upArrow || input === 'k') {
@@ -778,6 +789,14 @@ export function GtdMario({ onOpenSettings }) {
778
789
  });
779
790
  return;
780
791
  }
792
+ // Enter to view task details within project
793
+ if (key.return && projectTasks.length > 0) {
794
+ const task = projectTasks[selectedTaskIndex];
795
+ setSelectedTask(task);
796
+ loadTaskComments(task.id);
797
+ setMode('task-detail');
798
+ return;
799
+ }
781
800
  return;
782
801
  }
783
802
  if (message)
@@ -906,7 +925,7 @@ export function GtdMario({ onOpenSettings }) {
906
925
  setMode('move-to-waiting');
907
926
  return;
908
927
  }
909
- if (input === 'i' && currentTab !== 'inbox' && currentTab !== 'projects' && currentTab !== 'done') {
928
+ if (input === 'i' && currentTab !== 'inbox' && currentTab !== 'projects') {
910
929
  moveTaskToStatus(task, 'inbox').then(() => {
911
930
  if (selectedTaskIndex >= currentTasks.length - 1) {
912
931
  setSelectedTaskIndex(Math.max(0, selectedTaskIndex - 1));
@@ -1073,7 +1092,7 @@ export function GtdMario({ onOpenSettings }) {
1073
1092
  ].join('');
1074
1093
  const availableWidth = rightPaneWidth - 6 - getDisplayWidth(prefix) - getDisplayWidth(`${focusPrefix}${effortBadge}`) - getDisplayWidth(suffix);
1075
1094
  const displayTitle = truncateString(task.title, availableWidth);
1076
- return (_jsxs(Text, { color: isSelected ? theme.colors.textSelected : theme.colors.text, bold: isSelected, children: [prefix, focusPrefix, effortBadge, displayTitle, task.waitingFor && _jsxs(Text, { color: theme.colors.muted, children: [" (", task.waitingFor, ")"] }), task.context && _jsxs(Text, { color: theme.colors.muted, children: [" @", task.context] }), parentProject && _jsxs(Text, { color: theme.colors.muted, children: [" [", parentProject.title, "]"] }), progress && _jsxs(Text, { color: theme.colors.muted, children: [" [", progress.completed, "/", progress.total, "]"] })] }, task.id));
1095
+ return (_jsxs(Text, { color: isSelected ? theme.colors.textSelected : theme.colors.text, bold: isSelected, children: [prefix, mode === 'project-detail' && _jsxs(_Fragment, { children: [_jsx(StatusBadge, { status: task.status }), " "] }), focusPrefix, effortBadge, displayTitle, task.waitingFor && _jsxs(Text, { color: theme.colors.muted, children: [" (", task.waitingFor, ")"] }), task.context && _jsxs(Text, { color: theme.colors.muted, children: [" @", task.context] }), parentProject && _jsxs(Text, { color: theme.colors.muted, children: [" [", parentProject.title, "]"] }), progress && _jsxs(Text, { color: theme.colors.muted, children: [" [", progress.completed, "/", progress.total, "]"] })] }, task.id));
1077
1096
  })) }) })] })), (mode === 'add' || mode === 'add-to-project') && (_jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: theme.colors.secondary, bold: true, children: mode === 'add-to-project' && selectedProject
1078
1097
  ? `${i18n.tui.newTask}[${selectedProject.title}] `
1079
1098
  : i18n.tui.newTask }), _jsx(TextInput, { value: inputValue, onChange: setInputValue, onSubmit: handleInputSubmit, placeholder: i18n.tui.placeholder })] })), mode === 'move-to-waiting' && taskToWaiting && (_jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: theme.colors.secondary, bold: true, children: i18n.tui.waitingFor }), _jsx(TextInput, { value: inputValue, onChange: setInputValue, onSubmit: handleInputSubmit, placeholder: "" })] })), mode === 'add-context' && (_jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: theme.colors.secondary, bold: true, children: "New context: " }), _jsx(TextInput, { value: inputValue, onChange: setInputValue, onSubmit: handleInputSubmit, placeholder: "Enter context name..." })] })), mode === 'add-comment' && selectedTask && (_jsxs(Box, { marginTop: 1, children: [_jsxs(Text, { color: theme.colors.secondary, bold: true, children: [i18n.tui.addComment || 'Add comment', ": "] }), _jsx(TextInput, { value: inputValue, onChange: setInputValue, onSubmit: handleInputSubmit, placeholder: "Enter comment..." })] })), mode === 'search' && (_jsx(SearchBar, { value: searchQuery, onChange: handleSearchChange, onSubmit: handleInputSubmit })), mode === 'search' && searchQuery && (_jsx(SearchResults, { results: searchResults, selectedIndex: searchResultIndex, query: searchQuery })), message && mode === 'normal' && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.colors.textHighlight, children: message }) })), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: theme.colors.accent, children: "\u2328\uFE0F " }), _jsx(Text, { color: theme.colors.textMuted, children: mode === 'task-detail'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "floq",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Floq - Getting Things Done Task Manager with MS-DOS style themes",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",