Skip to content

Remove Link Previews#340

Merged
n-ce merged 17 commits into
mainfrom
n-ce-patch-1
Sep 5, 2025
Merged

Remove Link Previews#340
n-ce merged 17 commits into
mainfrom
n-ce-patch-1

Conversation

@n-ce
Copy link
Copy Markdown
Owner

@n-ce n-ce commented Sep 5, 2025

Summary by CodeRabbit

  • Chores

    • Removed the edge-based link preview enhancement for YouTube links; previews revert to the standard display.
  • Bug Fixes / Improvements

    • Fixed collection toggling so only the active collection shows as selected (prevents multiple collections appearing active).
  • Style

    • Favorites and Listen Later views now consistently show list items and hide collection action buttons for a cleaner UI.

Mickael81 and others added 13 commits June 12, 2025 21:01
Currently translated at 100.0% (173 of 173 strings)

Translation: ytify/web
Translate-URL: https://hosted.weblate.org/projects/ytify/web/fr/
Currently translated at 39.3% (68 of 173 strings)

Translation: ytify/web
Translate-URL: https://hosted.weblate.org/projects/ytify/web/tr/
Currently translated at 39.3% (68 of 173 strings)

Translation: ytify/web
Translate-URL: https://hosted.weblate.org/projects/ytify/web/tr/
Currently translated at 100.0% (173 of 173 strings)

Translation: ytify/web
Translate-URL: https://hosted.weblate.org/projects/ytify/web/ru/
Currently translated at 100.0% (174 of 174 strings)

Translation: ytify/web
Translate-URL: https://hosted.weblate.org/projects/ytify/web/ja/
Currently translated at 100.0% (174 of 174 strings)

Translation: ytify/web
Translate-URL: https://hosted.weblate.org/projects/ytify/web/fr/
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 5, 2025

Warning

Rate limit exceeded

@n-ce has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 44 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between f1895e7 and df4143f.

📒 Files selected for processing (2)
  • src/lib/libraryUtils.ts (1 hunks)
  • src/locales/fr.json (1 hunks)

Walkthrough

Removed the Netlify Edge Function netlify/edge-functions/linkPreview.ts and updated UI logic and stylesheet selectors for collection toggles (src/lib/libraryUtils.ts, src/stylesheets/list.css).

Changes

Cohort / File(s) Summary
Edge Function removal
netlify/edge-functions/linkPreview.ts
Deleted file. Removed default request handler, exported config, fetcher, and shuffle related to YouTube link preview augmentation and RapidAPI key rotation.
Library UI toggle logic
src/lib/libraryUtils.ts
Generalized CSS-class toggling in fetchCollection by adding an exceptions(idx) helper and applying it for both favorites and listenLater so only the active id keeps the class while others are removed. No public API changes.
Stylesheet selector tweak
src/stylesheets/list.css
Updated selector from &.favorites to &.favorites, &.listenLater to apply the same inner rules for both classes; added trailing newline at EOF.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant N as Netlify Edge
  participant S as Site/App

  rect rgba(200,220,255,0.25)
  note over N: Old flow (before)
  U->>N: HTTP Request
  N->>N: linkPreview Edge Function executes
  N->>S: Forward (context.next)
  S-->>N: Response
  N->>N: Augment response (fetch YouTube data)
  N-->>U: Modified HTML
  end

  rect rgba(220,200,200,0.25)
  note over N: New flow (after)
  U->>N: HTTP Request
  N->>S: Direct forward (no linkPreview)
  S-->>N: Response
  N-->>U: Unmodified response
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Maintainence Update #325 — Also touches netlify/edge-functions/linkPreview.ts (changes how API keys are read), directly related to the deleted edge function.

Poem

A rabbit peeked at code and grinned,
Trimmed a function where previews had been.
Tweaked a toggle, fixed a class—so neat,
A newline bounced beneath my feet.
Hop-hop, clean repo, carrot treat! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch n-ce-patch-1

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@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: 0

🧹 Nitpick comments (2)
src/stylesheets/list.css (1)

62-77: Consider dropping unnecessary !important flags in this block.

Because this block appears after .reserved and has equal specificity, cascade should win without !important. This reduces specificity wars.

Apply if manual QA confirms no regressions:

 li {
-  display: block !important;
+  display: block;
 }

 #deleteCollectionBtn,
 #renameCollectionBtn,
 #radioCollectionBtn,
 #importListBtn,
 #subscribeListBtn,
 #viewOnYTBtn {
-  display: none !important;
+  display: none;
 }
src/lib/libraryUtils.ts (1)

133-143: Simplify class toggling with classList.toggle to avoid custom helper.

Current helper works but is verbose. Toggle both flags in-place for clarity and fewer DOM reads.

Apply this diff:

-function exceptions(idx: string) {
-  if (listBtnsContainer.classList.contains(idx)) {
-    if (id !== idx)
-      listBtnsContainer.classList.remove(idx);
-  }
-  else if (id === idx)
-    listBtnsContainer.classList.add(idx);
-}
-exceptions('favorites');
-exceptions('listenLater');
+['favorites', 'listenLater'].forEach(cls => {
+  listBtnsContainer.classList.toggle(cls, id === cls);
+});
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9bb70ff and f1895e7.

📒 Files selected for processing (2)
  • src/lib/libraryUtils.ts (1 hunks)
  • src/stylesheets/list.css (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/lib/libraryUtils.ts (1)
src/lib/dom.ts (1)
  • listBtnsContainer (35-35)
🔇 Additional comments (3)
src/stylesheets/list.css (2)

62-63: Extending reserved-style to listenLater is correct and consistent with TS changes.

Selector now covers both .favorites and .listenLater, matching the new class toggling in fetchCollection.


120-120: Trailing newline added—good.

Keeps POSIX tooling happy and avoids spurious diffs later.

src/lib/libraryUtils.ts (1)

133-143: No dangling references to removed Netlify Edge Function
Ran repository-wide searches for linkPreview imports, /edge-functions/ routes, and Netlify config in .toml files—found no matches. Edge function removal appears clean.

@n-ce n-ce merged commit 64e68ed into main Sep 5, 2025
2 checks passed
@n-ce n-ce deleted the n-ce-patch-1 branch September 5, 2025 07:26
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.

6 participants