Add AI stock rankings page with subscription gating - #80
Conversation
Introduce /ai-rankings with short, medium, and long horizon tabs. Each ranked stock includes AI rationale validated against live market data. Reuse existing AI tier checks, SubscriptionGate, and local Ollama patterns. Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
|
🚀 Vercel Preview Deployment Ready! Preview: https://stock-7jkhjopv7-ditectrevs-projects.vercel.app This comment was automatically generated by GitHub Actions |
Move page and API paths, add MAIN_NAV entry, redirect /ai-rankings, and update user-facing copy and titles to Ranking. Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
|
🚀 Vercel Preview Deployment Ready! Preview: https://stock-k5htib58r-ditectrevs-projects.vercel.app This comment was automatically generated by GitHub Actions |
Show rank, symbol, name, and why in a readable table with horizontal scroll on narrow viewports. Keeps timeframe tabs and subscription gating. Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
|
🚀 Vercel Preview Deployment Ready! Preview: https://stock-r70uj4mss-ditectrevs-projects.vercel.app This comment was automatically generated by GitHub Actions |
Keep MAIN_NAV to Home, News, Ranking, and Pricing. Move Sectors, Calendars, Heatmaps, and Screener to a footer Tools section. Add Resources legal placeholders, Ditectrev contact details, social links, and dynamic copyright. Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
|
🚀 Vercel Preview Deployment Ready! Preview: https://stock-qcqbem5bj-ditectrevs-projects.vercel.app This comment was automatically generated by GitHub Actions |
- Bring back react-github-btn star widget above footer content - Replace social text links with SVG icons (aria-label preserved) - Uppercase TOOLS/RESOURCES headings; keep link labels title case - Center-align the tools heading and link column Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
|
🚀 Vercel Preview Deployment Ready! Preview: https://stock-hvi8ykroq-ditectrevs-projects.vercel.app This comment was automatically generated by GitHub Actions |
- Raise contrast on ranking tabs, meta lines, table text, and footer - Split ranking into buy and sell candidate lists with separate scoring - Show side-by-side tables with stock-of-the-day accent styling - Update AI prompt, API, and types for buyCandidates/sellCandidates Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
|
🚀 Vercel Preview Deployment Ready! Preview: https://stock-fb8hzknqw-ditectrevs-projects.vercel.app This comment was automatically generated by GitHub Actions |
- Code-split Footer and render it via LazySection below the fold - Load GitHub star widget only when its slot enters the viewport - Move footer top margin to the LazySection wrapper - Ignore local Lighthouse CI artifacts Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
|
🚀 Vercel Preview Deployment Ready! Preview: https://stock-jmiifyui5-ditectrevs-projects.vercel.app This comment was automatically generated by GitHub Actions |
- Reuse HeatmapNavigation categories: etf, crypto, stock - Category-aware AI prompts, parsing, API, and enrichment - Heatmap-style category switcher on /ranking with per-category fetch Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
|
🚀 Vercel Preview Deployment Ready! Preview: https://stock-adw7pt6c8-ditectrevs-projects.vercel.app This comment was automatically generated by GitHub Actions |
Route category through enrichRankingCandidates, quote ETFs/crypto via Yahoo instead of Finnhub stock paths, and tolerate missing forecast/ indicator data like AI predictions. Use category-aware insufficient- candidate error messages. Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
|
🚀 Vercel Preview Deployment Ready! Preview: https://stock-izpb4tbcx-ditectrevs-projects.vercel.app This comment was automatically generated by GitHub Actions |
Use marketDataService (Finnhub + Yahoo fallback) for all ranking categories instead of Yahoo-only quotes for ETF/crypto, which failed on preview while stocks used Finnhub. Add quote fallbacks and relax crypto symbol parsing. Pass ranking validation errors through the API error helper and add route integration tests for GET/POST ranking. Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
Next.js type-checks vitest.config.ts during build; environmentMatchGlobs is not in this Vitest InlineConfig type. Node ranking integration tests still use per-file @vitest-environment node and the guarded setup file. Co-authored-by: ✅ Daniel Danielecki <danieldanielecki@users.noreply.github.com>
|
🚀 Vercel Preview Deployment Ready! Preview: https://stock-qruzayxwi-ditectrevs-projects.vercel.app This comment was automatically generated by GitHub Actions |
- Fix sell rankings inverting timeframe scores by applying direction multiplier to timeframe-specific adjustments (momentum, sentiment, runway, target upside) - Fix stale ranking fetches overwriting newer results by adding cancellation flag to useEffect
Mistral code reviewCorrectness
Edge Cases
Security
Performance
Maintainability
Overall, the changes look good and address the requirements. Ensure that all edge cases are covered and the code is well-documented for maintainability. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Loading spinner stuck after access loss
- Added setLoading(false) before the early return when hasAIAccess is false to properly clear the loading state when access is lost during an in-flight request.
You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 5f82ac1. Configure here.
|
🚀 Vercel Preview Deployment Ready! Preview: https://stock-avycs2wkh-ditectrevs-projects.vercel.app This comment was automatically generated by GitHub Actions |
Clear loading state when hasAIAccess becomes false to prevent the spinner from getting stuck when access is lost during an in-flight ranking request.
|
🚀 Vercel Preview Deployment Ready! Preview: https://stock-46tiyt0y9-ditectrevs-projects.vercel.app This comment was automatically generated by GitHub Actions |

Follow-up: ETF / Crypto ranking still failing after 1862f8f
Root cause (remaining filter): Commit
1862f8frouted ETF and crypto enrichment throughyahooFinanceService.getSymbolQuoteonly, while stocks still usedmarketDataService.getSymbolData(Finnhub when configured, then Yahoo). On preview/production withFINNHUB_API_KEY, stock rankings could enrich successfully; ETF/crypto candidates were dropped when Yahoo quote failed, falling below the minimum of 4 buy/sell rows and surfacing the insufficient-candidates error.Fix (
516db53):marketDataService.getSymbolData→ Yahoo → synthetic fallback quote (same resilience pattern as AI prediction snapshots).UNI7083-USD).AI did not return…/AI returned an incomplete…) pass throughuserFacingApiError.API proof (vitest route integration — real handlers, live enrichment):
GET ?category=etf→ 200, buy=5, sell=5GET ?category=crypto→ 200, buy=5, sell=5POSTlocal-Ollama validation path for etf, crypto, stock → 200, buy/sell ≥ 4 each