paranext / paranext-core

Electron client, extension host, and C# library for Paranext
https://paranext.github.io/paranext-core/
MIT License
17 stars 2 forks source link

Implement Scroll Group UI #788

Open katherinejensen00 opened 8 months ago

katherinejensen00 commented 8 months ago

User Story As a user, I want to have different tabs scroll together at different references so that I can view different texts at different places in Scripture for things like Parallel Passages or cross references.

Description Adjust the UI following the UX Scroll Group Design at https://paratext.myjetbrains.com/youtrack/issue/BUX-17.

Sebastian-ubs commented 8 months ago

related UX epic is BUX-38: Epic: Scroll groups and scripture reference control

ianhewubs commented 5 months ago

Related UX case for scroll groups is BUX-17. This contains links to mockups (currently within the BCV design mockups. UX hopes to split these out into a scroll group specific mockup).

merchako commented 5 months ago

@paranext/paranext-dev-write-access , notice two affordances for changing scroll group: (1) a full one in the Tab Options Menu and (2) a smaller one in the Tab Nav. I would call both "exclusive toggle button groups." For a starting point/comparison, see Shadcn/ui's (independent) Toggle Group.

Control in Tab Nav Image

Control in Tab Menu Image

The smaller one has some funky behavior. ⚠️ This is risky but we’re trying it out. UX would like you're opinion on whether it's worth developing it as a separate, unproven component or variation.

How hard would this variation be to build? If we choose not to build it at the point, we'd want to use a version that is close or identical to the larger one in the Tab Options Menu.

merchako commented 5 months ago

Scroll indicators are the A and B next to the titles in the tab uppers

Tabs with scroll group indicator placeholders (hidden) (default) image

Tabs with scroll group indicators shown for same group upon hover/focus of BCV control image

Tabs with all scroll group indicators shown upon hover/focus/drag of tab upper (here) or scroll group control image

Sebastian-ubs commented 4 months ago

@merchako from styling the component used looks much like the Shadcn tab component (not the toogle group component). Is that right / good to use?

merchako commented 4 months ago

Incorrect; that was a custom component I designed. If we want something out-of-the-box for first iteration, we should pick something else. I expect the tab component might be confusing. It’s certainly too large for a pop up menu. @Sebastian-ubs

Sebastian-ubs commented 4 months ago

Which standard one (whith maybe adaptations) do you prefer? I had added the following to the preview app on the examples page. grafik

like

<TabsList className="pr-h-7">
  <TabsTrigger className="pr-h-6 pr-w-0" value="a">
    A
  </TabsTrigger>
  <TabsTrigger className="pr-h-6 pr-w-0" value="b">
    B
  </TabsTrigger>
  <TabsTrigger className="pr-h-6 pr-w-0" value="c">
    C
  </TabsTrigger>
  <TabsTrigger className="pr-h-6 pr-w-0" value="d">
    D
  </TabsTrigger>
  <TabsTrigger className="pr-h-6 pr-w-0" value="-">
    -
  </TabsTrigger>
</TabsList>
tjcouch-sil commented 3 months ago

Reworking this and #940:

merchako commented 3 months ago

Which standard [Shadcn component] (with maybe adaptations) do you prefer?

The <TabsList> you posted looks fine. I'm hesitant to endorse it since the semantics of the component contradict what it's being used for—it's not a tab.

The <ToggleGroup> is more appealing semantically. There is a way to make them mutually exclusive. It's not apparent in the Shadcn docs, but in Radix's ToggleGroup docs, you can demo how the single option makes the toggles mutually exclusive.

<ToggleGroup size={"sm"} type="single">

My vote is for ToggleGroup.

tjcouch-sil commented 3 months ago

Shadcn demo of the Single option - seems pretty nice! Good find!