fix (tagging): tagging UX

This commit is contained in:
MickaelK 2025-08-08 01:05:53 +10:00
parent cead2ef558
commit 1a97bbf431
2 changed files with 6 additions and 2 deletions

View file

@ -134,6 +134,9 @@ body.touch-no .component_filemanager_shell .component_sidebar h3 img:hover {
color: #f2f2f2;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
.dark-mode .component_filemanager_shell .component_sidebar [data-bind="taglist"] a[aria-selected="true"] {
background: var(--border);
}
.component_filemanager_shell .component_sidebar [data-bind="taglist"] a[aria-selected="true"] svg {
opacity: 1;
}

View file

@ -277,6 +277,7 @@ async function ctrlTagPane(render) {
`);
render($page);
const path = getCurrentPath("(/view/|/files/)");
effect(rxjs.merge(
rxjs.of(tagcache).pipe(rxjs.filter((cache) => cache)),
ajax({
@ -285,7 +286,7 @@ async function ctrlTagPane(render) {
responseType: "json",
body: JSON.stringify({
"tags": [],
"path": getCurrentPath("(/view/|/files/)"),
path,
}),
}).pipe(
rxjs.map(({ responseJSON }) =>
@ -316,7 +317,7 @@ async function ctrlTagPane(render) {
`);
const url = new URL(location.href);
if (url.searchParams.getAll("tag").indexOf(name) === -1) {
$tag.setAttribute("href", forwardURLParams(getCurrentPath() + "?tag=" + name, ["share", "tag"]));
$tag.setAttribute("href", forwardURLParams(toHref("/files" + path.replace(new RegExp("[^\/]+$"), "") + "?tag=" + name), ["share", "tag"]));
} else {
url.searchParams.delete("tag", name);
$tag.setAttribute("href", url.toString());