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

Adds a dismiss button to remove Recent tabs (#177) #248

Merged
merged 1 commit into from
May 23, 2018

Conversation

htwyford
Copy link
Contributor

Addresses #177. Adds a dismiss button to recent tabs that appears on hover.
Adding a button to the tabs required the anchor element to be changed from a button to a clickable div.
Dark theming in popup.css depends on dark theme #239 being implemented.

Copy link
Contributor

@fzzzy fzzzy left a comment

Choose a reason for hiding this comment

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

Just a few small changes with regard to accessibility.

addon/popup.js Outdated
@@ -73,8 +73,10 @@ function renderTabList(tabs, containerSelector, eventLabel) {
let li = document.createElement("li");
let image = document.createElement("span");
let text = document.createElement("span");
let dismiss = document.createElement("span");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should use a button here, for accessibility, so it is possible to use the tab key to select this element and the space bar to press it.

addon/popup.js Outdated
@@ -83,7 +85,7 @@ function renderTabList(tabs, containerSelector, eventLabel) {
image.style.backgroundImage = `url(${favIconUrl})`;
}
renderedInfo += favIconUrl + " ";
let anchor = document.createElement("button");
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, if this is a button then it can be navigated to using the keyboard. Switching it to anything else will regress the bug I fixed by switching this to a button.

addon/popup.css Outdated
text-align: center;
}

#panel.dark-theme .tab__dismiss::after {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know there is a bit of dark theme stuff here, but that is fine. Make sure it all integrates smoothly when fixing the conflicts in the dark theme pr.

addon/popup.css Outdated
position: absolute;
font-size: 18px;
color: rgb(83, 85, 85);
content: '\d7'; /* cross symbol */

Choose a reason for hiding this comment

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

https://design.firefox.com/icons/viewer/#close
our "x" is slightly different

@htwyford htwyford force-pushed the 177-dismissRecents branch from 49b63ab to 88ad108 Compare May 14, 2018 19:22
@htwyford
Copy link
Contributor Author

Restored both buttons to being <button>s. There's an extra layer now: they both sit in a flexbox div classed tab__parent. This allows the highlight to go all the way across. You can tab through all the tabs and their dismiss buttons.

One caveat: the 10px to the right of the dismiss symbol and the 3px above and below are not clickable. This is owing to the fact that the main "tab" button is now a sibling of the dismiss button rather than its parent. This does not effect "Current Tabs", only Recents (since Currents do not have a dismiss button).

Thoughts on this? I could make it so that the clickable area of the dismiss button extends above, below and to the right of its visible area, but that might be more confusing. I'm not sure of a way to make the tab button clickable behind the dismiss button while keeping them both <button>s.

@ericawright
Copy link

could the tab__parent have a click effect that is the same as the main tab button?

@htwyford htwyford force-pushed the 177-dismissRecents branch from 88ad108 to 220d797 Compare May 14, 2018 20:55
@htwyford htwyford force-pushed the 177-dismissRecents branch from 220d797 to b1e20a3 Compare May 14, 2018 20:57
@htwyford
Copy link
Contributor Author

Thanks! I did it that way. I spun the event listener out into its own private method to event too much needless duplication.

@fzzzy
Copy link
Contributor

fzzzy commented May 22, 2018

I need to take another look at this.

@fzzzy
Copy link
Contributor

fzzzy commented May 23, 2018

💯

@fzzzy fzzzy merged commit 5fbb9f6 into mozilla:master May 23, 2018
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.

3 participants