Skip to content

Commit

Permalink
[sc] task text entry improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
a-type committed Jun 9, 2024
1 parent ce9bfb0 commit a3e5ab7
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 58 deletions.
2 changes: 1 addition & 1 deletion apps/gnocchi/hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"typecheck": "tsc --build tsconfig.json"
},
"dependencies": {
"@a-type/ui": "^0.8.18",
"@a-type/ui": "^0.8.19",
"@a-type/utils": "^1.0.8",
"@tiptap/core": "^2.2.4",
"@tiptap/extension-document": "^2.2.4",
Expand Down
2 changes: 1 addition & 1 deletion apps/gnocchi/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"typecheck": "tsc --build tsconfig.json"
},
"dependencies": {
"@a-type/ui": "^0.8.18",
"@a-type/ui": "^0.8.19",
"@a-type/utils": "^1.0.8",
"@biscuits/client": "workspace:*",
"@biscuits/error": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion apps/marginalia/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@a-type/ui": "0.8.18",
"@a-type/ui": "0.8.19",
"@a-type/utils": "1.1.0",
"@biscuits/client": "workspace:*",
"@marginalia.biscuits/verdant": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion apps/shopping/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@a-type/ui": "^0.8.18",
"@a-type/ui": "^0.8.19",
"@a-type/utils": "^1.0.8",
"@biscuits/client": "workspace:*",
"@react-spring/web": "^9.7.3",
Expand Down
2 changes: 1 addition & 1 deletion apps/star-chart/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@a-type/ui": "0.8.18",
"@a-type/ui": "0.8.19",
"@a-type/utils": "1.1.2",
"@biscuits/client": "workspace:*",
"@react-spring/web": "^9.7.3",
Expand Down
25 changes: 22 additions & 3 deletions apps/star-chart/web/src/components/project/TaskNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export function TaskNode({ task }: TaskNodeProps) {
!selected && pendingSelect && 'layer-variants:border-primary-light',
!!completedAt &&
(downstreamUncompleted
? 'opacity-[calc(var(--zoom,1)*var(--zoom,1))]'
: 'opacity-[calc(var(--zoom,1)*var(--zoom,1)*0.5)]'),
? 'opacity-[var(--zoom,1)]'
: 'opacity-[calc(var(--zoom,1)*var(--zoom,1))] sm:opacity-[calc(var(--zoom,1)*var(--zoom,1)*0.5)]'),
activeConnectionTarget === id && 'bg-accent-light border-accent',
)}
style={style}
Expand Down Expand Up @@ -136,6 +136,11 @@ function TaskFullContent({
[client, id, projectId],
);

const canvas = useCanvas();
const commitAndEndEditing = () => {
canvas.selections.remove(id);
};

return (
<div className="row items-start p-2">
<Checkbox
Expand All @@ -149,11 +154,25 @@ function TaskFullContent({
/>
{exclusive ? (
<LiveUpdateTextField
className="text-sm min-w-80px w-auto py-0px h-full"
className="text-sm min-w-80px w-auto py-0px h-full rounded-md"
value={content}
onChange={(v) => task.set('content', v)}
autoSelect
autoFocus
textArea
onKeyDown={(ev) => {
if (ev.key === 'Enter') {
ev.preventDefault();
task.set('content', content);
commitAndEndEditing();
}

const isModifiedKeypress = ev.metaKey || ev.ctrlKey;
if (!isModifiedKeypress) {
// capture all keypresses that aren't modified
ev.stopPropagation();
}
}}
/>
) : (
<div
Expand Down
2 changes: 1 addition & 1 deletion apps/trip-tick/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@a-type/ui": "^0.8.18",
"@a-type/ui": "^0.8.19",
"@a-type/utils": "^1.0.6",
"@biscuits/client": "workspace:*",
"@radix-ui/react-progress": "^1.0.3",
Expand Down
2 changes: 1 addition & 1 deletion blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"astro": "astro"
},
"dependencies": {
"@a-type/ui": "^0.8.18",
"@a-type/ui": "^0.8.19",
"@astrojs/check": "^0.5.10",
"@astrojs/mdx": "^2.3.1",
"@astrojs/rss": "^4.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"vite-plugin-pwa": "0.19.2"
},
"devDependencies": {
"@a-type/ui": "^0.8.18",
"@a-type/ui": "^0.8.19",
"@types/react": "18.2.79",
"@verdant-web/store": "^3.6.3",
"react": "^18.2.0",
Expand Down
Loading

0 comments on commit a3e5ab7

Please sign in to comment.