Use @gryt/core instead of this app's copy - #373
Merged
Conversation
612 lines out. The report payload, the link preview provider table, the card layout rule and the failure wording all had a twin in the mobile app, and the package is now the one implementation of each. Two things stay here, and both are the same reason: they need a platform, and the package compiles without one. embedProviderIcons.ts keeps the artwork. A logo is a React component here and an SVG path or a favicon on the phone, so the package owns the hostnames, the colours and the path rules, and each app maps a provider id to its own icon. check-embed-icons.mjs replaces check-embed-cards.mjs and watches that seam: it fails when the package knows a site this app cannot draw, and when this app draws one the package has dropped. The rules the old script tested are tested in the package now, once rather than twice. embedUtils.ts keeps what is only true of a desktop: which sites get a real player rather than a card, and the dismissal and cache state a session holds. It re-exports the moved names so the move costs one import line here rather than a rename across six files. lib/reports/diagnostics.ts stays too. It is what this app can find out about itself — Electron version, Chrome build, the embedded server — and the package holds the shape those fill in. MESSAGE_MAX is 8000 here and was already. The phone had 4000 and moves to 8000 with this, which is the one behaviour change in the pair. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
612 lines out, and the first half of making the two apps 1:1. The mobile side is
the same change against the same package.
What moved
The report payload, the link preview provider table, the card layout rule and
the failure wording. Every one had a twin in the phone app, and
@gryt/core@0.1.0is now the singleimplementation.
What stayed, and why
Both for the same reason — they need a platform, and the package compiles
without one.
embedProviderIcons.tskeeps the artwork. A logo is a React component hereand an SVG path or a favicon on the phone. The package owns hostnames, colours
and path rules; each app maps a provider
idto its own icon.embedUtils.tskeeps what's only true of a desktop: which sites get a realplayer rather than a card, and the dismissal and cache state a session holds. It
re-exports the moved names, so this cost one import line rather than a rename
across six files.
lib/reports/diagnostics.tsstays. It's what this app can find out aboutitself — Electron version, Chrome build, the embedded server — and the package
holds the shape those fill in.
Worth a look
check-embed-icons.mjsreplacescheck-embed-cards.mjs. The old one testedlayout rules and hostname matching, which are now tested in the package, once
instead of twice. The new one watches the seam the package can't: it fails when
@gryt/coreknows a site this app can't draw, and when this app draws one thepackage has dropped. Currently 73 providers, all drawn.
One behaviour change, and it lands on the phone rather than here.
MESSAGE_MAXwas already 8000 in this app. Mobile had 4000, and the packagetook 8000 — so bug report text gets more generous on the phone, not less
anywhere.
The re-export needed an import next to it.
export { type LinkPreviewData } from "@gryt/core"doesn't put the name in the module's scope, andpreviewCachebelow it is typed with it. That's the one thing typecheck caught, and it would
have been a runtime-clean silent
anyif the file weren't strict.Checks
tsc -bclean for every changed file, lint clean,yarn test:embed-iconspasses. I verified all of this against a packed tarball of the exact artifact
before it was published, then again against the real thing from the registry.