Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

inbox, recent: Extra-light reveal for keyboard-only row selection.

Alya Abbott8649c92a3cf0
diff --git a/web/styles/inbox.css b/web/styles/inbox.css
index a8af77af8de..f949a3575c1 100644
--- a/web/styles/inbox.css
+++ b/web/styles/inbox.css
@@ -293,11 +293,9 @@
inherit` is also a `.visibility-policy-indicator`. */
.inbox-row,
.inbox-header {
- /* Row hover or keyboard focus reveals/lifts wrappers
- to 0.45, matching the explicit-marker idle tier. */
- &:hover,
- &:focus-within:not(:focus),
- &:focus-visible {
+ /* Mouse hover reveals/lifts wrappers to 0.45,
+ matching the explicit-marker idle tier. */
+ &:hover {
:is(
.inbox-action-button,
.channel-visibility-policy-indicator,
@@ -307,6 +305,33 @@
}
}
+ /* Keyboard selection alone (row focused but not
+ mouse-hovered) reveals only the usually-hidden
+ action buttons at a much quieter 0.2. Explicit
+ state markers stay at their 0.45 idle — only the
+ tertiary reveal needs this extra-quiet step. The
+ `:not(:focus-visible)` exclusion ensures that when
+ the button itself has keyboard focus (via arrow-
+ right into the column), its own `:focus-visible`
+ rule sets the direct-interaction tier instead. */
+ &:focus-within:not(:focus, :hover) {
+ :is(
+ .inbox-action-button,
+ .inbox-row-visibility-policy-inherit
+ ):not(:focus-visible) {
+ opacity: 0.2;
+ }
+ }
+
+ &:focus-visible:not(:hover) {
+ :is(
+ .inbox-action-button,
+ .inbox-row-visibility-policy-inherit
+ ) {
+ opacity: 0.2;
+ }
+ }
+
/* Direct hover on a wrapper lifts to 0.7. Compound
selector beats the row-wide reveal on specificity. */
&:hover
diff --git a/web/styles/recent_view.css b/web/styles/recent_view.css
index e22b0b61ea6..aebd15185eb 100644
--- a/web/styles/recent_view.css
+++ b/web/styles/recent_view.css
@@ -48,14 +48,35 @@
padding: 0.1875em 0.5em; /* 3px 8px at 16px/1em */
}
- /* Suppress focus rings when focus was set programmatically
- (e.g., on page load or sidebar click). The class is removed
- on the first keyboard navigation, restoring :focus outlines.
- See focus_outline_util.ts. */
+ /* Suppress focus rings and the focus-driven vdots reveal when
+ focus was set programmatically (e.g., on page load or
+ sidebar click). The class is removed on the first keyboard
+ navigation, restoring :focus outlines and the icon reveals
+ below. See focus_outline_util.ts. The icon-opacity rules
+ mirror the selectors they override (in `.recent_view_focusable`
+ below) so each wins on specificity from the extra class. */
&.no-visible-focus-outlines .recent_view_focusable {
&:focus {
outline: 0;
}
+
+ &:focus
+ > .change_visibility_policy
+ :is(
+ .recent-view-row-topic-menu,
+ .visibility-status-icon[data-vdots-original-icon-class]
+ ) {
+ opacity: 0;
+ }
+
+ &.recent-view-body-row:focus:not(:hover)
+ .change_visibility_policy
+ :is(
+ .recent-view-row-topic-menu,
+ .visibility-status-icon[data-vdots-original-icon-class]
+ ) {
+ opacity: 0;
+ }
}
.recent_view_focusable {
@@ -66,10 +87,19 @@
&:focus {
outline: var(--focus-ring-outline);
- > .change_visibility_policy .recent-view-row-topic-menu {
- /* Tertiary action reveal tier: row hover / keyboard
- focus — visible affordance, subordinate to content. */
- opacity: 0.4;
+ /* Match both the natively-rendered vdots icon and the
+ swapped vdots (signaled by the data attribute set in
+ `recent_view_ui.update_visibility_icon_swap_state`) so
+ the wrapper-focus tier reads the same regardless of
+ whether the row has a status marker. */
+ > .change_visibility_policy
+ :is(
+ .recent-view-row-topic-menu,
+ .visibility-status-icon[data-vdots-original-icon-class]
+ ) {
+ /* Wrapper focus = direct interaction on the
+ menu button; top of the tier. */
+ opacity: 0.7;
}
}
@@ -82,6 +112,20 @@
opacity: 0.7;
}
+ /* Row keyboard-selected but not mouse-hovered: extra-quiet
+ reveal of the default-state 3-dots icon, so keyboard
+ navigation doesn't loudly advertise an action the user
+ rarely needs. Mouse hover's 0.4 rule below overrides
+ whenever the mouse is on the row. */
+ &.recent-view-body-row:focus:not(:hover)
+ .change_visibility_policy
+ :is(
+ .recent-view-row-topic-menu,
+ .visibility-status-icon[data-vdots-original-icon-class]
+ ) {
+ opacity: 0.2;
+ }
+
&.recent-view-topic-visibility {
border-radius: 0.3125em; /* 5px at 16px/1em */
/* 3px rather than 5px: the wrapper sits hard against