Maintenance: replace dead Breaking Bad API with TVmaze, fix error handling & a11y - #1
Merged
Merged
Conversation
breakingbadapi.com no longer resolves (DNS lookup fails), so the page was stuck on 'Loading...' forever with an unhandled fetch rejection. Load the Breaking Bad cast (show 169) from TVmaze, which is free, keyless and CORS-enabled, and filter it locally by character or actor name. TVmaze doesn't provide nickname/status/occupation, so cards show character, actor and actor's birthday. This also fixes the Name/Actor labels, which were swapped. Cards are built with textContent instead of interpolating API data into innerHTML.
Network or HTTP errors previously left the loading spinner on screen indefinitely.
Search previously only ran on the 'change' event (blur/Enter) and a query with no matches rendered a blank area. Since filtering is now local, update on 'input' and tell the user when nothing matches.
… music Browsers reject audio.play() without a user gesture, which produced an unhandled promise rejection and meant the music never played. When autoplay was allowed there was no way to stop it (WCAG 1.4.2 Audio Control). Catch the rejection and add a toggle button with aria-pressed state.
…ter details The logo had no alt text and the search box relied on its placeholder only. Character details were revealed on :hover alone, so keyboard and touch users couldn't reach them; cards are now focusable and show details on :focus. The decorative loader image gets an empty alt.
The TVmaze API license (CC BY-SA) requires crediting TVmaze with a link back from the site.
…ata loads Typing into the search box before the cast arrived (or after it failed to load) replaced the spinner/error with a misleading 'No characters found.'
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Address the three unresolved moderate issues in audio state synchronization, live-region announcements, and card overlay positioning.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Migrates the app from the unavailable Breaking Bad API to TVmaze and improves reliability, accessibility, search, and audio controls.
Changes:
- Replaced the dead API with TVmaze cast data and local filtering.
- Added error/no-results states and safe DOM rendering.
- Improved audio controls, keyboard accessibility, metadata, attribution, and documentation.
| File | Reviewed changes | Final findings |
|---|---|---|
style.css |
Focus-based card detail display | Moderate: position card overlays relative to their cards (1 vote). |
README.md |
Updated data source, setup, and features | No final comments. |
main.js |
Fetching, filtering, rendering, error handling, and audio controls | Moderate: synchronize the toggle when audio ends (2 votes); expose status messages as a live region (2 votes). |
index.html |
Metadata, accessible controls, and TVmaze attribution | No final comments. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch was successfully deployed
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.

The app is completely broken in production:
breakingbadapi.comno longer exists (DNS lookup fails), so the page shows "Loading..." forever and throws an unhandled rejection. This PR moves the app to the TVmaze API and fixes several robustness and accessibility issues.Changes
https://api.tvmaze.com/shows/169/cast), which is free, needs no key and allows CORS, then filter it locally by character or actor name.textContentinstead of interpolating API data intoinnerHTML, which removes an injection path.audio.play()on load is blocked by browsers without a user gesture, which caused an unhandled rejection. When autoplay was allowed, there was no way to stop the music (WCAG 1.4.2). The rejection is now caught, and a Play/Pause button witharia-pressedwas added.<label>for the search box, an empty alt on the decorative loader, and focusable cards that reveal their details on:focus(before, details appeared only on hover, so keyboard and touch users couldn't see them).Verification (static only, no browser)
node --check main.jspasses.index.htmlparses with balanced tags, and every local asset it references (in HTML, JS and CSS) exists.breakingbadapi.comfails withCould not resolve host.api.tvmaze.com/shows/169/castreturns 200 with 11 cast entries andaccess-control-allow-origin: *. The Bootstrap CDN URL returns 200.main.jsagainstindex.htmlin jsdom with the real TVmaze API and a stubbedAudio:master, the same harness stays on "Loading..." with unhandledfetch failedandNotAllowedErrorrejections.package.json, so there are no install, build or lint scripts to run.For the owner to decide
https://breakingbadapp.vercel.app/. The live site still serves the old code that calls the dead API.breaking-bad-api-six.vercel.app, which responds and has the old fields (nickname, occupations). I chose TVmaze because it is an established, documented service. If you would rather keep the richer fields, you could switch.