Fix type chip showing when hidden; make tags clickable to filter
- [hidden] { display: none !important } prevents CSS display overriding
the hidden attribute
- Clicking a tag chip in an entry row filters by that tag
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -388,8 +388,14 @@ function make_entry_row(entry, children_map) {
|
|||||||
const tags_el = row.querySelector('.task-tags');
|
const tags_el = row.querySelector('.task-tags');
|
||||||
for (const tag of entry.tags) {
|
for (const tag of entry.tags) {
|
||||||
const span = document.createElement('span');
|
const span = document.createElement('span');
|
||||||
span.className = 'tag';
|
span.className = 'tag clickable-tag';
|
||||||
span.textContent = tag;
|
span.textContent = tag;
|
||||||
|
span.title = `Filter by tag: ${tag}`;
|
||||||
|
span.addEventListener('click', (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
state.filter_tag = tag;
|
||||||
|
render();
|
||||||
|
});
|
||||||
tags_el.appendChild(span);
|
tags_el.appendChild(span);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
|
[hidden] { display: none !important; }
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: system-ui, sans-serif;
|
font-family: system-ui, sans-serif;
|
||||||
@@ -157,6 +158,9 @@ main { padding: 1.25rem; }
|
|||||||
color: #8899cc;
|
color: #8899cc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.clickable-tag { cursor: pointer; }
|
||||||
|
.clickable-tag:hover { background: #363650; color: #aabbee; }
|
||||||
|
|
||||||
.task-actions { display: flex; gap: 0.4rem; }
|
.task-actions { display: flex; gap: 0.4rem; }
|
||||||
|
|
||||||
.btn-expand {
|
.btn-expand {
|
||||||
|
|||||||
Reference in New Issue
Block a user