Skip to content

Add Keytips to office-ui-fabric-react#4629

Merged
dzearing merged 94 commits into
microsoft:masterfrom
kelseyyoung:keyou/move-keytips-to-package
May 1, 2018
Merged

Add Keytips to office-ui-fabric-react#4629
dzearing merged 94 commits into
microsoft:masterfrom
kelseyyoung:keyou/move-keytips-to-package

Conversation

@kelseyyoung

@kelseyyoung kelseyyoung commented Apr 20, 2018

Copy link
Copy Markdown
Contributor

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ npm run change

Description of changes

Screenshot of keytips
image

Focus areas to test

(optional)

- Add keytipProps to BaseButton
- Update KeytipLayer example to use new keytipProps, comment out some of it
- Add KeytipConfig files, use for setup in KeytipLayer
- Setup offset for keytips correctly
- Add keytip offset example
- Remove keytipLink and previous overflow logic, and tests
- Update tests
- Add KeytipLayer styles to prioritize that layer above all others
- Add split button in contextual menu to example
…flexibility

- Add more components to the KeytipLayer example
- Add ariaDescribedBy to KeytipHost to do automatic appending
- Also unsets when item gets moved out of the overflow
- Add logic in places to merge the overflow sequence if necessary
- Fix tests that used let instead of const
- Add persisted attribute to tree node to filter out when showing keytips
…le function ordering

- Fix broken Keytip examples
pauseBreak = 19,
capslock = 20,
escape = 27,
space = 32,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What exactly is going on in this file?


// Events
export namespace KeytipEvents {
export const KEYTIP_ADDED = 'keytipAdded';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you move the keytips stuff out of the utilities package? This will be included in the PLT1 bundle. It should only be in the keytips project in oufr.

Comment thread packages/utilities/src/index.ts Outdated
export * from './IStyleFunction';
export * from './KeyCodes';
export * from './KeytipConstants';
export * from './KeytipTransitionModifier';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

None of the keytip work belongs in @uifabric/utilities.

up: 38,
right: 39,
down: 40,
insert: 45,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not sure what's up here.

/**
* The background color for a disabled keytip.
*/
keytipBackgroundDisabled: string;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it is weird that there is a background for a disabled keytip but nothing else...

aria-haspopup={ true }
aria-expanded={ this._isExpanded }
aria-pressed={ this.props.checked }
aria-describedby={ ariaDescribedBy + (keytipAttributes['aria-describedby'] || '') }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

are you guaranteed that ariaDescribedBy and the aria-describedby from keytipAttributes will have a space in between them? Consider something like ${ariaDescribedby} ${keytipAttributes['ariadescribedby']}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The beginning space is added in the getAriaDescribedBy function

import { IStyleFunction, IPoint } from '../../Utilities';
import { mergeStyleSets } from '../../Styling';

export const getStyles = (props: IKeytipStyleProps): IKeytipStyles => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not seeing any HC styling for keytips, when disabled the color should be grayText and the opacity should be 1

@jspurlin jspurlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

a few minor comments

- Add HC styling for keytips when disabled
- Restored missing KeyCodes
$listItemBackgroundCheckedHoveredColor: "[theme:listItemBackgroundCheckedHovered, default: #d0d0d0]";

/* Keytips */
$keytipDisabledTextColor: "[theme:keytipDisabledText, default: #b1b1b1]";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

keytips should not get their own semantic slot
semantic slots are not for each feature to have their own, but for each concept
can you reuse an existing concept?

@kelseyyoung kelseyyoung May 1, 2018

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@phkuo How can I reuse an existing one if the color isn't shared with anyone else? I thought your previous comments in the other PRs (the part 1 and 2 ones) said to follow this pattern

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All colors should be one that's in our palette, we shouldn't be adding things with bespoke colors.
For now, just use one of the palette slots from here:
https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/common/_themeOverrides.scss

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now using neutralTertiaryAlt instead which is very close to our original color

phkuo
phkuo previously requested changes May 1, 2018

@phkuo phkuo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

see comment

@phkuo

phkuo commented May 1, 2018

Copy link
Copy Markdown
Contributor

Can you add a screenshot?

* This category covers all kinds of lists, whether they're typical one-item-per-row lists (like DetailsList) or ones with a tiled layout.
*
* ## Keytips
*

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oversight, will remove

@dzearing dzearing merged commit 920a06d into microsoft:master May 1, 2018
@cliffkoh

cliffkoh commented May 3, 2018

Copy link
Copy Markdown
Contributor

Hi @kelseyyoung, because the Command Bar component you modified was replaced by the version in the @uifabric/experiments folder in 6.0, the keytips support for command bar will be lost when 6.0 lands.

I've therefore marked this PR as requiring follow up in 6.0. I will coordinate with you offline on what this means.

(cc @dzearing)

@cliffkoh

cliffkoh commented May 3, 2018

Copy link
Copy Markdown
Contributor

Also @micahgodbolt for FYI.

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants