feat: Add chat filter functionality for channel and DM messages

- Add filter-utils.js with diacritic-insensitive search and text highlighting
- Add FAB filter button (gray funnel icon) to channel chat and DM
- Filter bar slides in as overlay at top of chat area
- Real-time filtering with debounce (150ms) as user types
- Matched text highlighted with yellow background
- Support for Polish characters (wol matches wół)
- Keyboard shortcuts: Ctrl+F to open, Escape to close
- Match counter shows X / Y filtered messages
- Filter persists during auto-refresh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-02-01 21:29:44 +01:00
parent aa788d7a0b
commit d37326c261
7 changed files with 830 additions and 0 deletions
+138
View File
@@ -1067,3 +1067,141 @@ main {
color: #75b798;
background-color: rgba(117, 183, 152, 0.15);
}
/* =============================================================================
Chat Filter
============================================================================= */
/* Filter FAB button (gray gradient) */
.fab-filter {
background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
color: white;
}
/* Filter bar overlay - slides down from top of chat area */
.filter-bar {
position: absolute;
top: 0;
left: 0;
right: 0;
z-index: 1002; /* Above mentions popup (1001) */
background-color: #ffffff;
border-bottom: 1px solid #dee2e6;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
padding: 0.75rem;
transform: translateY(-100%);
opacity: 0;
visibility: hidden;
transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}
.filter-bar.visible {
transform: translateY(0);
opacity: 1;
visibility: visible;
}
/* Filter bar inner layout */
.filter-bar-inner {
display: flex;
align-items: center;
gap: 0.5rem;
}
.filter-bar-input {
flex: 1;
border-radius: 0.375rem;
border: 1px solid #ced4da;
padding: 0.5rem 0.75rem;
font-size: 0.9rem;
}
.filter-bar-input:focus {
outline: none;
border-color: #86b7fe;
box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}
/* Filter bar buttons */
.filter-bar-btn {
width: 36px;
height: 36px;
border-radius: 50%;
border: none;
display: flex;
align-items: center;
justify-content: center;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.15s ease;
}
.filter-bar-btn-clear {
background-color: #f8f9fa;
color: #6c757d;
}
.filter-bar-btn-clear:hover {
background-color: #e9ecef;
}
.filter-bar-btn-close {
background-color: #dc3545;
color: white;
}
.filter-bar-btn-close:hover {
background-color: #bb2d3b;
}
/* Filter match count indicator */
.filter-match-count {
font-size: 0.75rem;
color: #6c757d;
white-space: nowrap;
padding: 0 0.5rem;
}
/* Highlighted text in filtered messages */
.filter-highlight {
background-color: #fff3cd;
border-radius: 0.2rem;
padding: 0 0.1rem;
}
/* Hidden messages when filtering */
.message-wrapper.filter-hidden,
.dm-message.filter-hidden {
display: none !important;
}
/* No matches message */
.filter-no-matches {
text-align: center;
padding: 2rem;
color: #6c757d;
}
.filter-no-matches i {
font-size: 2rem;
margin-bottom: 0.5rem;
display: block;
}
/* Mobile responsive filter bar */
@media (max-width: 576px) {
.filter-bar {
padding: 0.5rem;
}
.filter-bar-input {
font-size: 0.85rem;
padding: 0.4rem 0.6rem;
}
.filter-bar-btn {
width: 32px;
height: 32px;
font-size: 0.9rem;
}
}