Skip to content

Collections#11

Closed
argyleink wants to merge 33 commits intomainfrom
collections
Closed

Collections#11
argyleink wants to merge 33 commits intomainfrom
collections

Conversation

@argyleink
Copy link
Copy Markdown
Collaborator

@argyleink argyleink commented Jan 19, 2026

Screenshot 2026-01-19 at 11 54 25 AM Screenshot 2026-01-19 at 11 54 41 AM Screenshot 2026-01-19 at 11 54 46 AM

Summary by CodeRabbit

  • New Features

    • Collections: browse curated topic groups (AI/ML, TypeScript, CSS, Testing, Accessibility) with index and per-collection pages, episode lists, previews, metadata, pagination, and transcript-driven membership.
    • Added a transcript analysis tool to detect topical relevance and build/update collections.
    • New navigation link to access Collections.
  • Style

    • Improved grid sizing for collections in browsers that support subgrid.
  • Bug Fixes

    • Fixed .DS_Store ignore rule.
  • Chores

    • Added a new dependency for development tooling.

✏️ Tip: You can customize this high-level summary in your review settings.

RobbieTheWagner and others added 26 commits September 30, 2025 08:55
* ✨ Add Polar package and checkout flow

* 🔥 Remove slack webhook example

* ♻️ Fix conflict in package file

* ♻️ Update to have build time deps in devdependencies

* ♻️ Update lock file
* updates sponsorship page with latest packages and statistics

* restore things lost in the paste

* fix broke ass countup

* pacify linter

* dynamic year

* animation and intrigue

* cruft

* Apply suggestions from code review

Co-authored-by: Robbie Wagner <rwwagner90@gmail.com>

* adds text balance to the headline

* fix code rabbit nit

* restore product IDs to ad reads

* hookup new products

* fix readme

* updates alignment, adds link to contact page, adds param to sponsor for frequency

---------

Co-authored-by: Robbie Wagner <rwwagner90@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 19, 2026

📝 Walkthrough

Walkthrough

Adds a Collections feature: static collection data and pages, computed collection logic from transcripts, topic/LLM keyword utilities and an analysis script, a nav link, a small CSS support rule, a package.json dependency update, and a .gitignore correction.

Changes

Cohort / File(s) Summary
Collections Data & Pages
src/data/collections.ts, src/pages/collections/index.astro, src/pages/collections/[slug].astro
New Collection interface and static collections list; collection index and collection detail pages with SEO, structured data, episode filtering/sorting, thumbnail grouping, and prev/next pagination.
Computed Collections Logic
src/lib/collections.ts
New logic to compute/augment collection memberships by loading transcripts, scoring episodes per collection rules/thresholds (including LLM scoring), and returning updated episode lists. Exports getComputedCollections and CollectionRuleConfig.
Topic / LLM Keyword Scoring
src/lib/topic-keywords.ts
New exported keyword lists and scoring helpers: LLM_KEYWORDS, topicKeywords, scoreTopicRelevance, and scoreLLMRelevance.
Transcript Analysis Script
scripts/analyze-transcripts.ts
New CLI script that reads transcript markdowns, tokenizes and filters stopwords, computes word frequencies, scores LLM/topic relevance, and emits candidate collections and ranked episode slugs.
UI Navigation
src/components/InfoCard.astro
Adds a /collections navigation link positioned before the About link.
Styling
src/styles/global.css
Adds an @supports (grid-template-rows: subgrid) block setting grid-auto-rows: minmax(0, auto) for .collections-grid.
Package & Ignore
.gitignore, package.json
.gitignore corrected for macOS .DS_Store entry; package.json gains new dependencies (@polar-sh/astro and zod).

Sequence Diagram(s)

sequenceDiagram
  participant CLI as Analyze CLI
  participant FS as File System (transcripts)
  participant App as App Data (getAllEpisodes)
  participant Scorer as TopicScorer (topic-keywords)
  participant Output as Console / Files

  CLI->>App: load episodes (getAllEpisodes)
  CLI->>FS: read transcript files
  FS-->>CLI: transcript text
  CLI->>Scorer: score transcript (LLM/topics)
  Scorer-->>CLI: relevance scores
  CLI->>CLI: aggregate scores, update collection memberships
  CLI->>Output: log results / emit collection slugs
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰
I nibble transcripts, hop through terms,
I sort the topics, watch slugs confirm.
Cards assemble, thumbnails gleam,
Keywords hum in a searchable dream.
A tiny rabbit cheers — collections bloom. 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Collections' is overly vague and generic. While it refers to the feature being added, it lacks specificity about what collections do or their purpose within the codebase. Consider a more descriptive title such as 'Add Collections feature for topic-based episode grouping' or 'Implement Collections pages with episode organization' to better convey the main change.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@package.json`:
- Line 64: Remove the unused "tsx" devDependency from package.json: locate the
"tsx": "^4.21.0" entry in the dependencies/devDependencies block and delete that
line, then run the project's package manager (npm/yarn/pnpm) to update the
lockfile and node_modules so the dependency is fully removed; verify no scripts
or configs (e.g., vitest.config.ts) rely on the "tsx" package before committing.

