[codex] Fix frontend review bugs#140
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes several frontend/API integration mismatches across the app, API router, and build tooling to align pagination behavior, Docker build context, subscription icon handling, and Better Auth base URL resolution.
Changes:
- Adjust filtered-articles pagination to apply cursor/offset after subscription filtering.
- Include
packages/apiandpackages/tricordersources in the app Docker build stage to satisfy workspace/type-check dependencies. - Align subscription creation to use camelCase
iconUrlfrom feed preview and improve Better Auth base URL resolution for relativeVITE_API_URL.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/app/src/routes/app/subscriptions.tsx | Uses feedPreview.data.iconUrl (camelCase) and always sends iconType: "auto" during subscription creation. |
| packages/app/src/lib/auth-client.ts | Adds resolveAuthBaseURL to derive Better Auth baseURL from absolute or relative VITE_API_URL values. |
| packages/app/Dockerfile | Copies API + tricorder sources into the builder stage so the app workspace build/type-check has required sources available. |
| packages/api/src/routers/articles.ts | Changes filtered-path pagination to apply cursor/offset after filtering and updates hasMore/total derivation accordingly. |
Comments suppressed due to low confidence (2)
packages/api/src/routers/articles.ts:455
hasMoreis derived fromvisibleResults.length > limit, butvisibleResultsis limited by the singlefetchLimitquery. If subscription filters are highly selective, you can end up withvisibleResults.length <= limiteven when additional matching articles exist beyondfetchLimit, causing infinite scroll to stop early. To makehasMorereliable, consider looping additional DB fetches (in fixed-size chunks) until you either havefilteredOffset + limit + 1filtered items or you exhaust the underlying query.
const visibleResults = cleanedResults.slice(filteredOffset);
// Check if we have more than requested (for hasMore)
hasMore = visibleResults.length > limit;
// Return only the requested number of items
paginatedResults = visibleResults.slice(0, limit);
packages/api/src/routers/articles.ts:357
- This change alters cursor/offset semantics when subscription filters are enabled (cursor is now applied after filtering). There don’t appear to be tests covering cursor-based pagination in the filtered path (e.g., fetching page 1, then
cursor=limit, ensuring no skipped/duplicated items). Adding a dedicated test would help prevent regressions for the specific bug fixed here.
// FILTERED PATH: Has subscription filters, must fetch more and filter.
// The cursor sent by the frontend represents the number of already
// rendered articles, so apply it after filtering instead of as a raw
// database offset.
const filteredOffset = cursor ?? offset;
const fetchLimit = Math.max((filteredOffset + limit + 1) * 3, 100);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
pnpm --filter @tuvixrss/app type-checkpnpm --filter @tuvixrss/app lint(passes with existing warnings indata-table.tsxandtrpc-provider.tsx)pnpm --filter @tuvixrss/app exec vitest run src/components/app/article-item.test.tsxNotes
pnpm --filter @tuvixrss/app test -- src/components/app/article-item.test.tsxinvocation unexpectedly ran the whole app suite and hit existingdebug-sentryroute test failures where the rendered body is empty. The direct targeted Vitest run above passed.