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

[Block] Provide consistent use of sorting similar to list #10382

Closed
6 of 10 tasks
geospatialem opened this issue Sep 24, 2024 · 11 comments
Closed
6 of 10 tasks

[Block] Provide consistent use of sorting similar to list #10382

geospatialem opened this issue Sep 24, 2024 · 11 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. Calcite (dev) Issues logged by Calcite developers. calcite-components Issues specific to the @esri/calcite-components package. design Issues that need design consultation prior to development. enhancement Issues tied to a new feature or request. future breaking change Issues and pull requests with deprecation(s), requires a breaking change in a future milestone. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone new component Issues tied to a new component. spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment.

Comments

@geospatialem
Copy link
Member

geospatialem commented Sep 24, 2024

Check existing issues

Description

block currently offers a handle attribute, but the sorting functionality is handled via a parent internal unsupported and undocumented component. Instead we should offer support to a set of grouped blocks in alignment with list and list-item.

Blocked issues: #10572

Acceptance Criteria

  • Provide a new component, block-group with dragEnabled that allows specified block's to be movable
  • Use sort-handle component
  • Deprecate the handle property (to be removed in 4.0)
  • Deprecates the internal sortable-list (to be removed in 4.0)

Relevant Info

  • Consistency across the design system
  • Removal of internal and undocumented components
  • Use case of Esri teams seeking to provide sorting on block components

Which Component

block

Example Use Case

https://codepen.io/geospatialem/pen/XWvJbEm

Priority impact

impact - p2 - want for an upcoming milestone

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

Calcite (dev)

@geospatialem geospatialem added enhancement Issues tied to a new feature or request. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Sep 24, 2024
@github-actions github-actions bot added Calcite (dev) Issues logged by Calcite developers. calcite-components Issues specific to the @esri/calcite-components package. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone labels Sep 24, 2024
@geospatialem geospatialem added future breaking change Issues and pull requests with deprecation(s), requires a breaking change in a future milestone. spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment. labels Sep 24, 2024
@geospatialem
Copy link
Member Author

Spike needed to determine the structure of the component needed to provide sorting on specified blocks.

@geospatialem geospatialem changed the title [Block/Block Section] Provide consistent use of sorting similar to list [Block] Provide consistent use of sorting similar to list Sep 24, 2024
@geospatialem geospatialem removed the needs triage Planning workflow - pending design/dev review. label Sep 24, 2024
@ashetland ashetland added the figma changes Issues that require additions or updates to the Figma UI Kit where no `design` label exists label Sep 26, 2024
@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Dec 16, 2024
@driskull
Copy link
Member

driskull commented Dec 19, 2024

For blocks to be sortable, they need to be child items which means that they need some kind of parent component to allow them to be sortable which would replace the sortable-list component. What would this component be called?

What about block-sections, would they ever need sorting as well?

@driskull
Copy link
Member

@geospatialem I think this would be a new component so should probably be tagged like that

@geospatialem geospatialem added the new component Issues tied to a new component. label Dec 19, 2024
Copy link
Contributor

cc @ashetland, @SkyeSeitz, @brittneytewks

@driskull
Copy link
Member

What should this new component be called? @geospatialem @DitwanP

@geospatialem
Copy link
Member Author

What should this new component be called? @geospatialem @DitwanP

What about block-sections, would they ever need sorting as well?

Maybe we should approach the naming in case we would need to apply the same functionality to block-sections? @driskull, do you think we should accommodate sorting on both components, block and block-section with the effort?

As far as naming, WDYT about something like block-group? Can we think of any other functionality the component could provide in addition to sorting? If not, maybe we should consider the effort for the next breaking change release, where we could consider adding a new block-item component to have a similar implementation experience as the list / list-item dragging experience and the block and block-section could serve as the parent elements for sorting? WDYT?

@ashetland ashetland added design Issues that need design consultation prior to development. and removed figma changes Issues that require additions or updates to the Figma UI Kit where no `design` label exists labels Dec 30, 2024
@driskull
Copy link
Member

do you think we should accommodate sorting on both components, block and block-section with the effort?

I'm not sure. is there a request to sort sections?

@geospatialem can you setup a quick meeting to discuss the options and how we want to move forward?

