@agent-native/core 0.101.14 → 0.102.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.
- package/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +12 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/templates-meta.ts +13 -0
- package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +1 -1
- package/corpus/core/src/client/org/OrgSwitcher.tsx +2 -0
- package/corpus/templates/analytics/changelog/2026-07-15-fixed-the-agent-discarding-a-successful-dashboard-edit-and-r.md +6 -0
- package/corpus/templates/analytics/server/lib/real-data-actions.ts +30 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +15 -0
- package/corpus/templates/content/actions/_database-source-utils.ts +59 -4
- package/corpus/templates/content/actions/prepare-builder-source-review.ts +9 -0
- package/corpus/templates/content/actions/preview-builder-source-review.ts +6 -4
- package/corpus/templates/content/app/components/editor/DescriptionField.tsx +10 -2
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +4 -0
- package/corpus/templates/content/changelog/2026-07-15-page-and-database-descriptions-now-use-a-clean-single-line-f.md +6 -0
- package/corpus/templates/content/changelog/2026-07-15-selected-builder-reviews-now-load-only-the-chosen-rows-avoid.md +6 -0
- package/corpus/templates/content/shared/api.ts +1 -0
- package/corpus/templates/tasks/.agents/commands/visual-plan.md +9 -0
- package/corpus/templates/tasks/.agents/commands/visual-recap.md +8 -0
- package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +492 -0
- package/corpus/templates/tasks/.agents/skills/adding-a-feature/SKILL.md +189 -0
- package/corpus/templates/tasks/.agents/skills/agent-native-docs/SKILL.md +76 -0
- package/corpus/templates/tasks/.agents/skills/agent-watchdog/README.md +43 -0
- package/corpus/templates/tasks/.agents/skills/agent-watchdog/SKILL.md +110 -0
- package/corpus/templates/tasks/.agents/skills/agent-watchdog/agents/openai.yaml +4 -0
- package/corpus/templates/tasks/.agents/skills/capture-learnings/SKILL.md +89 -0
- package/corpus/templates/tasks/.agents/skills/change-summary/SKILL.md +83 -0
- package/corpus/templates/tasks/.agents/skills/create-skill/SKILL.md +221 -0
- package/corpus/templates/tasks/.agents/skills/delegate-to-agent/SKILL.md +263 -0
- package/corpus/templates/tasks/.agents/skills/efficient-fable/README.md +75 -0
- package/corpus/templates/tasks/.agents/skills/efficient-fable/SKILL.md +95 -0
- package/corpus/templates/tasks/.agents/skills/efficient-frontier/README.md +53 -0
- package/corpus/templates/tasks/.agents/skills/efficient-frontier/SKILL.md +73 -0
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +112 -0
- package/corpus/templates/tasks/.agents/skills/plan-arbiter/README.md +41 -0
- package/corpus/templates/tasks/.agents/skills/plan-arbiter/SKILL.md +114 -0
- package/corpus/templates/tasks/.agents/skills/plan-arbiter/agents/openai.yaml +4 -0
- package/corpus/templates/tasks/.agents/skills/plow-ahead/README.md +42 -0
- package/corpus/templates/tasks/.agents/skills/plow-ahead/SKILL.md +104 -0
- package/corpus/templates/tasks/.agents/skills/plow-ahead/agents/openai.yaml +4 -0
- package/corpus/templates/tasks/.agents/skills/quick-recap/README.md +55 -0
- package/corpus/templates/tasks/.agents/skills/quick-recap/SKILL.md +54 -0
- package/corpus/templates/tasks/.agents/skills/read-the-damn-docs/README.md +54 -0
- package/corpus/templates/tasks/.agents/skills/read-the-damn-docs/SKILL.md +126 -0
- package/corpus/templates/tasks/.agents/skills/read-the-damn-docs/agents/openai.yaml +4 -0
- package/corpus/templates/tasks/.agents/skills/real-time-sync/SKILL.md +232 -0
- package/corpus/templates/tasks/.agents/skills/security/SKILL.md +280 -0
- package/corpus/templates/tasks/.agents/skills/self-modifying-code/SKILL.md +106 -0
- package/corpus/templates/tasks/.agents/skills/shadcn-ui/SKILL.md +95 -0
- package/corpus/templates/tasks/.agents/skills/stay-within-limits/README.md +61 -0
- package/corpus/templates/tasks/.agents/skills/stay-within-limits/SKILL.md +83 -0
- package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/tasks/.agents/skills/visual-plan/SKILL.md +547 -0
- package/corpus/templates/tasks/.agents/skills/visual-plan/agent-native-skill.json +12 -0
- package/corpus/templates/tasks/.agents/skills/visual-plan/references/canvas.md +121 -0
- package/corpus/templates/tasks/.agents/skills/visual-plan/references/document-quality.md +178 -0
- package/corpus/templates/tasks/.agents/skills/visual-plan/references/exemplar.md +62 -0
- package/corpus/templates/tasks/.agents/skills/visual-plan/references/wireframe.md +264 -0
- package/corpus/templates/tasks/.agents/skills/visual-recap/SKILL.md +634 -0
- package/corpus/templates/tasks/.agents/skills/visual-recap/agent-native-skill.json +12 -0
- package/corpus/templates/tasks/.agents/skills/visual-recap/references/wireframe.md +264 -0
- package/corpus/templates/tasks/.claude/commands/visual-plan.md +9 -0
- package/corpus/templates/tasks/.claude/commands/visual-recap.md +8 -0
- package/corpus/templates/tasks/.env.example +5 -0
- package/corpus/templates/tasks/.ignore +0 -0
- package/corpus/templates/tasks/.prettierrc +5 -0
- package/corpus/templates/tasks/AGENTS.md +158 -0
- package/corpus/templates/tasks/DEVELOPING.md +185 -0
- package/corpus/templates/tasks/README.md +16 -0
- package/corpus/templates/tasks/actions/bulk-delete-inbox-items.ts +24 -0
- package/corpus/templates/tasks/actions/bulk-delete-tasks.ts +21 -0
- package/corpus/templates/tasks/actions/bulk-mark-inbox-items-ready.ts +27 -0
- package/corpus/templates/tasks/actions/bulk-update-tasks.ts +35 -0
- package/corpus/templates/tasks/actions/create-custom-field.ts +22 -0
- package/corpus/templates/tasks/actions/create-inbox-item.ts +30 -0
- package/corpus/templates/tasks/actions/create-task.ts +33 -0
- package/corpus/templates/tasks/actions/delete-custom-field.ts +19 -0
- package/corpus/templates/tasks/actions/delete-inbox-item.ts +17 -0
- package/corpus/templates/tasks/actions/delete-task.ts +17 -0
- package/corpus/templates/tasks/actions/lib/boolean-query-param.ts +30 -0
- package/corpus/templates/tasks/actions/list-custom-fields.ts +18 -0
- package/corpus/templates/tasks/actions/list-inbox-items.ts +16 -0
- package/corpus/templates/tasks/actions/list-tasks.ts +52 -0
- package/corpus/templates/tasks/actions/list-visible-task-fields.ts +18 -0
- package/corpus/templates/tasks/actions/mark-inbox-item-ready.ts +31 -0
- package/corpus/templates/tasks/actions/navigate.ts +51 -0
- package/corpus/templates/tasks/actions/reorder-custom-fields.ts +27 -0
- package/corpus/templates/tasks/actions/reorder-inbox-items.ts +24 -0
- package/corpus/templates/tasks/actions/reorder-tasks.ts +29 -0
- package/corpus/templates/tasks/actions/run.ts +2 -0
- package/corpus/templates/tasks/actions/update-custom-field.ts +33 -0
- package/corpus/templates/tasks/actions/update-inbox-item.ts +24 -0
- package/corpus/templates/tasks/actions/update-task.ts +68 -0
- package/corpus/templates/tasks/actions/update-visible-task-fields.ts +27 -0
- package/corpus/templates/tasks/actions/view-screen-helpers.ts +68 -0
- package/corpus/templates/tasks/actions/view-screen.ts +207 -0
- package/corpus/templates/tasks/app/components/custom-fields/FieldCreateBar.tsx +121 -0
- package/corpus/templates/tasks/app/components/custom-fields/FieldListRow.tsx +116 -0
- package/corpus/templates/tasks/app/components/custom-fields/FieldsList.tsx +225 -0
- package/corpus/templates/tasks/app/components/custom-fields/FieldsListSkeleton.tsx +18 -0
- package/corpus/templates/tasks/app/components/custom-fields/FieldsPage.tsx +42 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/FieldEditorSidebar.tsx +69 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/FieldTitleSection.tsx +32 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/CurrencyConfigControl.tsx +49 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/FieldConfigControl.tsx +56 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/NumberConfigControl.tsx +52 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/PercentConfigControl.tsx +30 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/SelectConfigControl.tsx +135 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/select-colors.ts +23 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/utils.ts +52 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/types.ts +7 -0
- package/corpus/templates/tasks/app/components/dnd/SortableItem.tsx +72 -0
- package/corpus/templates/tasks/app/components/dnd/SortableList.tsx +136 -0
- package/corpus/templates/tasks/app/components/dnd/reorder-moving-items.ts +160 -0
- package/corpus/templates/tasks/app/components/dnd/sortable-drag-props.ts +60 -0
- package/corpus/templates/tasks/app/components/inbox/InboxList.tsx +222 -0
- package/corpus/templates/tasks/app/components/inbox/InboxListPage.tsx +39 -0
- package/corpus/templates/tasks/app/components/inbox/InboxListRow.tsx +122 -0
- package/corpus/templates/tasks/app/components/layout/Header.tsx +55 -0
- package/corpus/templates/tasks/app/components/layout/HeaderActions.tsx +84 -0
- package/corpus/templates/tasks/app/components/layout/Layout.tsx +134 -0
- package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +211 -0
- package/corpus/templates/tasks/app/components/shared/AddListItemInput.tsx +57 -0
- package/corpus/templates/tasks/app/components/shared/AlertDialog.tsx +53 -0
- package/corpus/templates/tasks/app/components/shared/BulkDeleteDialog.tsx +76 -0
- package/corpus/templates/tasks/app/components/shared/ChipSelect.tsx +240 -0
- package/corpus/templates/tasks/app/components/shared/DeleteItemDialog.tsx +40 -0
- package/corpus/templates/tasks/app/components/shared/InlineEditable.tsx +166 -0
- package/corpus/templates/tasks/app/components/shared/ListEmptyState.tsx +13 -0
- package/corpus/templates/tasks/app/components/shared/ListErrorMessage.tsx +15 -0
- package/corpus/templates/tasks/app/components/shared/ListViewHeader.tsx +75 -0
- package/corpus/templates/tasks/app/components/shared/PageHeader.tsx +25 -0
- package/corpus/templates/tasks/app/components/shared/RowActionsMenu.tsx +42 -0
- package/corpus/templates/tasks/app/components/shared/SidePanel.tsx +99 -0
- package/corpus/templates/tasks/app/components/shared/dnd/ListRowPreview.tsx +37 -0
- package/corpus/templates/tasks/app/components/shared/list/List.tsx +63 -0
- package/corpus/templates/tasks/app/components/shared/list/ListRow.tsx +159 -0
- package/corpus/templates/tasks/app/components/shared/list/ListRowDragHandle.tsx +52 -0
- package/corpus/templates/tasks/app/components/shared/list/ListSkeletonRows.tsx +11 -0
- package/corpus/templates/tasks/app/components/shared/list/SortableListItemShell.tsx +32 -0
- package/corpus/templates/tasks/app/components/shared/list/types.ts +1 -0
- package/corpus/templates/tasks/app/components/shared/selection/ListSelectionBar.tsx +158 -0
- package/corpus/templates/tasks/app/components/shared/selection/ListSelectionHeaderToggle.tsx +28 -0
- package/corpus/templates/tasks/app/components/shared/selection/ListSelectionToolbar.tsx +81 -0
- package/corpus/templates/tasks/app/components/shared/selection/get-list-row-selection-ui.ts +41 -0
- package/corpus/templates/tasks/app/components/shared/selection/use-list-selection.ts +196 -0
- package/corpus/templates/tasks/app/components/tasks/TaskList.tsx +333 -0
- package/corpus/templates/tasks/app/components/tasks/TaskListHeaderRow.tsx +46 -0
- package/corpus/templates/tasks/app/components/tasks/TaskListPage.tsx +115 -0
- package/corpus/templates/tasks/app/components/tasks/TaskListRow.css +49 -0
- package/corpus/templates/tasks/app/components/tasks/TaskListRow.tsx +307 -0
- package/corpus/templates/tasks/app/components/tasks/fields/TaskFieldsSidebar.tsx +102 -0
- package/corpus/templates/tasks/app/components/tasks/fields/TaskTitleSection.tsx +27 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/DateValueControl.tsx +21 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/FieldValueControl.tsx +76 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/MultiSelectValueControl.tsx +52 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/NumberValueControl.tsx +56 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/RichTextValueControl.tsx +115 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/SingleSelectValueControl.tsx +61 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/TextValueControl.tsx +20 -0
- package/corpus/templates/tasks/app/components/tasks/use-task-row-completion-animation.ts +181 -0
- package/corpus/templates/tasks/app/components/ui/accordion.tsx +56 -0
- package/corpus/templates/tasks/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/alert.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/aspect-ratio.tsx +5 -0
- package/corpus/templates/tasks/app/components/ui/avatar.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/badge.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/breadcrumb.tsx +115 -0
- package/corpus/templates/tasks/app/components/ui/button.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/calendar.tsx +70 -0
- package/corpus/templates/tasks/app/components/ui/card.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/carousel.tsx +260 -0
- package/corpus/templates/tasks/app/components/ui/chart.tsx +379 -0
- package/corpus/templates/tasks/app/components/ui/checkbox.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/collapsible.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/command.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/context-menu.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/drawer.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/form.tsx +177 -0
- package/corpus/templates/tasks/app/components/ui/hover-card.tsx +27 -0
- package/corpus/templates/tasks/app/components/ui/input-otp.tsx +69 -0
- package/corpus/templates/tasks/app/components/ui/input.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/label.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/menubar.tsx +254 -0
- package/corpus/templates/tasks/app/components/ui/navigation-menu.tsx +128 -0
- package/corpus/templates/tasks/app/components/ui/pagination.tsx +121 -0
- package/corpus/templates/tasks/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/progress.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/radio-group.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/resizable.tsx +43 -0
- package/corpus/templates/tasks/app/components/ui/scroll-area.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/select.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/sidebar.tsx +782 -0
- package/corpus/templates/tasks/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/slider.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/sonner.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/table.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/tabs.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/toast.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/toaster.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/toggle-group.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/toggle.tsx +43 -0
- package/corpus/templates/tasks/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/use-toast.ts +3 -0
- package/corpus/templates/tasks/app/entry.client.tsx +19 -0
- package/corpus/templates/tasks/app/entry.server.tsx +10 -0
- package/corpus/templates/tasks/app/global.css +93 -0
- package/corpus/templates/tasks/app/hooks/cache.ts +31 -0
- package/corpus/templates/tasks/app/hooks/use-custom-fields.ts +93 -0
- package/corpus/templates/tasks/app/hooks/use-inbox-items.ts +196 -0
- package/corpus/templates/tasks/app/hooks/use-mobile.tsx +21 -0
- package/corpus/templates/tasks/app/hooks/use-navigation-state.ts +40 -0
- package/corpus/templates/tasks/app/hooks/use-tasks.ts +276 -0
- package/corpus/templates/tasks/app/hooks/use-toast.ts +188 -0
- package/corpus/templates/tasks/app/hooks/use-visible-task-fields.ts +140 -0
- package/corpus/templates/tasks/app/lib/app-config.ts +11 -0
- package/corpus/templates/tasks/app/lib/tab-id.ts +1 -0
- package/corpus/templates/tasks/app/lib/utils.ts +1 -0
- package/corpus/templates/tasks/app/root.tsx +130 -0
- package/corpus/templates/tasks/app/routes/_index.tsx +22 -0
- package/corpus/templates/tasks/app/routes/extensions.$id.$slug.tsx +2 -0
- package/corpus/templates/tasks/app/routes/extensions.$id.tsx +11 -0
- package/corpus/templates/tasks/app/routes/extensions._index.tsx +11 -0
- package/corpus/templates/tasks/app/routes/extensions.tsx +5 -0
- package/corpus/templates/tasks/app/routes/fields.tsx +16 -0
- package/corpus/templates/tasks/app/routes/inbox.tsx +16 -0
- package/corpus/templates/tasks/app/routes/tasks.tsx +17 -0
- package/corpus/templates/tasks/app/routes/team.tsx +17 -0
- package/corpus/templates/tasks/app/routes.ts +4 -0
- package/corpus/templates/tasks/app/vite-env.d.ts +6 -0
- package/corpus/templates/tasks/components.json +20 -0
- package/corpus/templates/tasks/data/sync-config.json +1 -0
- package/corpus/templates/tasks/docs/features/README.md +81 -0
- package/corpus/templates/tasks/docs/features/f1-tasks.mdx +67 -0
- package/corpus/templates/tasks/docs/features/f2-custom-fields.mdx +68 -0
- package/corpus/templates/tasks/docs/features/f3-projects.mdx +33 -0
- package/corpus/templates/tasks/docs/features/f4-inbox.mdx +55 -0
- package/corpus/templates/tasks/docs/features/f5-views.mdx +65 -0
- package/corpus/templates/tasks/docs/features/f6-search.mdx +43 -0
- package/corpus/templates/tasks/docs/features/f7-first-run.mdx +66 -0
- package/corpus/templates/tasks/docs/features/f8-chat.mdx +120 -0
- package/corpus/templates/tasks/e2e/global-setup.ts +42 -0
- package/corpus/templates/tasks/e2e/helpers/inbox.ts +71 -0
- package/corpus/templates/tasks/e2e/helpers/tasks.ts +99 -0
- package/corpus/templates/tasks/learnings.defaults.md +5 -0
- package/corpus/templates/tasks/netlify.toml +10 -0
- package/corpus/templates/tasks/package.json +104 -0
- package/corpus/templates/tasks/playwright.config.ts +34 -0
- package/corpus/templates/tasks/public/agent-native-icon-dark.svg +10 -0
- package/corpus/templates/tasks/public/agent-native-icon-light.svg +10 -0
- package/corpus/templates/tasks/public/agent-native-logo-dark.svg +21 -0
- package/corpus/templates/tasks/public/agent-native-logo-light.svg +21 -0
- package/corpus/templates/tasks/public/favicon.svg +1 -0
- package/corpus/templates/tasks/public/icon-180.svg +1 -0
- package/corpus/templates/tasks/public/icon-192.svg +1 -0
- package/corpus/templates/tasks/public/icon-512.svg +1 -0
- package/corpus/templates/tasks/public/manifest.json +21 -0
- package/corpus/templates/tasks/react-router.config.ts +7 -0
- package/corpus/templates/tasks/server/custom-fields/normalize.ts +163 -0
- package/corpus/templates/tasks/server/custom-fields/parse.ts +146 -0
- package/corpus/templates/tasks/server/custom-fields/schema.ts +147 -0
- package/corpus/templates/tasks/server/custom-fields/store.ts +425 -0
- package/corpus/templates/tasks/server/custom-fields/task-fields.ts +104 -0
- package/corpus/templates/tasks/server/custom-fields/types.ts +98 -0
- package/corpus/templates/tasks/server/custom-fields/validate.ts +210 -0
- package/corpus/templates/tasks/server/custom-fields/values/store.ts +386 -0
- package/corpus/templates/tasks/server/db/bulk-write.ts +30 -0
- package/corpus/templates/tasks/server/db/index.ts +5 -0
- package/corpus/templates/tasks/server/db/record-utils.ts +7 -0
- package/corpus/templates/tasks/server/db/schema.ts +67 -0
- package/corpus/templates/tasks/server/db/test-tasks-table.ts +76 -0
- package/corpus/templates/tasks/server/db/transaction.ts +6 -0
- package/corpus/templates/tasks/server/errors.ts +31 -0
- package/corpus/templates/tasks/server/inbox/store.ts +216 -0
- package/corpus/templates/tasks/server/middleware/auth.ts +15 -0
- package/corpus/templates/tasks/server/plugins/agent-chat.ts +46 -0
- package/corpus/templates/tasks/server/plugins/auth.ts +15 -0
- package/corpus/templates/tasks/server/plugins/db.ts +90 -0
- package/corpus/templates/tasks/server/routes/[...page].get.ts +5 -0
- package/corpus/templates/tasks/server/stored-items/store.ts +548 -0
- package/corpus/templates/tasks/server/tasks/store.ts +306 -0
- package/corpus/templates/tasks/server/user-config/store.ts +138 -0
- package/corpus/templates/tasks/shared/app-state-tabs.ts +15 -0
- package/corpus/templates/tasks/shared/boolean-param.ts +22 -0
- package/corpus/templates/tasks/shared/bulk-limits.ts +7 -0
- package/corpus/templates/tasks/shared/list-screen-snapshot.ts +90 -0
- package/corpus/templates/tasks/shared/navigation.ts +104 -0
- package/corpus/templates/tasks/shared/visible-task-fields.ts +2 -0
- package/corpus/templates/tasks/ssr-entry.ts +15 -0
- package/corpus/templates/tasks/tsconfig.json +24 -0
- package/corpus/templates/tasks/vite.config.ts +19 -0
- package/corpus/templates/tasks/vitest.config.ts +8 -0
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +13 -0
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.js +1 -1
- package/dist/client/agent-page/AgentTabsPage.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +2 -1
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +5 -5
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { focusAgentChat } from "@agent-native/core/client";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { toast } from "sonner";
|
|
4
|
+
|
|
5
|
+
import { INERT_SORTABLE_PROPS } from "@/components/dnd/SortableItem";
|
|
6
|
+
import { AddListItemInput } from "@/components/shared/AddListItemInput";
|
|
7
|
+
import { BulkDeleteDialog } from "@/components/shared/BulkDeleteDialog";
|
|
8
|
+
import { DeleteItemDialog } from "@/components/shared/DeleteItemDialog";
|
|
9
|
+
import { ListRowPreview } from "@/components/shared/dnd/ListRowPreview";
|
|
10
|
+
import { List } from "@/components/shared/list/List";
|
|
11
|
+
import { ListSkeletonRows } from "@/components/shared/list/ListSkeletonRows";
|
|
12
|
+
import { ListEmptyState } from "@/components/shared/ListEmptyState";
|
|
13
|
+
import { ListViewHeader } from "@/components/shared/ListViewHeader";
|
|
14
|
+
import { ListSelectionBar } from "@/components/shared/selection/ListSelectionBar";
|
|
15
|
+
import { useListSelection } from "@/components/shared/selection/use-list-selection";
|
|
16
|
+
import { TaskFieldsSidebar } from "@/components/tasks/fields/TaskFieldsSidebar";
|
|
17
|
+
import { TaskListHeaderRow } from "@/components/tasks/TaskListHeaderRow";
|
|
18
|
+
import { TaskListRow } from "@/components/tasks/TaskListRow";
|
|
19
|
+
import {
|
|
20
|
+
useBulkDeleteTasks,
|
|
21
|
+
useBulkUpdateTasks,
|
|
22
|
+
useCreateTask,
|
|
23
|
+
useDeleteTask,
|
|
24
|
+
useReorderTasks,
|
|
25
|
+
useUpdateTask,
|
|
26
|
+
type TaskWithFields,
|
|
27
|
+
} from "@/hooks/use-tasks";
|
|
28
|
+
|
|
29
|
+
interface TaskListProps {
|
|
30
|
+
serverTasks: TaskWithFields[];
|
|
31
|
+
hasCompletedTasks?: boolean;
|
|
32
|
+
isPending: boolean;
|
|
33
|
+
includeDone: boolean;
|
|
34
|
+
onIncludeDoneChange: (next: boolean) => void;
|
|
35
|
+
activeTaskId: string | null;
|
|
36
|
+
setActiveTaskId: (taskId: string | null) => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function NoTasksMessage({
|
|
40
|
+
hasHiddenCompletedTasks,
|
|
41
|
+
}: {
|
|
42
|
+
hasHiddenCompletedTasks: boolean;
|
|
43
|
+
}) {
|
|
44
|
+
if (hasHiddenCompletedTasks) {
|
|
45
|
+
return (
|
|
46
|
+
<ListEmptyState
|
|
47
|
+
heading="All tasks complete"
|
|
48
|
+
description="Toggle Show all to review completed tasks."
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<ListEmptyState
|
|
55
|
+
heading="No tasks yet"
|
|
56
|
+
description="Add one above or ask chat to create a task for you."
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function TaskList({
|
|
62
|
+
serverTasks,
|
|
63
|
+
hasCompletedTasks = false,
|
|
64
|
+
isPending,
|
|
65
|
+
includeDone,
|
|
66
|
+
onIncludeDoneChange,
|
|
67
|
+
activeTaskId,
|
|
68
|
+
setActiveTaskId,
|
|
69
|
+
}: TaskListProps) {
|
|
70
|
+
const createTask = useCreateTask();
|
|
71
|
+
const updateTask = useUpdateTask();
|
|
72
|
+
const deleteTask = useDeleteTask();
|
|
73
|
+
const reorderTasks = useReorderTasks();
|
|
74
|
+
const bulkDeleteTasks = useBulkDeleteTasks();
|
|
75
|
+
const bulkUpdateTasks = useBulkUpdateTasks();
|
|
76
|
+
const [pendingDeleteId, setPendingDeleteId] = useState<string | null>(null);
|
|
77
|
+
const [bulkDeleteOpen, setBulkDeleteOpen] = useState(false);
|
|
78
|
+
const [allTasks, setAllTasks] = useState<TaskWithFields[]>(serverTasks);
|
|
79
|
+
const [orderedTasks, setOrderedTasks] =
|
|
80
|
+
useState<TaskWithFields[]>(serverTasks);
|
|
81
|
+
const exitingIdsRef = useRef<Set<string>>(new Set());
|
|
82
|
+
const tasks = useMemo(
|
|
83
|
+
() => (includeDone ? allTasks : allTasks.filter((task) => !task.done)),
|
|
84
|
+
[allTasks, includeDone],
|
|
85
|
+
);
|
|
86
|
+
const hasTasks = allTasks.length > 0;
|
|
87
|
+
const hasHiddenCompletedTasks =
|
|
88
|
+
!includeDone && tasks.length === 0 && (hasTasks || hasCompletedTasks);
|
|
89
|
+
const selection = useListSelection(tasks, "tasksSelection");
|
|
90
|
+
const selectionActive = selection.state.selectionMode;
|
|
91
|
+
const toolbarBusy = bulkUpdateTasks.isPending || updateTask.isPending;
|
|
92
|
+
const panelTask = activeTaskId
|
|
93
|
+
? (allTasks.find((task) => task.id === activeTaskId) ?? null)
|
|
94
|
+
: null;
|
|
95
|
+
|
|
96
|
+
const pendingDeleteTask = pendingDeleteId
|
|
97
|
+
? tasks.find((task) => task.id === pendingDeleteId)
|
|
98
|
+
: null;
|
|
99
|
+
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
setAllTasks(serverTasks);
|
|
102
|
+
}, [serverTasks]);
|
|
103
|
+
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
setOrderedTasks((prev) => {
|
|
106
|
+
const exitingIds = exitingIdsRef.current;
|
|
107
|
+
|
|
108
|
+
if (includeDone) {
|
|
109
|
+
exitingIds.clear();
|
|
110
|
+
} else {
|
|
111
|
+
for (const id of [...exitingIds]) {
|
|
112
|
+
const serverTask = tasks.find((task) => task.id === id);
|
|
113
|
+
if (serverTask && !serverTask.done) {
|
|
114
|
+
exitingIds.delete(id);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (exitingIds.size === 0) {
|
|
120
|
+
return tasks;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const nextTasks = [...tasks];
|
|
124
|
+
for (const [previousIndex, task] of prev.entries()) {
|
|
125
|
+
if (!exitingIds.has(task.id)) continue;
|
|
126
|
+
const insertAt = Math.min(previousIndex, nextTasks.length);
|
|
127
|
+
nextTasks.splice(insertAt, 0, { ...task, done: true });
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return nextTasks;
|
|
131
|
+
});
|
|
132
|
+
}, [tasks, includeDone]);
|
|
133
|
+
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
if (!activeTaskId || includeDone || isPending) return;
|
|
136
|
+
if (tasks.some((task) => task.id === activeTaskId)) return;
|
|
137
|
+
onIncludeDoneChange(true);
|
|
138
|
+
}, [activeTaskId, includeDone, isPending, tasks, onIncludeDoneChange]);
|
|
139
|
+
|
|
140
|
+
function handleReorder(nextTasks: TaskWithFields[]) {
|
|
141
|
+
setOrderedTasks(nextTasks);
|
|
142
|
+
reorderTasks.mutate(
|
|
143
|
+
{ taskIds: nextTasks.map((task) => task.id), includeDone },
|
|
144
|
+
{
|
|
145
|
+
onError: () => {
|
|
146
|
+
setOrderedTasks(
|
|
147
|
+
tasks.filter((task) => !exitingIdsRef.current.has(task.id)),
|
|
148
|
+
);
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
async function handleBulkDelete(ids: string[]) {
|
|
155
|
+
await bulkDeleteTasks.mutateAsync({ taskIds: ids });
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
async function confirmBulkDelete() {
|
|
159
|
+
const ids = selection.state.selectedItems.map((item) => item.id);
|
|
160
|
+
if (ids.length === 0) return;
|
|
161
|
+
|
|
162
|
+
try {
|
|
163
|
+
await handleBulkDelete(ids);
|
|
164
|
+
toast.success(
|
|
165
|
+
`Deleted ${ids.length} ${ids.length === 1 ? "task" : "tasks"}`,
|
|
166
|
+
);
|
|
167
|
+
selection.actions.clearSelection();
|
|
168
|
+
setBulkDeleteOpen(false);
|
|
169
|
+
} catch {
|
|
170
|
+
toast.error("Could not delete selected tasks.");
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return (
|
|
175
|
+
<div className="flex min-h-0 flex-1 overflow-hidden">
|
|
176
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden">
|
|
177
|
+
<div className="flex min-h-0 flex-col gap-6 overflow-hidden">
|
|
178
|
+
<ListViewHeader
|
|
179
|
+
title="Tasks"
|
|
180
|
+
description="Manage your task list, drag to reorder, or ask chat to add reminders."
|
|
181
|
+
isPending={isPending}
|
|
182
|
+
showSelectToggle={hasTasks}
|
|
183
|
+
selection={selection}
|
|
184
|
+
toolbarBusy={toolbarBusy}
|
|
185
|
+
includeDone={includeDone}
|
|
186
|
+
onIncludeDoneChange={onIncludeDoneChange}
|
|
187
|
+
showAgentToggle
|
|
188
|
+
/>
|
|
189
|
+
|
|
190
|
+
<div className="flex min-h-0 flex-1 flex-col overflow-hidden">
|
|
191
|
+
<div className="shrink-0">
|
|
192
|
+
{selectionActive ? (
|
|
193
|
+
<ListSelectionBar
|
|
194
|
+
promotedToTask
|
|
195
|
+
items={tasks.length === 0 ? [] : orderedTasks}
|
|
196
|
+
selection={selection}
|
|
197
|
+
toolbarBusy={toolbarBusy}
|
|
198
|
+
onOpenBulkDelete={() => setBulkDeleteOpen(true)}
|
|
199
|
+
/>
|
|
200
|
+
) : (
|
|
201
|
+
<AddListItemInput
|
|
202
|
+
disabled={createTask.isPending}
|
|
203
|
+
onCreate={async (title) => {
|
|
204
|
+
await createTask.mutateAsync({ title });
|
|
205
|
+
}}
|
|
206
|
+
/>
|
|
207
|
+
)}
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<div className="shrink-0">
|
|
211
|
+
<TaskListHeaderRow
|
|
212
|
+
task={orderedTasks.find((task) => task.fields)}
|
|
213
|
+
/>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
<div
|
|
217
|
+
aria-label={
|
|
218
|
+
isPending || tasks.length === 0 ? "Tasks list" : undefined
|
|
219
|
+
}
|
|
220
|
+
className="min-h-0 flex-1 overflow-y-auto overscroll-contain pr-1 outline-none"
|
|
221
|
+
>
|
|
222
|
+
{isPending ? (
|
|
223
|
+
<ListSkeletonRows />
|
|
224
|
+
) : tasks.length === 0 ? (
|
|
225
|
+
<NoTasksMessage
|
|
226
|
+
hasHiddenCompletedTasks={hasHiddenCompletedTasks}
|
|
227
|
+
/>
|
|
228
|
+
) : (
|
|
229
|
+
<List
|
|
230
|
+
items={orderedTasks}
|
|
231
|
+
selection={selection}
|
|
232
|
+
ariaLabel="Tasks list"
|
|
233
|
+
onReorder={handleReorder}
|
|
234
|
+
renderItem={({ item, sortable }) => (
|
|
235
|
+
<TaskListRow
|
|
236
|
+
sortable={sortable}
|
|
237
|
+
selection={selection}
|
|
238
|
+
item={item}
|
|
239
|
+
fields={item.fields}
|
|
240
|
+
done={item.done}
|
|
241
|
+
highlighted={activeTaskId === item.id}
|
|
242
|
+
hideAfterComplete={!includeDone}
|
|
243
|
+
onUpdateTitle={(title) =>
|
|
244
|
+
updateTask.mutateAsync({ taskId: item.id, title })
|
|
245
|
+
}
|
|
246
|
+
onUpdateDone={(done) =>
|
|
247
|
+
updateTask.mutateAsync({ taskId: item.id, done })
|
|
248
|
+
}
|
|
249
|
+
onOpenDetails={() => {
|
|
250
|
+
focusAgentChat();
|
|
251
|
+
setActiveTaskId(item.id);
|
|
252
|
+
}}
|
|
253
|
+
onRequestDelete={() => setPendingDeleteId(item.id)}
|
|
254
|
+
onBeginExit={() => {
|
|
255
|
+
exitingIdsRef.current.add(item.id);
|
|
256
|
+
setOrderedTasks((prev) =>
|
|
257
|
+
prev.map((row) =>
|
|
258
|
+
row.id === item.id ? { ...row, done: true } : row,
|
|
259
|
+
),
|
|
260
|
+
);
|
|
261
|
+
}}
|
|
262
|
+
onExitAfterComplete={() => {
|
|
263
|
+
exitingIdsRef.current.delete(item.id);
|
|
264
|
+
setOrderedTasks((prev) =>
|
|
265
|
+
prev.filter((row) => row.id !== item.id),
|
|
266
|
+
);
|
|
267
|
+
}}
|
|
268
|
+
/>
|
|
269
|
+
)}
|
|
270
|
+
renderOverlay={({ item, blockDragCount }) => (
|
|
271
|
+
<ListRowPreview
|
|
272
|
+
id={item.id}
|
|
273
|
+
overlayDataAttribute="data-dnd-overlay-task-id"
|
|
274
|
+
blockDragCount={blockDragCount}
|
|
275
|
+
>
|
|
276
|
+
<TaskListRow
|
|
277
|
+
sortable={INERT_SORTABLE_PROPS}
|
|
278
|
+
selection={selection}
|
|
279
|
+
item={item}
|
|
280
|
+
fields={item.fields}
|
|
281
|
+
done={item.done}
|
|
282
|
+
highlighted={false}
|
|
283
|
+
hideAfterComplete={false}
|
|
284
|
+
onUpdateTitle={async () => {}}
|
|
285
|
+
onUpdateDone={async () => {}}
|
|
286
|
+
onOpenDetails={() => {}}
|
|
287
|
+
onRequestDelete={() => {}}
|
|
288
|
+
onBeginExit={() => {}}
|
|
289
|
+
onExitAfterComplete={() => {}}
|
|
290
|
+
/>
|
|
291
|
+
</ListRowPreview>
|
|
292
|
+
)}
|
|
293
|
+
/>
|
|
294
|
+
)}
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
{!selectionActive ? (
|
|
298
|
+
<DeleteItemDialog
|
|
299
|
+
open={pendingDeleteTask !== null}
|
|
300
|
+
onOpenChange={(open) => {
|
|
301
|
+
if (!open) setPendingDeleteId(null);
|
|
302
|
+
}}
|
|
303
|
+
entityLabel="task"
|
|
304
|
+
itemTitle={pendingDeleteTask?.title ?? null}
|
|
305
|
+
pending={deleteTask.isPending}
|
|
306
|
+
onConfirm={async () => {
|
|
307
|
+
if (!pendingDeleteId) return;
|
|
308
|
+
await deleteTask.mutateAsync({ taskId: pendingDeleteId });
|
|
309
|
+
setPendingDeleteId(null);
|
|
310
|
+
}}
|
|
311
|
+
/>
|
|
312
|
+
) : null}
|
|
313
|
+
|
|
314
|
+
<BulkDeleteDialog
|
|
315
|
+
open={bulkDeleteOpen}
|
|
316
|
+
onOpenChange={setBulkDeleteOpen}
|
|
317
|
+
selectedItems={selection.state.selectedItems}
|
|
318
|
+
entitySingular="task"
|
|
319
|
+
entityPlural="tasks"
|
|
320
|
+
pending={bulkDeleteTasks.isPending}
|
|
321
|
+
onConfirm={() => void confirmBulkDelete()}
|
|
322
|
+
/>
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
</div>
|
|
326
|
+
|
|
327
|
+
<TaskFieldsSidebar
|
|
328
|
+
task={panelTask}
|
|
329
|
+
onClose={() => setActiveTaskId(null)}
|
|
330
|
+
/>
|
|
331
|
+
</div>
|
|
332
|
+
);
|
|
333
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { TaskFieldValue } from "@/hooks/use-custom-fields";
|
|
2
|
+
import type { TaskWithFields } from "@/hooks/use-tasks";
|
|
3
|
+
import {
|
|
4
|
+
TASK_CARD_FIELD_LIMIT,
|
|
5
|
+
useVisibleTaskFieldIds,
|
|
6
|
+
} from "@/hooks/use-visible-task-fields";
|
|
7
|
+
|
|
8
|
+
function TaskListFieldStripHeader({ fields }: { fields?: TaskFieldValue[] }) {
|
|
9
|
+
const { fieldIds } = useVisibleTaskFieldIds();
|
|
10
|
+
const items = fieldIds.slice(0, TASK_CARD_FIELD_LIMIT).map((fieldId) => {
|
|
11
|
+
const field = fields?.find((candidate) => candidate.id === fieldId);
|
|
12
|
+
return { id: fieldId, title: field?.title ?? fieldId };
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div
|
|
17
|
+
className="grid items-center gap-2 text-xs font-medium text-muted-foreground"
|
|
18
|
+
style={{
|
|
19
|
+
gridTemplateColumns: `repeat(${Math.min(fieldIds.length, TASK_CARD_FIELD_LIMIT)}, minmax(6.5rem, 8rem))`,
|
|
20
|
+
}}
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
>
|
|
23
|
+
{items.map((item) => (
|
|
24
|
+
<div key={item.id} className="truncate px-2">
|
|
25
|
+
{item.title}
|
|
26
|
+
</div>
|
|
27
|
+
))}
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function TaskListHeaderRow({
|
|
33
|
+
task,
|
|
34
|
+
}: {
|
|
35
|
+
task: TaskWithFields | undefined;
|
|
36
|
+
}) {
|
|
37
|
+
return (
|
|
38
|
+
<div className="hidden items-center gap-3 px-3 mb-2 text-xs font-medium text-muted-foreground md:flex">
|
|
39
|
+
<div className="size-8 shrink-0" />
|
|
40
|
+
<div className="size-4 shrink-0" />
|
|
41
|
+
<div className="min-w-0 flex-1 px-3">Task</div>
|
|
42
|
+
<TaskListFieldStripHeader fields={task?.fields} />
|
|
43
|
+
<div className="size-8 shrink-0" />
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import {
|
|
2
|
+
INCLUDE_DONE_QUERY_VALUE,
|
|
3
|
+
parseIncludeDoneParam,
|
|
4
|
+
} from "@shared/boolean-param";
|
|
5
|
+
import { useCallback, useEffect } from "react";
|
|
6
|
+
import { useSearchParams } from "react-router";
|
|
7
|
+
|
|
8
|
+
import { ListErrorMessage } from "@/components/shared/ListErrorMessage";
|
|
9
|
+
import { ListViewHeader } from "@/components/shared/ListViewHeader";
|
|
10
|
+
import { TaskList } from "@/components/tasks/TaskList";
|
|
11
|
+
import { useTasks } from "@/hooks/use-tasks";
|
|
12
|
+
|
|
13
|
+
export function TaskListPage() {
|
|
14
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
15
|
+
const includeDone = parseIncludeDoneParam(searchParams.get("includeDone"));
|
|
16
|
+
const activeTaskId = searchParams.get("task");
|
|
17
|
+
|
|
18
|
+
const setIncludeDone = useCallback(
|
|
19
|
+
(next: boolean) => {
|
|
20
|
+
setSearchParams(
|
|
21
|
+
(prev) => {
|
|
22
|
+
const nextParams = new URLSearchParams(prev);
|
|
23
|
+
if (next) {
|
|
24
|
+
nextParams.set("includeDone", INCLUDE_DONE_QUERY_VALUE);
|
|
25
|
+
} else {
|
|
26
|
+
nextParams.delete("includeDone");
|
|
27
|
+
}
|
|
28
|
+
return nextParams;
|
|
29
|
+
},
|
|
30
|
+
{ replace: true },
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
[setSearchParams],
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const setActiveTaskId = useCallback(
|
|
37
|
+
(nextTaskId: string | null) => {
|
|
38
|
+
setSearchParams(
|
|
39
|
+
(prev) => {
|
|
40
|
+
const nextParams = new URLSearchParams(prev);
|
|
41
|
+
if (nextTaskId) {
|
|
42
|
+
nextParams.set("task", nextTaskId);
|
|
43
|
+
} else {
|
|
44
|
+
nextParams.delete("task");
|
|
45
|
+
}
|
|
46
|
+
return nextParams;
|
|
47
|
+
},
|
|
48
|
+
{ replace: true },
|
|
49
|
+
);
|
|
50
|
+
},
|
|
51
|
+
[setSearchParams],
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const {
|
|
55
|
+
tasks: serverTasks,
|
|
56
|
+
hasCompletedTasks,
|
|
57
|
+
isPending,
|
|
58
|
+
isError,
|
|
59
|
+
error,
|
|
60
|
+
} = useTasks({
|
|
61
|
+
includeDone,
|
|
62
|
+
includeFields: true,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (!activeTaskId || isPending) return;
|
|
67
|
+
if (serverTasks.some((task) => task.id === activeTaskId)) return;
|
|
68
|
+
if (!includeDone) {
|
|
69
|
+
setIncludeDone(true);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
setActiveTaskId(null);
|
|
73
|
+
}, [
|
|
74
|
+
activeTaskId,
|
|
75
|
+
includeDone,
|
|
76
|
+
isPending,
|
|
77
|
+
serverTasks,
|
|
78
|
+
setActiveTaskId,
|
|
79
|
+
setIncludeDone,
|
|
80
|
+
]);
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<div className="mx-auto flex h-full min-h-0 w-full max-w-6xl flex-col gap-6 overflow-hidden p-4 md:p-6">
|
|
84
|
+
{isError ? (
|
|
85
|
+
<>
|
|
86
|
+
<ListViewHeader
|
|
87
|
+
title="Tasks"
|
|
88
|
+
description="Manage your task list, drag to reorder, or ask chat to add reminders."
|
|
89
|
+
isPending={false}
|
|
90
|
+
showSelectToggle={false}
|
|
91
|
+
selection={null}
|
|
92
|
+
toolbarBusy={false}
|
|
93
|
+
includeDone={includeDone}
|
|
94
|
+
onIncludeDoneChange={setIncludeDone}
|
|
95
|
+
showAgentToggle
|
|
96
|
+
/>
|
|
97
|
+
<ListErrorMessage
|
|
98
|
+
error={error}
|
|
99
|
+
fallbackMessage="Failed to load tasks."
|
|
100
|
+
/>
|
|
101
|
+
</>
|
|
102
|
+
) : (
|
|
103
|
+
<TaskList
|
|
104
|
+
serverTasks={serverTasks}
|
|
105
|
+
hasCompletedTasks={hasCompletedTasks}
|
|
106
|
+
isPending={isPending}
|
|
107
|
+
includeDone={includeDone}
|
|
108
|
+
onIncludeDoneChange={setIncludeDone}
|
|
109
|
+
activeTaskId={activeTaskId}
|
|
110
|
+
setActiveTaskId={setActiveTaskId}
|
|
111
|
+
/>
|
|
112
|
+
)}
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@keyframes task-row-exit {
|
|
2
|
+
from {
|
|
3
|
+
opacity: 1;
|
|
4
|
+
transform: translateY(0) scale(1);
|
|
5
|
+
}
|
|
6
|
+
to {
|
|
7
|
+
opacity: 0;
|
|
8
|
+
transform: translateY(-0.35rem) scale(0.985);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@keyframes task-row-complete {
|
|
13
|
+
0% {
|
|
14
|
+
background-color: hsl(var(--accent) / 0.4);
|
|
15
|
+
}
|
|
16
|
+
100% {
|
|
17
|
+
background-color: transparent;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@keyframes task-row-restore {
|
|
22
|
+
from {
|
|
23
|
+
opacity: 0.55;
|
|
24
|
+
}
|
|
25
|
+
to {
|
|
26
|
+
opacity: 1;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.task-row-exit {
|
|
31
|
+
animation: task-row-exit 260ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
|
32
|
+
pointer-events: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.task-row-complete {
|
|
36
|
+
animation: task-row-complete 220ms ease forwards;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.task-row-restore {
|
|
40
|
+
animation: task-row-restore 220ms ease forwards;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@media (prefers-reduced-motion: reduce) {
|
|
44
|
+
.task-row-exit,
|
|
45
|
+
.task-row-complete,
|
|
46
|
+
.task-row-restore {
|
|
47
|
+
animation-duration: 1ms;
|
|
48
|
+
}
|
|
49
|
+
}
|