Skip to content

Commit 1b1aa19

Browse files
committed
Refactor branding documentation and enhance pre-commit setup
- Improve formatting in BRANDING.md for better readability - Add husky and lint-staged for pre-commit hooks in package.json - Update TODO.md to reflect completed tasks - Clean up code in ChatView, SpotifyPlayer, and MessagesTimeline components
1 parent d0c16f2 commit 1b1aa19

10 files changed

Lines changed: 279 additions & 198 deletions

File tree

.claude/worktrees/agent-a634e4db

Lines changed: 0 additions & 1 deletion
This file was deleted.

.claude/worktrees/agent-afc59fb8

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bunx lint-staged

BRANDING.md

Lines changed: 183 additions & 181 deletions
Large diffs are not rendered by default.

TODO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
- [x] Only show last 10 threads for a given project
66
- [x] Projects should be sorted by latest thread update
7-
- [ ] Submitting new messages should scroll to bottom — [#13](https://github.com/OpenKnots/okcode/issues/13)
7+
- [x] Submitting new messages should scroll to bottom — [#13](https://github.com/OpenKnots/okcode/issues/13)
88
- [ ] Thread archiving — [#10](https://github.com/OpenKnots/okcode/issues/10)
99
- [ ] New projects should go on top — [#11](https://github.com/OpenKnots/okcode/issues/11)
1010

1111
## Bigger things
1212

13-
- [ ] Queueing messages — [#12](https://github.com/OpenKnots/okcode/issues/12)
13+
- [x] Queueing messages — [#12](https://github.com/OpenKnots/okcode/issues/12)

apps/web/src/components/ChatView.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,9 +2236,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
22362236
});
22372237
})()
22382238
.catch((err: unknown) => {
2239-
setOptimisticUserMessages((existing) =>
2240-
existing.filter((msg) => msg.id !== nextQueued.id),
2241-
);
2239+
setOptimisticUserMessages((existing) => existing.filter((msg) => msg.id !== nextQueued.id));
22422240
setThreadError(
22432241
threadIdForSend,
22442242
err instanceof Error ? err.message : "Failed to send queued message.",

apps/web/src/components/SpotifyPlayer.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ export function SpotifyToggleButton() {
2727
)}
2828
>
2929
<Music2Icon className="size-3.5" />
30-
<span className="truncate">
31-
{isOpen && activePlaylist ? activePlaylist.name : "Spotify"}
32-
</span>
30+
<span className="truncate">{isOpen && activePlaylist ? activePlaylist.name : "Spotify"}</span>
3331
{isOpen && (
3432
<span className="ml-auto flex size-1.5 rounded-full bg-emerald-400 animate-pulse" />
3533
)}

apps/web/src/components/chat/MessagesTimeline.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,14 @@ export const MessagesTimeline = memo(function MessagesTimeline({
373373
const isQueued = row.message.queued === true;
374374
return (
375375
<div className="flex justify-end">
376-
<div className={cn("group relative max-w-[80%] rounded-2xl rounded-br-sm border px-4 py-3", isQueued ? "border-dashed border-border/60 bg-secondary/60" : "border-border bg-secondary")}>
376+
<div
377+
className={cn(
378+
"group relative max-w-[80%] rounded-2xl rounded-br-sm border px-4 py-3",
379+
isQueued
380+
? "border-dashed border-border/60 bg-secondary/60"
381+
: "border-border bg-secondary",
382+
)}
383+
>
377384
{userImages.length > 0 && (
378385
<div className="mb-2 grid max-w-[420px] grid-cols-2 gap-2">
379386
{userImages.map(

bun.lock

Lines changed: 71 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@
4949
"release:smoke": "node scripts/release-smoke.ts",
5050
"clean": "rm -rf node_modules apps/*/node_modules packages/*/node_modules apps/*/dist apps/*/dist-electron packages/*/dist .turbo apps/*/.turbo packages/*/.turbo",
5151
"sync:vscode-icons": "node scripts/sync-vscode-icons.mjs",
52-
"regenerate:brand-assets": "python3 scripts/generate-brand-assets.py"
52+
"regenerate:brand-assets": "python3 scripts/generate-brand-assets.py",
53+
"prepare": "husky"
5354
},
5455
"devDependencies": {
5556
"@types/node": "catalog:",
57+
"husky": "^9.1.7",
58+
"lint-staged": "^16.4.0",
5659
"oxfmt": "^0.40.0",
5760
"oxlint": "^1.55.0",
5861
"turbo": "^2.3.3",
@@ -61,6 +64,14 @@
6164
"overrides": {
6265
"vite": "^8.0.0"
6366
},
67+
"lint-staged": {
68+
"*": [
69+
"oxfmt"
70+
],
71+
"*.{ts,tsx,js,jsx}": [
72+
"oxlint --report-unused-disable-directives"
73+
]
74+
},
6475
"engines": {
6576
"bun": "^1.3.9",
6677
"node": "^24.13.1"

0 commit comments

Comments
 (0)