Redesign Image Source editor: hero preview + link-or-URL empty state#669
Merged
Conversation
The edit UI drops the header + File/URL tabs + large dashed dropzone in favor of one surface with two moves: - Empty: a two-panel invitation — "Add an image" (accent icon tile + the standard linksTo Link Image button) | or | "Add image URL" (compact input with an Add suffix). Stacks to one column in narrow hosts via container query. - With an image: a hero preview (object-fit: contain with minor padding) and a bordered ✕ remove that returns to the empty state. - Picking a file switches sourceMode to file (deferred to a microtask — render-time mutations are dropped); adding a URL sets sourceMode to url. - All mutating handlers no-op when the contained field value is undefined (an unset contains() renders the editor with no model). Styling now resolves through three scopes: the --img-source-* family knob (shared with the Multi Image Source editor, so one override re-skins both) → semantic theme tokens → boxel/literal fallbacks, with resolved values in --img-* aliases. Accent deliberately skips the app-global --primary, and --ring/--boxel-highlight are re-pointed locally so the input focus ring matches the accent. Tests rewritten from tab assertions to empty-state / hero / add-by-url / remove behaviors. Data model is unchanged (url, file, sourceMode, resolvedUrl). linear: https://linear.app/cardstack/issue/ECO-526/image-source-field-editor-ui-enhancement-hero-link-or-url-redesign
Staging Submissions PreviewThis PR's content is pushed to the staging submissions realm: https://realms-staging.stack.cards/submissions/ Changed folders:
Updated at 2026-07-23 06:40:27 UTC for commit |
…est selector
- The hero letterbox surface derives from the themed bg/text pair via
color-mix instead of raw --boxel-100, so dark-themed hosts stay dark.
- adoptPickedFile's deferred mutation bails once the component is
destroyed, and its comment now states the write-on-open self-heal for
instances persisted as { file: set, sourceMode: 'url' }.
- The add-by-url test fills the input inside its own labeled group
instead of "the only input in the editor".
lucaslyl
force-pushed
the
eco-526-image-source-editor-ui-enhancement
branch
from
July 23, 2026 06:27
bebe83b to
4d5966a
Compare
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.
linear: https://linear.app/cardstack/issue/ECO-526/image-source-field-editor-ui-enhancement-hero-link-or-url-redesign
Summary
Redesigns the shared
fields/image-sourceedit UI and brings its styling into the catalog theming system. The data model is unchanged (url,file,sourceMode,resolvedUrl), so existing instances are unaffected.Edit UI (replaces header + File/URL tabs + large dashed dropzone)
object-fit: containwith minor padding) and a bordered ✕ remove button; removing clears both source references (the linked ImageDef itself is untouched) and returns to the empty state.sourceModetofile(deferred to a microtask — render-time mutations are dropped by the renderer); adding a URL setssourceModetourl.contains()renders the editor with no model).Theming
Every visual value resolves through three scopes: the
--img-source-*family knob (shared with the upcoming Multi Image Source editor, so one override re-skins both) → semantic theme tokens (--card,--card-foreground,--border,--muted-foreground,--destructive,--font-sans) → boxel/literal fallbacks; resolved values live in--img-*aliases. The accent deliberately skips the app-global--primary(the boxel highlight green would otherwise take over every control) and--ring/--boxel-highlightare re-pointed locally so the input focus ring matches the accent.Tests
image-source.test.gtsrewritten from tab-based assertions to empty-state / hero / add-by-url / remove behaviors.Testing
ember-template-lint+ prettier cleanNote for deploy
This field is imported by many listings; expect a large catalog-realm reindex fan-out when this lands.