In `@scripts/analyze-transcripts.ts`:
- Around line 189-200: The scoreLLMRelevance function builds unescaped RegExp
from LLM_KEYWORDS and matches against lowerText, which causes short tokens (like
"ts") to match unintended substrings; update scoreLLMRelevance to escape each
keyword (e.g., replace special regex chars) and wrap with word boundaries (\\b)
when constructing the RegExp so you only count whole-word matches; apply the
same change to the other similar matching routines referenced (the blocks around
lines 238-249 and 491-500) so all keyword-based scoring uses escaped,
word-boundary regexes.

In `@src/pages/collections/index.astro`:
- Around line 55-61: The map callback for collection.latestEpisodes includes an
unused parameter named index which triggers the linter; update the mapping
expression collection.latestEpisodes.map((episode, index) => ...) to remove the
unused index parameter so it becomes collection.latestEpisodes.map(episode =>
...) (or use _ if you intend to keep it intentionally unused), ensuring the
component render signature for the img uses only episode.
🧹 Nitpick comments (3)
src/pages/collections/index.astro (1)

11-22: Optional: pre-index episodes by slug to avoid repeated scans.
Current approach filters all episodes for each collection (O(collections × episodes)). Pre-indexing can reduce work on larger catalogs.

♻️ Possible refactor (adjust typings as needed)
 // For each collection, get the 4 latest episodes
+const episodesBySlug = new Map(
+  allEpisodes.map((episode) => [episode.episodeSlug, episode])
+);
+
 const collectionsWithEpisodes = collections.map((collection) => {
-  const collectionEpisodes = allEpisodes
-    .filter((episode) => collection.episodeSlugs.includes(episode.episodeSlug))
+  const collectionEpisodes = collection.episodeSlugs
+    .map((slug) => episodesBySlug.get(slug))
+    .filter(
+      (episode): episode is (typeof allEpisodes)[number] => Boolean(episode)
+    )
     .sort((a, b) => b.published - a.published)
     .slice(0, 4); // Get 4 latest episodes
src/pages/collections/[slug].astro (2)

19-22: Prefer a Set for episode slug lookups.

This reduces lookup cost when collections or episode lists grow.

♻️ Suggested refactor
-// Filter episodes that belong to this collection and sort newest-first
-const collectionEpisodes = allEpisodes
-  .filter((episode) => collection.episodeSlugs.includes(episode.episodeSlug))
-  .sort((a, b) => b.published - a.published);
+// Filter episodes that belong to this collection and sort newest-first
+const episodeSlugSet = new Set(collection.episodeSlugs);
+const collectionEpisodes = allEpisodes
+  .filter((episode) => episodeSlugSet.has(episode.episodeSlug))
+  .sort((a, b) => b.published - a.published);

62-115: Optional: add rel="prev" / rel="next" on pagination links.

Helps SEO and navigation semantics.

✨ Optional tweak
-          <a
-            href={`/collections/${prevCollection.slug}`}
+          <a
+            href={`/collections/${prevCollection.slug}`}
+            rel="prev"
             class="group relative grid overflow-hidden rounded-lg bg-light-card dark:bg-dark-card transition-transform hover:scale-[1.02] focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:ring-offset-2 dark:focus:ring-offset-dark-background"
           >
...
-          <a
-            href={`/collections/${nextCollection.slug}`}
+          <a
+            href={`/collections/${nextCollection.slug}`}
+            rel="next"
             class="group relative grid overflow-hidden rounded-lg bg-light-card dark:bg-dark-card transition-transform hover:scale-[1.02] focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:ring-offset-2 dark:focus:ring-offset-dark-background"
           >

Comment thread package.json Outdated
Comment thread scripts/analyze-transcripts.ts Outdated
Comment thread src/pages/collections/index.astro Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/pages/collections/index.astro`:
- Around line 13-42: The current selection loop uses usedImageUrls + getImg
(which can return show.image) and can yield imageGroupEpisodes empty for
collections that do have episodes; modify collections.map so after the existing
loop (which populates unique, seenInGroup and updates usedImageUrls) you detect
if unique.length === 0 && eps.length > 0 and then perform a fallback: pick the
newest episode (eps[0]) and push it into unique and (optionally) add its image
to usedImageUrls, or exempt show.image from being marked in usedImageUrls so
fallback thumbnails aren’t blocked; reference the symbols usedImageUrls, getImg,
eps, unique, seenInGroup, and imageGroupEpisodes when making this change.

Comment thread src/pages/collections/index.astro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants