Files
Vito def5deb113 chore: retire the old admin, gallery and metadata pages (#668) (#669)
* feat(library): open the shelf filtered from a #/library?tag= link (#668)

workspace#/library?tag=<name>&tag=<name>&tag_mode=all|any|untagged opens the
Prompt library with those Tags and that Tag match, as Refine and Browse do.
Old tag bookmarks are sent to this form.

The filter stays in the hash until the shelf has mounted with it, then the
address becomes #/library. A link is rendered even when the shelf is already
open. A link that cannot be read opens the whole shelf and says so.

* feat: old admin, gallery and metadata URLs lead into the workspace (#668)

/prompt_manager/gallery answers 302 to workspace#/images and
/prompt_manager/gallery.html to workspace#/inspect. The Location is relative,
so a reverse-proxy prefix is kept.

/prompt_manager/admin serves a small page that maps the old hash in the
browser (the server never sees it): the dashboard opens the Prompt library,
#/tags opens Tags & categories, and a tag bookmark such as
#/tags/a,b?mode=or opens the Library filtered by those tags
(workspace#/library?tag=a&tag=b&tag_mode=any). The mapping is
web/js/legacy-links.js.

The browser specs that drove the old pages go; the specs that only checked
the old URLs now follow the redirects. The page files themselves are removed
in the next commit.

* chore: delete the old admin, gallery and metadata pages (#668)

Removes web/admin.html, gallery.html, metadata.html, their controllers
(admin.js, gallery.js, tags-page.js) and the ten helper modules only they
loaded, with their unit tests. The vendored Tailwind build and the Makefile
that rebuilt it go too: nothing else used them.

Kept and still tested: comfy-metadata.js (its PromptManagerPair tests move to
comfy-metadata.test.js), api-client.js, gallery-settings.js, png-metadata.js,
cache-ownership.js. The inspector's Copy settings summary keeps its pinned
COPY ALL template as a frozen copy in its test.

The Viewer.js fixture suite drove the old controllers; it is now a smoke of
the vendored build alone. The System coverage table has no row kept in
legacy any more (the four become approved removals), and the table of ids
removed from the old pages goes with the pages it checked. Coverage floors
of the remaining files are unchanged; the deleted files' entries are
removed.

* docs: the old pages are gone, their URLs lead into the workspace (#668)

README lists where each old URL now opens, with a tag-bookmark example and
the workspace link form. README-legacy says the pages it describes were
removed. TESTING.md records D207 (redirects, the bookmark mapping and the
#/library?tag= form), D208 (no editing surface for records used only as a
negative; data and exports kept) and D209 (the four System rows that were
kept in legacy), and no longer says the old pages stay at their URLs.

* fix(library): a Library link leaves title focus to the shell (#668)

The shell focuses a page title on a navigation inside the workspace and never
on the first render. A Library link followed that for the first, but also
focused the title when the page was loaded directly on the link.

* test: compare old-URL landings without building patterns from text (#668)

Code scanning flagged two test lines: a regular expression built from a hash
with only / and # escaped, and a regular expression used to cut <noscript>
and <script> out of the redirect page. The address is now compared by its
parts, and the page's inline script is found by plain string search.

* feat(library): keep the tag filter in the address (#668)

Ruling after the live test: a tag link used to become #/library once the
shelf had its filter, so Reload and Back then Forward showed the whole
Library.

The address now stays #/library?tag=a&tag=b&tag_mode=any|untagged, in one
canonical spelling. It is the truth for Tags and Tag match: Reload, Back and
Forward restore the filter, a change in Refine replaces the address without
a history entry, and #/library (the sidebar link, the old dashboard URL)
always means no tag filter. Search, category, folder, sort and the archived
shelf stay out of the address. The way back from a prompt's page and Browse
on Tags & categories go to the filtered address. A saved view keeps its own
address.
2026-11-21 12:50:35 -08:00

31 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" sizes="32x32" href="lib/brand/icon-32.png">
<link rel="apple-touch-icon" sizes="128x128" href="lib/brand/icon-128.png">
<meta name="color-scheme" content="light dark">
<title>Prompt Manager · Opening the workspace</title>
<style>
body { margin: 0; padding: 24px; font: 14px/1.5 system-ui, sans-serif; background: #1b1b1f; color: #eee; }
a { color: inherit; }
</style>
</head>
<body>
<!-- #668 (D207): the old dashboard and Tags page moved to the workspace. The link stays visible, so a browser
without scripts, or one where the script below fails, still has the way on. -->
<p>This page moved to the workspace. <a href="workspace#/library">Open the Prompt library</a></p>
<script src="js/legacy-links.js"></script>
<script>
// The server never sees the hash, so an old tag bookmark (admin#/tags/a,b?mode=or) is mapped here.
// Replace, so Back does not return here and bounce.
(function () {
var target = "workspace#/library";
try { target = window.LegacyLinks.adminTarget(window.location.hash); } catch (error) { /* the Library */ }
window.location.replace(target);
})();
</script>
</body>
</html>