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

Action: text-only actions render off-centered #6879

Closed
paulcpederson opened this issue Apr 27, 2023 · 12 comments
Closed

Action: text-only actions render off-centered #6879

paulcpederson opened this issue Apr 27, 2023 · 12 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Online Issues logged by ArcGIS Online team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. design Issues that need design consultation prior to development. estimate - 2 Small fix or update, may require updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - high Issue should be addressed in the current milestone, impacts component or core functionality ready for dev Issues ready for development implementation.

Comments

@paulcpederson
Copy link
Member

Actual Behavior

There is an extra margin to the right of a calcite action which prevents it from being properly centered in cases where the action is displayed inline with an auto width.

Expected Behavior

Shoudl be able to render an action which is just text where the text is centered in the bounding box of the action.

Reproduction Sample

https://codepen.io/paulcp/pen/zYmzEdQ

Reproduction Steps

  1. Notice the extra space to the right of the word "testing"

Reproduction Version

v1.3.1

Relevant Info

All OS, all browsers.

Caused by #6562 , broken in 1.1.0

Regression?

v1.0.8

Priority impact

p4 - not time sensitive

Impact

We'd like to display a text-only action. We already have these in some interfaces so it will be broken until the upstream calcite issue is fixed.

Esri team

ArcGIS Online

@paulcpederson paulcpederson added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Apr 27, 2023
@github-actions github-actions bot added ArcGIS Online Issues logged by ArcGIS Online team members. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive labels Apr 27, 2023
@macandcheese
Copy link
Contributor

+1 - this is pretty noticeable in some interfaces. cc @SkyeSeitz @ashetland

@ashetland
Copy link
Contributor

I think ideally the fix in pr #6562 would only apply to Actions inside an Action Bar. Another possible way to address this might be to have Action Bar account for the space needed by the indicator instead of the Actions themselves. Are vertical Action Bars the only place the indicator space matters? I'd expect horizontal Action Bars could be a little more fluid, like the behavior in Chip Group.

@ashetland ashetland added the figma changes Issues that require additions or updates to the Figma UI Kit where no `design` label exists label May 31, 2023
@geospatialem geospatialem added design Issues that need design consultation prior to development. p - medium Issue is non core or affecting less that 60% of people using the library estimate - 2 Small fix or update, may require updates to tests. labels Jul 19, 2023
@geospatialem
Copy link
Member

A considerations/observation is when icon only present, it is positioned absolute.

@brittneytewks brittneytewks added p - high Issue should be addressed in the current milestone, impacts component or core functionality and removed p - medium Issue is non core or affecting less that 60% of people using the library needs triage Planning workflow - pending design/dev review. labels Aug 17, 2023
@brittneytewks brittneytewks added this to the Design Backlog milestone Aug 17, 2023
@ashetland ashetland self-assigned this Sep 13, 2023
@ashetland ashetland added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Sep 13, 2023
@ashetland ashetland modified the milestones: Design Next, Design Now Sep 13, 2023
@ashetland
Copy link
Contributor

Figma file for this issue. Restores Action to previous behavior and requires Action Bar accommodate the needed space for the indicator.

@ashetland ashetland added the ready for dev Issues ready for development implementation. label Sep 25, 2023
@github-actions github-actions bot added 0 - new New issues that need assignment. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Sep 25, 2023
@github-actions github-actions bot removed this from the Design Now milestone Sep 25, 2023
@github-actions
Copy link
Contributor

cc @geospatialem, @brittneytewks

@SkyeSeitz
Copy link

Figma file for this issue. Restores Action to previous behavior and requires Action Bar accommodate the needed space for the indicator.

Accounting for the indicator space at the Action Bar level makes a lot of sense 👍🏽

@driskull
Copy link
Member

Can we just position the indicator absolutely like we do when there is an icon? This should be a simple fix.

I'm not sure how we're expecting the action bar to account for extra space. The width of the action bar is based off of the action content inside.

@macandcheese
Copy link
Contributor

WDYT @SkyeSeitz @ashetland - I think positioning this absolutely on any provided icon makes sense. That would still solve the original issue that was fixed that caused this one (expanding action bar with indicator on longest string).

For cases that an icon is not provided and the Action is text-enabled - it could be displayed alongside the text as it was previous to the change that caused this new issue.

@macandcheese macandcheese added this to the 2023 November Priorities milestone Nov 13, 2023
@macandcheese macandcheese removed the 0 - new New issues that need assignment. label Nov 13, 2023
@macandcheese macandcheese self-assigned this Nov 13, 2023
@brittneytewks brittneytewks added 1 - assigned Issues that are assigned to a sprint and a team member. and removed needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. labels Nov 13, 2023
@ashetland
Copy link
Contributor

ashetland commented Nov 13, 2023

For cases that an icon is not provided and the Action is text-enabled - it could be displayed alongside the text as it was previous to the change that caused this new issue.

Would Action Bar need to expand to accommodate the indicator like it did before in this case? Maybe not the end of the world?

@macandcheese
Copy link
Contributor

Yeah, in the case that there are no icons present. But that's a small case and the bump in width is ... less impactful in a negative way... I'd say than the current behavior. The original issue of "action bar with icons becoming wider when indicator is present on longest string" won't occur when icons are used.

macandcheese added a commit that referenced this issue Nov 16, 2023
**Related Issue:** #6879 

## Summary
Ensures extra space is not added to an action. 

This is solved by:
When an icon is present, the indicator will always be appended to the
bottom right. This ensures it remains in the same place whether a parent
Action Bar is expanded, or not. The indicator moved a couple of px away
- in the future I think we can improve this with a border or clipped
ring around the indicator to prevent overlap.