@macandcheese
Copy link
Contributor

macandcheese commented Dec 30, 2024

I don't think we've had a request for Block Groups - although it seems like it would make sense in the future as an additional feature. I think Block Group name / pattern is a great direction.

@driskull
Copy link
Member

driskull commented Jan 16, 2025

@geospatialem @jcfranco calcite-sortable-list depends on calcite-handle so if we update calcite-block to use calcite-sort-handle then a calcite-sortable-list with blocks will no longer work.

calcite-handle does have a handleSelector property that a user could update if need be. Or we could update the property but that would be a breaking change.

@driskull driskull added 2 - in development Issues that are actively being worked on. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Jan 17, 2025
geospatialem added a commit that referenced this issue Jan 21, 2025
…ests (#11263)

**Related Issue:** #9922

## Summary
Add automation to issues when the `calcite-ui-icons` label is added,
where Icon team leads will receive an `@` notification via a comment,
similar to the [new component label
automation](#10382 (comment))
from the [notifyAboutNewComponent
script](https://github.com/Esri/calcite-design-system/blob/dev/.github/scripts/notifyAboutNewComponent.js).

cc @allieorth, @arowles
driskull added a commit that referenced this issue Feb 3, 2025
**Related Issue:** #10382

## Summary

- add new component `calcite-block-group`
  - allows dragging/sorting `calcite-block` elements 
  - add tests
  - add story
  - add demo html
- `calcite-block`
  - uses  `calcite-sort-handle` instead of `calcite-handle`
  - new property `dragDisabled`
  - new property `sortHandleOpen`
  - new events for `calcite-sort-handle` opening/closing
    - `calciteBlockSortHandleBeforeClose`
    - `calciteBlockSortHandleBeforeOpen`
    - `calciteBlockSortHandleClose`
    - `calciteBlockSortHandleOpen` 
  - adds tests
- `calcite-sort-handle` to work without a `setSize` and `setPosition`
for use with `calcite-sortable-list`.
- remove unnecessary imports in css files (these are already apart of
includes)

Notes:

- Using `calcite-sortable-list` with `calcite-block` will no longer just
work. A user would need to set the `calcite-sortable-list`'s
`handleSelector` property to be `calcite-sort-handle` instead of
`calcite-handle`.
- When we drag over a list-item, it will open. However, i'm not sure if
we want to do that for block. Do we expect nested blocks? Would it be
weird to open a collapsed block when dragging another block over it?

# BlockGroup API Documentation

## Properties

### `canPull`

- **Type:** `(detail: BlockDragDetail) => boolean`
- **Description:** When provided, the method will be called to determine
whether the element can move from the component.

### `canPut`

- **Type:** `(detail: BlockDragDetail) => boolean`
- **Description:** When provided, the method will be called to determine
whether the element can be added from another component.

### `disabled`

- **Type:** `boolean`
- **Default:** `false`
- **Reflect:** `true`
- **Description:** When `true`, interaction is prevented and the
component is displayed with lower opacity.

### `dragEnabled`

- **Type:** `boolean`
- **Default:** `false`
- **Reflect:** `true`
- **Description:** When `true`, `calcite-block`s are sortable via a
draggable button.

### `group`

- **Type:** `string`
- **Description:** The group identifier for the block group.

### `label`

- **Type:** `string`
- **Description:** Specifies an accessible name for the component. When
`dragEnabled` is `true` and multiple block-group sorting is enabled with
`group`, specifies the component's name for dragging between
block-groups.
- **Required:** `true`

### `loading`

- **Type:** `boolean`
- **Default:** `false`
- **Reflect:** `true`
- **Description:** When `true`, a busy indicator is displayed.

## Methods

### `setFocus`

- **Description:** Sets focus on the component.
- **Returns:** `void`

---------

Co-authored-by: Kitty Hurley <[email protected]>
@driskull driskull added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Feb 3, 2025
Copy link
Contributor

github-actions bot commented Feb 3, 2025

Installed and assigned for verification.

@github-actions github-actions bot assigned DitwanP and unassigned driskull Feb 3, 2025
@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Feb 4, 2025
@geospatialem
Copy link
Member Author

Verified with 3.0.0-next.126 with the new block-group component and dragEnabled: https://codepen.io/geospatialem/pen/xbKNygd

<p>City observations</p>
<calcite-block-group drag-enabled group="my-group" label="Group 1">
  <calcite-block collapsible heading="White squirrels">
     ...
  </calcite-block>
  <calcite-block collapsible heading="Black squirrels">
     ...
  </calcite-block>
</calcite-block-group>

<p>Neighborhood observations</p>
<calcite-block-group drag-enabled group="my-group" label="Group 2">
  <calcite-block collapsible heading="Gray squirrels">
     ...
  </calcite-block>
  <calcite-block collapsible heading="Red squirrels">
     ...
  </calcite-block>
</calcite-block-group>

benelan pushed a commit that referenced this issue Feb 8, 2025
…ests (#11263)

**Related Issue:** #9922

## Summary
Add automation to issues when the `calcite-ui-icons` label is added,
where Icon team leads will receive an `@` notification via a comment,
similar to the [new component label
automation](#10382 (comment))
from the [notifyAboutNewComponent
script](https://github.com/Esri/calcite-design-system/blob/dev/.github/scripts/notifyAboutNewComponent.js).

cc @allieorth, @arowles
benelan pushed a commit that referenced this issue Feb 8, 2025
**Related Issue:** #10382

## Summary

- add new component `calcite-block-group`
  - allows dragging/sorting `calcite-block` elements 
  - add tests
  - add story
  - add demo html
- `calcite-block`
  - uses  `calcite-sort-handle` instead of `calcite-handle`
  - new property `dragDisabled`
  - new property `sortHandleOpen`
  - new events for `calcite-sort-handle` opening/closing
    - `calciteBlockSortHandleBeforeClose`
    - `calciteBlockSortHandleBeforeOpen`
    - `calciteBlockSortHandleClose`
    - `calciteBlockSortHandleOpen` 
  - adds tests
- `calcite-sort-handle` to work without a `setSize` and `setPosition`
for use with `calcite-sortable-list`.
- remove unnecessary imports in css files (these are already apart of
includes)

Notes:

- Using `calcite-sortable-list` with `calcite-block` will no longer just
work. A user would need to set the `calcite-sortable-list`'s
`handleSelector` property to be `calcite-sort-handle` instead of
`calcite-handle`.
- When we drag over a list-item, it will open. However, i'm not sure if
we want to do that for block. Do we expect nested blocks? Would it be
weird to open a collapsed block when dragging another block over it?

# BlockGroup API Documentation

## Properties

### `canPull`

- **Type:** `(detail: BlockDragDetail) => boolean`
- **Description:** When provided, the method will be called to determine
whether the element can move from the component.

### `canPut`

- **Type:** `(detail: BlockDragDetail) => boolean`
- **Description:** When provided, the method will be called to determine
whether the element can be added from another component.

### `disabled`

- **Type:** `boolean`
- **Default:** `false`
- **Reflect:** `true`
- **Description:** When `true`, interaction is prevented and the
component is displayed with lower opacity.

### `dragEnabled`

- **Type:** `boolean`
- **Default:** `false`
- **Reflect:** `true`
- **Description:** When `true`, `calcite-block`s are sortable via a
draggable button.

### `group`

- **Type:** `string`
- **Description:** The group identifier for the block group.

### `label`

- **Type:** `string`
- **Description:** Specifies an accessible name for the component. When
`dragEnabled` is `true` and multiple block-group sorting is enabled with
`group`, specifies the component's name for dragging between
block-groups.
- **Required:** `true`

### `loading`

- **Type:** `boolean`
- **Default:** `false`
- **Reflect:** `true`
- **Description:** When `true`, a busy indicator is displayed.

## Methods

### `setFocus`

- **Description:** Sets focus on the component.
- **Returns:** `void`

---------

Co-authored-by: Kitty Hurley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. Calcite (dev) Issues logged by Calcite developers. calcite-components Issues specific to the @esri/calcite-components package. design Issues that need design consultation prior to development. enhancement Issues tied to a new feature or request. future breaking change Issues and pull requests with deprecation(s), requires a breaking change in a future milestone. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone new component Issues tied to a new component. spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment.
Projects
None yet
Development

No branches or pull requests

5 participants