Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow field def containedExamples to render #2178

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tintinthong
Copy link
Contributor

@tintinthong tintinthong commented Feb 20, 2025

This PR builds on on #2189 and #2105.

Previously, Specs could not render fields

Screenshot 2025-02-25 at 11 02 49

Now, Specs render fields based upon the code ref it contains

Screenshot 2025-02-24 at 18 23 06

Further Note

Here, Specs are 1 to 1 with code refs so it doesn't really need a "different" subclass rendering of the field when showing containedExamples. However, if we want to include the UI affordance for selecting a template for field that is of a particular type, we can easily do so by dynamically specifying the typeConstraint (but this might not be the concern of Spec).

I saw some rendering thing with the ColorField. I'll look into it independently

@tintinthong tintinthong changed the title remove outer cache in proxy. Update inner cache for box component to … Improve caching so field def re-renders Feb 20, 2025
@tintinthong tintinthong marked this pull request as draft February 20, 2025 17:49
Copy link

github-actions bot commented Feb 20, 2025

Host Test Results

    1 files  ±0      1 suites  ±0   25m 16s ⏱️ +14s
801 tests +3  799 ✔️ +3  2 💤 ±0  0 ±0 
806 runs  +3  804 ✔️ +3  2 💤 ±0  0 ±0 

Results for commit 11b19f1. ± Comparison against base commit 160dab0.

♻️ This comment has been updated with latest results.

@tintinthong tintinthong force-pushed the cs-7929-render-contained-example-in-spec branch from 3180076 to 0cf9e05 Compare February 24, 2025 01:31
@tintinthong tintinthong changed the title Improve caching so field def re-renders Allow field def containedExamples to render Feb 24, 2025
@tintinthong tintinthong changed the base branch from main to fix-component-cache-for-field February 24, 2025 01:32
@tintinthong tintinthong force-pushed the cs-7929-render-contained-example-in-spec branch from 0cf9e05 to 923e1a8 Compare February 24, 2025 09:52
@tintinthong tintinthong marked this pull request as ready for review February 24, 2025 10:24
@tintinthong tintinthong requested a review from a team February 24, 2025 10:44
@tintinthong
Copy link
Contributor Author

tintinthong commented Feb 25, 2025

Screenshot 2025-02-25 at 10 55 02

Currently, some issues with some fields. Color is another one

@tintinthong
Copy link
Contributor Author

Pause review here. There is some bug on primitive handling which requires more card-api tweaks

@tintinthong tintinthong marked this pull request as draft February 25, 2025 03:54
@tintinthong tintinthong removed the request for review from a team February 25, 2025 10:20
@tintinthong
Copy link
Contributor Author

Pause review here. There is some bug on primitive handling which requires more card-api tweaks

The bug in here is when serializing (im not sure in deserializing) URL extends StringField.

URL is a primitive so it doesn't serialize meta.fields. That means it doesn't have the ability to render a different template.

@tintinthong
Copy link
Contributor Author

I have updated #2189. And will continue work once that is merged

@tintinthong tintinthong changed the base branch from fix-component-cache-for-field to main March 6, 2025 06:42
@tintinthong tintinthong force-pushed the cs-7929-render-contained-example-in-spec branch from 6c9092a to 1c6ae6a Compare March 10, 2025 16:49
@tintinthong
Copy link
Contributor Author

After some consideration,

I think handling of primitive for polymorphism should be out-of-scope of this PR.

It is quite involve to get this to work and might invite some workaround patterns. So it would be good to check-in with Ed in how to appraoch this

@tintinthong tintinthong requested a review from a team March 10, 2025 18:06
@tintinthong tintinthong marked this pull request as ready for review March 10, 2025 18:06
@tintinthong tintinthong requested a review from burieberry March 10, 2025 18:09
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