Skip to content

Commit b942f73

Browse files
authored
Merge pull request #1 from ut-code/work
AGI session
2 parents 803d242 + d494ba6 commit b942f73

Some content is hidden

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

58 files changed

+2531
-1614
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,3 @@ jobs:
3333
- run: bun install --frozen-lockfile
3434
- run: bun run build
3535

36-
e2e:
37-
name: E2E Tests
38-
runs-on: ubuntu-latest
39-
timeout-minutes: 15
40-
steps:
41-
- uses: actions/checkout@v6
42-
- uses: oven-sh/setup-bun@v2
43-
with:
44-
bun-version: latest
45-
- run: bun install --frozen-lockfile
46-
- run: bunx playwright install chromium --with-deps
47-
- run: bun run test:e2e

bun.lock

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

docs/knowledges/data-models.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ members
5959
├── name TEXT NOT NULL
6060
├── bio TEXT
6161
├── imageUrl TEXT
62+
├── githubUrl TEXT
63+
├── twitterUrl TEXT
64+
├── websiteUrl TEXT
6265
├── pageContent TEXT
6366
├── viewCount INTEGER NOT NULL DEFAULT 0
6467
├── createdAt INTEGER NOT NULL

docs/knowledges/image-upload.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,38 @@ const MAX_BASE64_SIZE = Math.ceil(10 * 1024 * 1024 * 1.37);
4242
- Base64 adds ~37% overhead
4343
- 10MB file → ~13.7MB base64
4444

45+
## S3 Key Format
46+
47+
Keys follow the format: `{folder}/{uuid}-{filename}.{ext}`
48+
49+
Example: `articles/a1b2c3d4-e5f6-7890-abcd-ef1234567890-cover.webp`
50+
51+
Allowed folders: `images`, `uploads`, `covers`, `avatars`, `articles`, `members`, `projects`
52+
53+
## S3 Cleanup
54+
55+
When images are changed or removed, the old S3 file is automatically deleted:
56+
57+
- **Change**: Old image deleted after new upload succeeds
58+
- **Remove**: Image deleted immediately when "Remove" button clicked
59+
- **External URLs**: Non-S3 URLs (different host) are ignored safely
60+
61+
The `removeByUrl` command in `storage.remote.ts` handles URL-to-key conversion server-side.
62+
63+
## User Input Methods
64+
65+
The `ImageUpload` component supports:
66+
67+
1. **Click**: Click to open file picker
68+
2. **Drag & Drop**: Drag image files onto the component
69+
3. **Paste (Ctrl+V)**: Paste from clipboard anywhere on the page
70+
71+
Paste is handled globally via `svelte:window onpaste` and skips INPUT/TEXTAREA elements to avoid conflicts.
72+
4573
## Design Decisions
4674

4775
- **Never reject user uploads**: Compress instead of refusing
4876
- **Quality over size**: Try high quality first, only reduce if needed
4977
- **GIF exception**: GIFs skip compression (animation would be lost)
78+
- **Clean up S3**: Delete old files on change/remove to avoid orphans
79+
- **Fire-and-forget cleanup**: S3 deletion errors don't block the UI
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE "member" ADD COLUMN "github_url" text;--> statement-breakpoint
2+
ALTER TABLE "member" ADD COLUMN "twitter_url" text;--> statement-breakpoint
3+
ALTER TABLE "member" ADD COLUMN "website_url" text;

0 commit comments

Comments
 (0)