Skip to content

Commit 306fe07

Browse files
committed
feat: Feed (private alpha)
commit 296954896f722ba37b67ba4d77088a0b3336b9ef Author: Tanner Linsley <[email protected]> Date: Sun Nov 30 21:46:31 2025 -0700 checkpoint commit 686548fc1fa64cfe4444504852f4bbbd260878f4 Author: Tanner Linsley <[email protected]> Date: Sun Nov 30 21:41:32 2025 -0700 checkpoint commit 6c17c1489158dae51a2cec39034ce5651535a743 Author: Tanner Linsley <[email protected]> Date: Thu Nov 27 10:57:49 2025 -0700 checkpoint commit b51b11fa3422a8c6b2c10785078598f1748192f6 Author: Tanner Linsley <[email protected]> Date: Mon Nov 24 22:11:17 2025 -0700 checkpoint
1 parent 8a76a5b commit 306fe07

Some content is hidden

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

65 files changed

+9495
-431
lines changed

AGENTS.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Agent Guidelines
2+
3+
## Typesafety
4+
5+
**Typesafety is of utmost importance.**
6+
7+
### Avoid Type Casting
8+
9+
We **never ever** cast types unless it's absolutely necessary. This includes:
10+
- Manual generic type parameters (e.g., `<Type>`)
11+
- Type assertions using `as`
12+
- Type assertions using `satisfies`
13+
- Any other form of type casting
14+
15+
### Prefer Type Inference
16+
17+
Always infer types and go up the logical chain as far as we can control to determine types. The preferred approach is:
18+
1. **Schema validation** - Use schema definitions (e.g., Convex schema, Zod, etc.) as the source of truth
19+
2. **Type inference from concrete sources** - Let TypeScript infer types from function return types, API responses, etc.
20+
3. **Go up the chain** - Trace types back to their source rather than casting at the point of use
21+
22+
### Example
23+
24+
❌ **Bad:**
25+
```typescript
26+
const result = api.getData() as MyType;
27+
const value = getValue<MyType>();
28+
```
29+
30+
✅ **Good:**
31+
```typescript
32+
// Infer from schema or API definition
33+
const result = api.getData(); // Type inferred from api.getData return type
34+
const value = getValue(); // Type inferred from function implementation
35+
```
36+
37+
If types need to be fixed, fix them at the source (schema, API definition, function signature) rather than casting at the point of use.
38+
39+
## Route Loaders
40+
41+
### loaderDeps Must Be Specific
42+
43+
**loaderDeps must always be specific to what's actually used in the loader.**
44+
45+
Only include the properties from `search` (or other sources) that are actually used in the loader function. This ensures proper cache invalidation and prevents unnecessary re-runs when unrelated search params change.
46+
47+
❌ **Bad:**
48+
```typescript
49+
loaderDeps: ({ search }) => search, // Includes everything, even unused params
50+
loader: async ({ deps }) => {
51+
// Only uses deps.page and deps.pageSize
52+
await fetchData({ page: deps.page, pageSize: deps.pageSize })
53+
}
54+
```
55+
56+
✅ **Good:**
57+
```typescript
58+
loaderDeps: ({ search }) => ({
59+
page: search.page,
60+
pageSize: search.pageSize,
61+
// Only include what's actually used in the loader
62+
}),
63+
loader: async ({ deps }) => {
64+
await fetchData({ page: deps.page, pageSize: deps.pageSize })
65+
}
66+
```
67+
68+
This ensures the loader only re-runs when the specific dependencies change, not when unrelated search params (like `expanded`, `viewMode`, etc.) change.
69+

agents/tasks/feed-admin-fixes.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Feed Admin Feature - Fix List
2+
3+
## Issues Found and Fixed
4+
5+
### 1. Route Navigation - ✅ FIXED
6+
**File**: `src/routes/admin/feed.tsx`
7+
**Issue**: Using `/admin/feed/new` which doesn't exist as a route
8+
**Fix**: Changed to `/admin/feed/$id` with `params={{ id: 'new' }}`
9+
10+
### 2. Navigation Search Params - ✅ FIXED
11+
**File**: `src/routes/admin/feed.tsx`
12+
**Issue**: Direct object assignment to search params
13+
**Fix**: Updated to use function form: `search: (s) => ({ ...s, ...updates })`
14+
15+
### 3. Window Confirm - ✅ FIXED
16+
**File**: `src/routes/admin/feed.tsx`
17+
**Issue**: Using `confirm()` without `window.` prefix
18+
**Fix**: Changed to `window.confirm()`
19+
20+
### 4. Type Error in FeedEntryEditor - ✅ FIXED
21+
**File**: `src/routes/admin/feed.$id.tsx`
22+
**Issue**: `entryQuery` could be `undefined` but type expects `FeedEntry | null`
23+
**Fix**: Added null coalescing: `entryQuery ?? null`
24+
25+
### 5. Unused Imports - ✅ FIXED
26+
**Files**: Multiple admin files
27+
**Issue**: Unused imports causing warnings
28+
**Fix**: Removed unused imports (`useState`, `useEffect`, `validateManualEntry`)
29+
30+
### 6. Library Filter Property - ✅ FIXED
31+
**File**: `src/components/admin/FeedEntryEditor.tsx`
32+
**Issue**: Accessing `lib.visible` property that doesn't exist
33+
**Fix**: Removed filter for non-existent property
34+
35+
### 7. Actions Export - ✅ FIXED
36+
**File**: `src/components/admin/FeedSyncStatus.tsx`
37+
**Issue**: `api.feed.actions` doesn't exist in generated API
38+
**Fix**: Removed `syncAllSources` button and updated to use `useAction` hook. GitHub sync works via `api.feed.github.syncGitHubReleases`.
39+
**Note**: The `actions.ts` file exists but Convex may need to regenerate types. GitHub sync action works correctly.
40+
41+
## Remaining Issues
42+
43+
### 1. Actions Not Exported
44+
**File**: `convex/feed/actions.ts`
45+
**Issue**: Actions file exists but `api.feed.actions` is not available
46+
**Status**: Need to verify Convex file structure. Actions may need to be in root `convex/` directory or registered differently.
47+
48+
### 2. Route Search Params Type Errors - ✅ FIXED
49+
**File**: `src/routes/admin/feed.tsx`
50+
**Issue**: TypeScript errors with search param updates
51+
**Fix**: Changed from `useNavigate()` to `Route.useNavigate()` and updated search param updates to use object spread instead of function form
52+
53+
## Testing Status
54+
55+
- ✅ Admin route requires authentication (working)
56+
- ✅ Create entry route exists (`/admin/feed/$id` with `id='new'`)
57+
- ✅ Edit entry route exists (`/admin/feed/$id`)
58+
- ⚠️ Cannot test CRUD operations without authentication
59+
- ⚠️ Sync status component has action import issues
60+
61+
## Next Steps
62+
63+
1. Fix Convex actions export structure
64+
2. Resolve route search param type errors
65+
3. Test with authenticated user:
66+
- Create manual post
67+
- View post in admin list
68+
- Edit post
69+
- Delete post
70+
- Toggle visibility
71+
- Toggle featured
72+

0 commit comments

Comments
 (0)