Skip to content

Custom resize cursors#3535

Merged
snowystinger merged 18 commits into
mainfrom
custom-resize-cursors
Oct 13, 2022
Merged

Custom resize cursors#3535
snowystinger merged 18 commits into
mainfrom
custom-resize-cursors

Conversation

@snowystinger
Copy link
Copy Markdown
Member

@snowystinger snowystinger commented Sep 19, 2022

Closes

Moves the sort icon to the start of its header cell
Shows a chevron indicating a menu on column headers for hover/focus, this can be seen on any resizable column or any resizable and sortable column
Displays a custom cursor for resizing

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@adobe-bot
Copy link
Copy Markdown

@devongovett
Copy link
Copy Markdown
Member

What's the plan for the aria hooks? Will we somehow fall back to the standard ones? Embed these?

Comment thread packages/@adobe/spectrum-css-temp/components/table/index.css
@snowystinger
Copy link
Copy Markdown
Member Author

What's the plan for the aria hooks? Will we somehow fall back to the standard ones? Embed these?

I decided to move it out entirely, there's enough information coming from the hook to set whatever cursor you want. Reason being that it seemed like a rendering concern more than aria. Especially since you need to set the cursor on hover as well as setting the entire document, every element, with !important during drag. Without creating a stylesheet on the fly, setting it for every element would be impossible.

@adobe-bot
Copy link
Copy Markdown

Comment thread packages/@adobe/spectrum-css-temp/components/table/index.css
@adobe-bot
Copy link
Copy Markdown

@adobe-bot
Copy link
Copy Markdown

@ktabors
Copy link
Copy Markdown
Collaborator

ktabors commented Sep 22, 2022

The most recent storybook v18 build isn't showing the new cursor. It is showing a cursor, but it doesn't look like the one I see in files nor the first version of storybook with this PR.

@adobe-bot
Copy link
Copy Markdown

ktabors
ktabors previously approved these changes Sep 23, 2022
Copy link
Copy Markdown
Collaborator

@ktabors ktabors left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

The behavior seems good to me, but I'm not sure if #3535 (comment) is blocking/resolved (just not even sure what exactly it means heh).

Some extra things that are out of scope/can be done as followup/maybe non-issues:

  1. Can/should we bump up the default min width of a resizable column? Now that we have a chevron some of the story columns are quite cramped at the min width.

image

This maybe a non-issue since the user could define a nicer min width themselves but perhaps we can approximate a new default min width value that is a 3 or 4 letter word + chevron

  1. Should these column header buttons be truncating text? They currently don't. It would also be nice if it was like Picker where the chevron was prioritized over the text, at least when it is visible (display: none when not hovered?)

@adobe-bot
Copy link
Copy Markdown

@ktabors
Copy link
Copy Markdown
Collaborator

ktabors commented Sep 26, 2022

I didn't consider what Daniel reported as an issue, but since we are this doesn't seem right. Give it keyboard focus and then mouse over it.
image

@snowystinger
Copy link
Copy Markdown
Member Author

snowystinger commented Sep 27, 2022

I didn't consider what Daniel reported as an issue, but since we are this doesn't seem right. Give it keyboard focus and then mouse over it. image

Will be fixed by #3560

update: fixed

@adobe-bot
Copy link
Copy Markdown

# Conflicts:
#	packages/@react-spectrum/table/src/TableView.tsx
@adobe-bot
Copy link
Copy Markdown

@adobe-bot
Copy link
Copy Markdown

@adobe-bot
Copy link
Copy Markdown

@adobe-bot
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

@ktabors ktabors left a comment

Choose a reason for hiding this comment

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

This works well and looks good!

Copy link
Copy Markdown
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

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

LGTM

@adobe-bot
Copy link
Copy Markdown

@snowystinger snowystinger merged commit 9e19dee into main Oct 13, 2022
@snowystinger snowystinger deleted the custom-resize-cursors branch October 13, 2022 22:12
@snowystinger snowystinger mentioned this pull request Dec 8, 2022
61 tasks
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.

7 participants