Notifications: mobile polish

- Anchor the bell badge to the icon so it no longer covers the bell on phones
- 44px read/unread button on touch screens
- Full-width Unread/All toggle on phones
This commit is contained in:
johnnyq
2026-10-09 15:59:06 -04:00
parent bab3d73c86
commit 5aba00c7fc
2 changed files with 26 additions and 9 deletions

View File

@@ -102,12 +102,12 @@ $empty_state_skip = true;
<?php } ?>
</select>
</div>
<div class="col-md-4">
<div class="btn-group float-end" role="group" aria-label="Show">
<a href="<?= escapeHtml(notificationsPageUrl(['view' => null])) ?>" class="btn <?= $view === 'unread' ? 'btn-primary' : 'btn-outline-primary' ?>">
<div class="col-md-4 text-md-end">
<div class="btn-group d-flex d-md-inline-flex" role="group" aria-label="Show">
<a href="<?= escapeHtml(notificationsPageUrl(['view' => null])) ?>" class="btn flex-fill <?= $view === 'unread' ? 'btn-primary' : 'btn-outline-primary' ?>">
Unread <span class="badge rounded-pill text-bg-light ms-1" data-notify-count <?= $unread_count ? '' : 'hidden' ?>><?= $unread_count > 99 ? '99+' : $unread_count ?></span>
</a>
<a href="<?= escapeHtml(notificationsPageUrl(['view' => 'all'])) ?>" class="btn <?= $view === 'all' ? 'btn-primary' : 'btn-outline-primary' ?>">All</a>
<a href="<?= escapeHtml(notificationsPageUrl(['view' => 'all'])) ?>" class="btn flex-fill <?= $view === 'all' ? 'btn-primary' : 'btn-outline-primary' ?>">All</a>
</div>
</div>
</div>

View File

@@ -182,12 +182,16 @@
height: 1.6rem;
margin-top: 0;
}
/* .navbar-badge positions itself (top:9px/right:5px) for a taller bar; the
markup used to override that inline, which is why it drifted when the bar
was tightened. Positioned against the flex-centred link instead. */
/* .navbar-badge positions itself (top:9px/right:5px) for a taller bar. Pinned
to the link's edge, it slid over the icon whenever the link got narrower -
on phones the link is 28px wide and the badge covered the bell completely.
The icon is centred in the link, so anchoring to the centre puts the badge
on the icon's top-right corner at every width. */
.app-header .navbar-badge {
top: .15rem;
right: .15rem;
top: 50%;
right: auto;
left: calc(50% + .2rem);
margin-top: -.9rem;
font-size: .65rem;
}
@@ -1952,6 +1956,19 @@ html {
opacity: 1;
}
}
/* A finger needs a bigger target than a pointer: 44px on touch screens, with
the row's text kept clear of it */
@media (pointer: coarse) {
.itflow-notify-toggle {
top: .3rem;
right: .25rem;
width: 2.75rem;
height: 2.75rem;
}
.itflow-notify-item .itflow-notify-link {
padding-right: 3.25rem;
}
}
.itflow-notify-empty {
padding: 2rem 1rem;
text-align: center;