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

Enhance catalog entry and code mode RHS panel to be able to create new catalog entry #1993

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b8cdbe7
update catalog entry card
tintinthong Jan 14, 2025
de4baaa
add boxel spec component
tintinthong Jan 14, 2025
f488ac9
fix re-exports not being detected by the schema editor
tintinthong Jan 14, 2025
1a24148
integrate boxxel spec in code submode
tintinthong Jan 14, 2025
47b8e08
get select disabled to not display down arrow
tintinthong Jan 14, 2025
30732e5
sort catalog entry by latest created
tintinthong Jan 14, 2025
4d5451b
enable boxel spec instance to be created via create-file-modal
tintinthong Jan 14, 2025
651302e
fix test
tintinthong Jan 14, 2025
63222a9
Update everything to new schema
tintinthong Jan 14, 2025
997799a
fix lint
tintinthong Jan 14, 2025
6b26bef
fix seed instances
tintinthong Jan 14, 2025
ac05498
fix instances in base
tintinthong Jan 14, 2025
dc40e25
filer by type attribute
tintinthong Jan 14, 2025
a6dcabf
fix all test that query by isField
tintinthong Jan 14, 2025
d9978cd
Revert "fix re-exports not being detected by the schema editor"
tintinthong Jan 14, 2025
80a7386
fix test that use title. Change to name
tintinthong Jan 14, 2025
e8ac5db
fix test
tintinthong Jan 14, 2025
35d479f
fix more test
tintinthong Jan 14, 2025
b21fbb4
fix test to use isField to signal field or card
tintinthong Jan 14, 2025
0baf052
fix lint
tintinthong Jan 14, 2025
1ec41ea
readd show boxel spec preview
tintinthong Jan 14, 2025
5102958
add test
tintinthong Jan 14, 2025
adab3db
add snapshot
tintinthong Jan 14, 2025
99c4674
use README title in all caps
tintinthong Jan 14, 2025
d3244be
string boxel spec thru creation file args to impute specType
tintinthong Jan 15, 2025
d4a6244
fix default
tintinthong Jan 15, 2025
6a2b2aa
add test boxel spec
tintinthong Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/base/cards-grid.gts
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,19 @@ class Isolated extends Component<typeof CardsGrid> {
on: catalogEntryRef,
eq: { ref: activeFilterRef },
},
sort: [
{
by: 'createdAt',
direction: 'desc',
},
],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Focus on the last newly created catalog entry, if there are more than one

};
}
let card = await chooseCard<CatalogEntry>(
{
filter: {
on: catalogEntryRef,
every: [{ eq: { isField: false } }],
every: [{ eq: { type: 'card' } }],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to be clearer about what we are filtering for. But I aslo found that when isField was turned into a computed, it cudn query and I filed https://linear.app/cardstack/issue/CS-7821/filtering-by-computed-doesnt-work-at-the-first-level

Copy link
Contributor

@habdelra habdelra Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just double checking, we don’t allow you to filter by fields that are not in the template. Is this field used the template. (Like is it part of the embedded field if this is a linked card)? If not is it set to is used? I’m positive we have passing tests that exercise the ability to filter by computeds

Copy link
Contributor Author

@tintinthong tintinthong Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm. Oh its another one of those. Thanks for pointing out.

isField was not used inside any of the template

I confirm within the test that that computed WORKS when the computed field exist within the isolated template. So, the behaviour is as you point out. Although I would add that it won't work if the computed field only exist within embedded or fitted (not sure if its something we want to consider) but not the isolated template

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the rationale for the behavior is the "social graph problem". Imagine a boxel app that is a social graph like facebook. each person card has a linkToMany relationship to all their friends, which are also person cards. If we have no limits on what feields are included in the search doc, we will likely end up including all the people in the world in each search doc. the template is a natural way to draw boundaries on the search doc. we do have an escape valve isUsed which can allow a field to be in the search doc even though its not in a template (and this could get abused to create the problem that I just raised).

Copy link
Contributor Author

@tintinthong tintinthong Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation.

This is an aside. Shud not affect aspects of this PR. Since I filter by a field type, not isField anymore.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about you call this attribute specType instead of type? It is confusing because there's a real type: "card". I think isField is helpful so we can distinguish between field defs and card defs. specType can then be freely used for the visual design reasons you need it for.

},
},
{ preselectedCardTypeQuery },
Expand Down
Loading
Loading