Also resolves #5860,
for icon-only uses.

When an icon is not present, the indicator will be positioned adjacent
to the text container.


| Before  | After |
| ------------- | ------------- |
| <img width="500" alt="Screenshot 2023-11-15 at 5 00 35 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/ae4d202b-260e-411d-b6fc-30fea2c549ea">
| <img width="500" alt="Screenshot 2023-11-15 at 4 58 47 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/284119d3-e8c4-40e1-8272-7ee204a36539">
|


| Before  | After |
| ------------- | ------------- |
| <img width="500" alt="Screenshot 2023-11-15 at 5 00 25 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/fe845c89-abb6-4416-8013-5e105c0b3ebf">
| <img width="500" alt="Screenshot 2023-11-15 at 4 59 26 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/89ef62bf-7a7b-4a1f-ba29-3165df698347">
|

(Note, in this one, the "beaker" image is NOT an `icon` property, it is
just a slotted element - so the indicator is not positioned over it.
This isn't really a documented / expected use case.)


| Before  | After |
| ------------- | ------------- |
| <img width="500" alt="Screenshot 2023-11-15 at 5 00 47 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/c8722108-d9df-4540-b268-e7c8e263afdd">
| <img width="500" alt="Screenshot 2023-11-15 at 5 01 02 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/d5a06b63-92bc-4e53-a348-505c9d173188">
|


| Before | <img width="1030" alt="Screenshot 2023-11-15 at 6 17 38 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/c3ef3696-71bc-4bde-b066-ea56aebd07bd">
|
| ------------- | ------------- |
| After | <img width="1030" alt="Screenshot 2023-11-15 at 6 17 57 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/61d91130-a637-4257-84b2-42df18ecb790">
|


| Before | <img width="1313" alt="Screenshot 2023-11-15 at 6 21 22 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/26289014-9df0-4e3d-ab2e-491be34cf97b">
|
| ------------- | ------------- |
| After | <img width="1313" alt="Screenshot 2023-11-15 at 6 18 30 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/d32c2249-86ac-4a4f-9ac8-a7cbde0c322c">
|
DitwanP pushed a commit that referenced this issue Nov 16, 2023
**Related Issue:** #6879 

## Summary
Ensures extra space is not added to an action. 

This is solved by:
When an icon is present, the indicator will always be appended to the
bottom right. This ensures it remains in the same place whether a parent
Action Bar is expanded, or not. The indicator moved a couple of px away
- in the future I think we can improve this with a border or clipped
ring around the indicator to prevent overlap.

Also resolves #5860,
for icon-only uses.

When an icon is not present, the indicator will be positioned adjacent
to the text container.


| Before  | After |
| ------------- | ------------- |
| <img width="500" alt="Screenshot 2023-11-15 at 5 00 35 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/ae4d202b-260e-411d-b6fc-30fea2c549ea">
| <img width="500" alt="Screenshot 2023-11-15 at 4 58 47 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/284119d3-e8c4-40e1-8272-7ee204a36539">
|


| Before  | After |
| ------------- | ------------- |
| <img width="500" alt="Screenshot 2023-11-15 at 5 00 25 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/fe845c89-abb6-4416-8013-5e105c0b3ebf">
| <img width="500" alt="Screenshot 2023-11-15 at 4 59 26 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/89ef62bf-7a7b-4a1f-ba29-3165df698347">
|

(Note, in this one, the "beaker" image is NOT an `icon` property, it is
just a slotted element - so the indicator is not positioned over it.
This isn't really a documented / expected use case.)


| Before  | After |
| ------------- | ------------- |
| <img width="500" alt="Screenshot 2023-11-15 at 5 00 47 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/c8722108-d9df-4540-b268-e7c8e263afdd">
| <img width="500" alt="Screenshot 2023-11-15 at 5 01 02 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/d5a06b63-92bc-4e53-a348-505c9d173188">
|


| Before | <img width="1030" alt="Screenshot 2023-11-15 at 6 17 38 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/c3ef3696-71bc-4bde-b066-ea56aebd07bd">
|
| ------------- | ------------- |
| After | <img width="1030" alt="Screenshot 2023-11-15 at 6 17 57 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/61d91130-a637-4257-84b2-42df18ecb790">
|


| Before | <img width="1313" alt="Screenshot 2023-11-15 at 6 21 22 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/26289014-9df0-4e3d-ab2e-491be34cf97b">
|
| ------------- | ------------- |
| After | <img width="1313" alt="Screenshot 2023-11-15 at 6 18 30 PM"
src="https://github.com/Esri/calcite-design-system/assets/4733155/d32c2249-86ac-4a4f-9ac8-a7cbde0c322c">
|
@macandcheese macandcheese added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Nov 20, 2023
Copy link
Contributor

Installed and assigned for verification.

@DitwanP
Copy link
Contributor

DitwanP commented Nov 20, 2023

Verified locally with the main branch
Screenshot 2023-11-20 at 1 52 02 PM

@DitwanP DitwanP closed this as completed Nov 20, 2023
@DitwanP DitwanP 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 Nov 20, 2023
@ashetland ashetland removed the figma changes Issues that require additions or updates to the Figma UI Kit where no `design` label exists label Nov 21, 2023
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. ArcGIS Online Issues logged by ArcGIS Online team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. design Issues that need design consultation prior to development. estimate - 2 Small fix or update, may require updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - high Issue should be addressed in the current milestone, impacts component or core functionality ready for dev Issues ready for development implementation.
Projects
None yet
Development

No branches or pull requests

8 participants