Skip to content

Use @gryt/core instead of this app's copy - #373

Merged
sivert-io merged 1 commit into
mainfrom
claude/use-gryt-core
Sep 3, 2026
Merged

Use @gryt/core instead of this app's copy#373
sivert-io merged 1 commit into
mainfrom
claude/use-gryt-core

Conversation

@sivert-io

Copy link
Copy Markdown
Member

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.0 is now the single
implementation.

What stayed, and why

Both for 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. The package owns hostnames, colours
and path rules; each app maps a provider id to its own icon.

embedUtils.ts keeps what's 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 this cost one import line rather than a rename
across six files.

lib/reports/diagnostics.ts stays. It's what this app can find out about
itself — Electron version, Chrome build, the embedded server — and the package
holds the shape those fill in.

Worth a look

check-embed-icons.mjs replaces check-embed-cards.mjs. The old one tested
layout 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/core knows a site this app can't draw, and when this app draws one the
package has dropped. Currently 73 providers, all drawn.

One behaviour change, and it lands on the phone rather than here.
MESSAGE_MAX was already 8000 in this app. Mobile had 4000, and the package
took 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, and previewCache
below it is typed with it. That's the one thing typecheck caught, and it would
have been a runtime-clean silent any if the file weren't strict.

Checks

tsc -b clean for every changed file, lint clean, yarn test:embed-icons
passes. 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.

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>
@sivert-io
sivert-io merged commit fe32845 into main Sep 3, 2026
3 checks passed
@sivert-io
sivert-io deleted the claude/use-gryt-core branch September 3, 2026 21:30
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.

1 participant