Skip to content

Commit d2bebe8

Browse files
committed
feat: redesign task details page
1 parent d53a567 commit d2bebe8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5987
-2580
lines changed

apps/api/src/activity/index.ts

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@ import deleteComment from "./controllers/delete-comment";
1313
import getActivities from "./controllers/get-activities";
1414
import updateComment from "./controllers/update-comment";
1515

16+
function toDisplayCase(value: string) {
17+
return value
18+
.replace(/[-_]/g, " ")
19+
.split(" ")
20+
.filter(Boolean)
21+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
22+
.join(" ");
23+
}
24+
25+
function formatActivityDate(value: Date | string | null | undefined) {
26+
if (!value) return null;
27+
const date = value instanceof Date ? value : new Date(value);
28+
if (Number.isNaN(date.getTime())) return null;
29+
30+
return new Intl.DateTimeFormat("en-US", {
31+
month: "short",
32+
day: "numeric",
33+
year: "numeric",
34+
}).format(date);
35+
}
36+
1637
const activity = new Hono<{
1738
Variables: {
1839
userId: string;
@@ -207,7 +228,7 @@ subscribeToEvent<{
207228
data.taskId,
208229
data.type,
209230
data.userId,
210-
`changed status from "${data.oldStatus}" to "${data.newStatus}"`,
231+
`changed status from ${toDisplayCase(data.oldStatus)} to ${toDisplayCase(data.newStatus)}`,
211232
);
212233
});
213234

@@ -223,7 +244,7 @@ subscribeToEvent<{
223244
data.taskId,
224245
data.type,
225246
data.userId,
226-
`changed priority from "${data.oldPriority}" to "${data.newPriority}"`,
247+
`changed priority from ${toDisplayCase(data.oldPriority)} to ${toDisplayCase(data.newPriority)}`,
227248
);
228249
});
229250

@@ -250,11 +271,21 @@ subscribeToEvent<{
250271
title: string;
251272
type: string;
252273
}>("task.assignee_changed", async (data) => {
274+
if (data.userId === data.newAssigneeId) {
275+
await createActivity(
276+
data.taskId,
277+
data.type,
278+
data.userId,
279+
"assigned the task to themselves",
280+
);
281+
return;
282+
}
283+
253284
await createActivity(
254285
data.taskId,
255286
data.type,
256287
data.userId,
257-
`assigned the task to ${data.newAssignee}`,
288+
`assigned the task to [[user:${data.newAssigneeId}|${data.newAssignee}]]`,
258289
);
259290
});
260291

@@ -266,9 +297,7 @@ subscribeToEvent<{
266297
title: string;
267298
type: string;
268299
}>("task.due_date_changed", async (data) => {
269-
const oldDate = data.oldDueDate
270-
? new Date(data.oldDueDate).toLocaleDateString()
271-
: "none";
300+
const oldDate = formatActivityDate(data.oldDueDate) || "none";
272301

273302
if (!data.newDueDate) {
274303
await createActivity(
@@ -280,7 +309,9 @@ subscribeToEvent<{
280309
return;
281310
}
282311

283-
const newDate = new Date(data.newDueDate).toLocaleDateString();
312+
const newDate = formatActivityDate(data.newDueDate);
313+
if (!newDate) return;
314+
284315
await createActivity(
285316
data.taskId,
286317
data.type,

apps/api/src/auth.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,11 @@ export const auth = betterAuth({
242242
apiKey({
243243
enableSessionForAPIKeys: true,
244244
apiKeyHeaders: "x-api-key",
245+
rateLimit: {
246+
enabled: true,
247+
maxRequests: 100,
248+
timeWindow: 60 * 1000,
249+
},
245250
}),
246251
openAPI(),
247252
],

apps/api/src/task/controllers/get-task.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ async function getTask(taskId: string) {
3131
});
3232
}
3333

34-
if (task[0].description) {
35-
task[0].description = task[0].description.replace(/\n+/g, "\n");
36-
}
37-
3834
return task[0];
3935
}
4036

apps/web/package.json

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
"dependencies": {
1414
"@base-ui/react": "^1.2.0",
1515
"@better-auth/api-key": "^1.5.3",
16-
"@blocknote/core": "^0.47.0",
17-
"@blocknote/react": "^0.47.0",
18-
"@blocknote/shadcn": "^0.47.0",
1916
"@dnd-kit/core": "^6.3.1",
2017
"@dnd-kit/modifiers": "^9.0.0",
2118
"@dnd-kit/sortable": "^10.0.0",
@@ -45,6 +42,22 @@
4542
"@tanstack/react-router": "^1.163.3",
4643
"@tanstack/router-devtools": "^1.163.3",
4744
"@tanstack/router-plugin": "^1.164.0",
45+
"@tiptap/core": "^3.20.0",
46+
"@tiptap/extension-code-block-lowlight": "^3.20.0",
47+
"@tiptap/extension-link": "^3.20.0",
48+
"@tiptap/extension-list": "^3.20.1",
49+
"@tiptap/extension-placeholder": "^3.20.0",
50+
"@tiptap/extension-table": "^3.20.0",
51+
"@tiptap/extension-table-cell": "^3.20.0",
52+
"@tiptap/extension-table-header": "^3.20.0",
53+
"@tiptap/extension-table-row": "^3.20.0",
54+
"@tiptap/extension-task-item": "^3.20.1",
55+
"@tiptap/extension-task-list": "^3.20.1",
56+
"@tiptap/extension-underline": "^3.20.0",
57+
"@tiptap/markdown": "^3.20.0",
58+
"@tiptap/pm": "^3.20.0",
59+
"@tiptap/react": "^3.20.0",
60+
"@tiptap/starter-kit": "^3.20.0",
4861
"@types/file-saver": "^2.0.7",
4962
"@vitejs/plugin-react": "^5.1.4",
5063
"babel-plugin-react-compiler": "^19.0.0-beta-714736e-20250131",
@@ -55,10 +68,14 @@
5568
"date-fns": "^4.1.0",
5669
"file-saver": "^2.0.5",
5770
"framer-motion": "^12.34.3",
71+
"highlight.js": "^11.11.1",
5872
"hono": "^4.12.4",
5973
"immer": "^11.1.4",
6074
"input-otp": "^1.4.2",
75+
"lowlight": "^3.3.0",
6176
"lucide-react": "^0.575.0",
77+
"marked": "^17.0.4",
78+
"radix-ui": "^1.4.3",
6279
"react": "^19.2.4",
6380
"react-day-picker": "9.14.0",
6481
"react-dom": "^19.2.4",
@@ -69,6 +86,9 @@
6986
"tailwind-animate": "^0.2.10",
7087
"tailwind-merge": "^3.5.0",
7188
"tailwindcss-animate": "^1.0.7",
89+
"tippy.js": "^6.3.7",
90+
"turndown": "^7.2.2",
91+
"turndown-plugin-gfm": "^1.0.2",
7292
"zod": "^4.3.6",
7393
"zustand": "^5.0.11"
7494
},

0 commit comments

Comments
 (0)