jkomoros / card-web

The web app behind thecompendium.cards
Apache License 2.0
46 stars 8 forks source link

Have a default collection for each card #680

Open jkomoros opened 7 months ago

jkomoros commented 7 months ago

When you navigate to that card, if it doesn't exist in the current collection, it should load it in the default collection for its card type.

Noticed while working on #202 and #465.

If you navigate to the default working-notes collection, then you'll see all working notes cards. But if you're looking a a content card and then click a link to a working-notes card, it will navigate to that card not in the the /c/everything/working-notes/ collection (or the default collection in the tabstrip) but just the naked card, rendering the card on its own.

The logic should be: 1) If the card is in a section, return the card in that section. 2) If the card is orphaned, then the default collection should be /c/everything/card-type/ (and allow different card types to override this, I guess).

This logic is mixed up between canonicalizeURL, navigateToCardInDefaultCollection, etc.