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

Convert CompendiumBrowser to ApplicationV2 #16884

Merged
merged 7 commits into from
Dec 3, 2024

Conversation

In3luki
Copy link
Collaborator

@In3luki In3luki commented Oct 13, 2024

  • Rewrite browser as a Svelte app
  • Move browser settings to a separate Application
  • Add "Settings" button to browser window controls
  • Move roll table buttons to browser window controls
  • Use gsap for the drag fade animations
  • Fix (or implement?) setting the level filter in the crafting tab of the character sheet
  • Fix up dark mode styling
  • Enable opening the browser with a selection of nagivation tabs (or no navigation at all)
  • Cleaned up translations in en.json

Some filter changes:

  • Removed multiselects and sliders from the filter as they were unused except for the traits and level filters
  • traits and level are now top level filter data.
  • The level filter now renders as two select elements for min and max

Controls:
c-light-settings

Level filter:
browser-levels

Light:
browser-light

Dark:
browser-dark

@CarlosFdez
Copy link
Collaborator

shoulda said something. Shark started experimentation into svelte. Compendium Browser is an amazing chance to try it out.

@In3luki
Copy link
Collaborator Author

In3luki commented Oct 13, 2024

yeah I wanted to wait for svelte support initially but the version 5 release has taken so long that I thought it made sense to convert to the handlebars renderer first. Switching out the renderer later should be relatively straight forward.

@In3luki
Copy link
Collaborator Author

In3luki commented Oct 13, 2024

But if that isn't something you want to do I can keep this in a stash until svelte is ready. It definitely helped me to better understand ApplicationV2 so it wasn't for nothing.

@In3luki In3luki force-pushed the compendium-browser-appv2 branch 2 times, most recently from 20fce2c to 9d9c9eb Compare October 14, 2024 16:08
@In3luki In3luki marked this pull request as draft October 15, 2024 07:59
@In3luki
Copy link
Collaborator Author

In3luki commented Oct 15, 2024

I'll yoink the basic svelte stuff from the other PR and try it out for this. Converted to a draft in the meantime.

@CarlosFdez
Copy link
Collaborator

CarlosFdez commented Oct 15, 2024

As part of a rewrite, I think it would be neat if its possible to separate browsing actors from browsing items when launching from the actors or items tab. At the very least feats shouldn't be viewable from clicking the bestiaries browser imo.

@In3luki In3luki force-pushed the compendium-browser-appv2 branch from 9d9c9eb to cccd223 Compare October 19, 2024 23:16
@In3luki
Copy link
Collaborator Author

In3luki commented Oct 19, 2024

I've pushed the svelte browser and updated the description with new infos and current screenshots. The changed file count just kept rising, sorry. 🙃

@In3luki In3luki force-pushed the compendium-browser-appv2 branch 4 times, most recently from 34b36ff to ee6ef1c Compare October 20, 2024 15:25
@In3luki In3luki marked this pull request as ready for review October 20, 2024 22:30
@In3luki In3luki force-pushed the compendium-browser-appv2 branch 6 times, most recently from c9af5fc to 1245667 Compare October 27, 2024 14:33
@In3luki In3luki force-pushed the compendium-browser-appv2 branch 4 times, most recently from d435b3f to 29b2c15 Compare October 31, 2024 07:53
@In3luki In3luki force-pushed the compendium-browser-appv2 branch from 29b2c15 to 45c3bb4 Compare November 18, 2024 12:27
@In3luki In3luki force-pushed the compendium-browser-appv2 branch from aa8f8aa to 889204c Compare November 23, 2024 08:40
static/lang/en.json Outdated Show resolved Hide resolved
@In3luki In3luki force-pushed the compendium-browser-appv2 branch 4 times, most recently from c5a7517 to 43546ff Compare November 26, 2024 18:35
@In3luki In3luki force-pushed the compendium-browser-appv2 branch from f1ea150 to 1891021 Compare December 1, 2024 20:10
@In3luki In3luki force-pushed the compendium-browser-appv2 branch from 1891021 to 848f35f Compare December 2, 2024 01:10
@In3luki In3luki force-pushed the compendium-browser-appv2 branch from c961fc6 to 3169762 Compare December 2, 2024 17:47
Comment on lines +95 to +103
{#each Object.entries(filter.checkboxes) as [key, checkbox]}
<FilterContainer
isExpanded={checkbox.isExpanded}
clearButton={{ data: checkbox, options: { visible: checkbox.selected.length > 0 } }}
label={checkbox.label}
>
<Checkboxes bind:checkbox={filter.checkboxes[key as keyof BrowserFilter["checkboxes"]]} />
</FilterContainer>
{/each}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

R.entries adds anever[] here for some reason so I resorted to type assertion. A union type of all checkbox filters does not include never so I'm not really sure what's going on there.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I tested with converting everything to Record<"string" | "unions", CheckboxData> but that doesn't seem to work at all. Seems to be an issue with R.entries's implementation on a union of records with explicit keys.

@CarlosFdez CarlosFdez merged commit 914e009 into foundryvtt:master Dec 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants