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

Standardized collapsible component #518

Merged
merged 36 commits into from
Nov 24, 2022
Merged

Standardized collapsible component #518

merged 36 commits into from
Nov 24, 2022

Conversation

rsek
Copy link
Collaborator

@rsek rsek commented Oct 22, 2022

implements a standardized Collapsible component with plenty of slots. makes MoveItem a descendant of Collapsible. MoveItem gets some visual tweaks:

Screen Shot 2022-10-21 at 6 03 27 PM

i could theoretically apply the same to the move sheet oracle rows -- as well as everything else that collapses -- in this PR, but i'm thinking i'll defer that for the time being and gradually migrate components.

TODO

  • re-implement scrollIntoView and friends
  • for moves w/ multiple oracles attached: rather than have the oracle button grayed out, make it open the move and scroll to the embedded oracle tables

For later PRs

  • animate the collapse/expand icon
  • migrate various collapsibles to this component
  • refine various Collapsible features as implementation exposes needs that aren't met yet
  • build a dedicated CollapsibleTree component from Collapsibles (or that simply works as a wrapper)
  • experiment with injecting this into the sidebar directories (items tab, rolltables tab)

@rsek
Copy link
Collaborator Author

rsek commented Oct 22, 2022

move jump/highlight links are now working again.

now includes an experimental move sheet that pulls in move category colours from dataforged. may only work in FF + light theme + starforged tools at this time -- working out fallbacks and a variation for dark themes comes next, if you think it's worth pursuing. :) this version also goes hogwild with tooltip annotations + icon size to see if it gets annoying.

Screen Shot 2022-10-22 at 2 41 08 AM

couple additions i'm considering:

  • make the move categories themselves collapsible?
  • currently, move trigger text is exposed in tooltips. worth exposing the triggers in other ways? maybe an alternative view where you just see a list of triggers, or some way to search them.

@rsek
Copy link
Collaborator Author

rsek commented Oct 23, 2022

copying my own discord post so i can find it easily later:

snapshot of move sheet progress, which makes move categories collapsible in addition to individual moves. the idea is that in a collapsed state, the theme colour is a big ol' block to add an additional signal of category. but once you get to the level of individual move articles, it being open is readily distinguishable from its siblings.

still need to add some strokes to maintain contrast in cases with strange colours, to fix jump links to account to the more nested structure... and to figure out how to convey all that on a dark theme, too, haha

also considering adding a flag that maintains open/closed state, since the more layered structure might make it convenient to leave certain categories open.

Screen_Shot_2022-10-23_at_3 28 09_AM

@rsek
Copy link
Collaborator Author

rsek commented Oct 24, 2022

  • still a draft -- there's some underlying wiring that i gotta detangle still -- but i think i'm closing in on how it ought to look, now (at least in light mode on FF).
  • i think i've resolved the extra face danger entries in search results -- so far as i can tell, it was something to do with the v-for iterations being keyed by displayName, which has some duplicates. i've set them to use index where relevant, and so we now face only the normal amount of dangers :D
  • symbol change for expand/collapse, so it's distinct from the one used to mark progress. it's also animated now! might be worth exploring other expand/collapse symbol possibilities (+/- on thematic shapes might be nice), but for now i think its fine.

Screen Shot 2022-10-24 at 2 11 29 AM

  • the underlying rationale for the colors here:
    • an open category should be very immediately distinct from its open child even when someone is scrubbing the scrollbar
    • on the other hand, a group of expanded children should have sufficiently obvious colour; likewise for standalone cards, e.g. when they appear in search results
  • the "tabbed card" is designed to look nice as a solo element as well, so it holds up well in search results
    • considering a way to add a reversed border radius to the bottom right corner of the black tab of an expanded move
  • discovered that my colour data in dataforged is off -- probably just a late change that slipped in under my radar. i've added an enum to correct that until DF2.0.
  • ironsworn stuff has colours assigned now. some of the categories map directly, others are a bit arbitrary, but they all have them. (the corrected DF move category colours are a bit more sober than before, so they actually fit in fairly well)
  • custom moves pull in the folder colour (v10+) as their thematic colour
  • rearranged a bunch of locale strings so that it's e.g "Combat moves" rather than "Combat"

to fix before marking ready for review:

  • double check some contrast ratios against WCAG standards; adjust theme colors for web use when necessarily
  • add a "Progress Move" text just below the move tab
  • ensure individual search results are pulling in the relevant theme color
  • work out behaviour for move jump links -- probably expand the category then expand the target?
  • resolve whatever havoc ive wrought on en.json
  • resolve the sudden expansion + other jank happening on scroll + expand -- sometimes it does it partway, then immediately jumps to expanded?
  • provide add'l styling to the SF theme's version
    • color vars for clickable-thematic: ironsworn-color-[bg|fg|text-outline|border]-clickable-thematic-[enabled|hover|selected]
    • another possibility: migrate to HSL-based colours, which are friendlier to having their lightness/alpha adjusted as CSS vars (see https://csscolorvars.github.io/ for example)

stuff i'm thinking about for later PRs

  • figure out how to make HMR work with CSS modules (which i'm really liking so far!)
  • standardize an Accordion/Listbox component
  • compress variant moves into a single entry (further nesting? just list one after the other?)
  • additional expand/collapse buttons next to the search box?
  • use flags to save expand/collapse state of move categories?
  • move category tooltip to a less obtrusive ℹ️ icon, flush right of the category title? or make it its own expanding item?

@rsek rsek marked this pull request as ready for review November 23, 2022 01:44
@rsek rsek requested a review from ben November 23, 2022 23:17
Copy link
Owner

@ben ben left a comment

Choose a reason for hiding this comment

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

This is an amazing piece of work. Just one nit and then we can merge it.

src/module/item/item.ts Outdated Show resolved Hide resolved
@ben ben merged commit 65c76da into ben:main Nov 24, 2022
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.

2 participants