mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-16 20:02:20 +02:00
feat(photo-editor): Ajax Image Editor client (Photoshop-parity tools)
Photoshop-parity editor client: layers, selection/masking, brushes,
smart filters, LUT import, Quick Edit, mobile gestures, workspaces,
batch operations, and the service-worker versioning (v978->v1006).
Source: vendor/photocraft (ad1cff44) photo-editor client files, merged
onto upstream/dev (a8c147b2). Conflict resolution documented in
pr_work/A_conflicts.md; editor files taken from vendor/photocraft
(upstream's editor is an earlier snapshot of the same feature).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c74f475679
commit
5fac693c1c
@@ -0,0 +1,32 @@
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
JS = (ROOT / "static" / "js" / "galleryEditor.js").read_text()
|
||||
ROUTES = (ROOT / "routes" / "gallery" / "gallery_routes.py").read_text()
|
||||
SW = (ROOT / "static" / "sw.js").read_text()
|
||||
|
||||
|
||||
def test_client_image_mode_generates():
|
||||
assert "if (mode === 'image')" in JS
|
||||
assert "_runQuickControlOp('ai.generateImage'" in JS
|
||||
assert "Generating an image…" in JS
|
||||
assert "Generated an image." in JS
|
||||
assert "Could not generate an image:" in JS
|
||||
|
||||
|
||||
def test_client_image_mode_runs_after_harmonize():
|
||||
harm = JS.index("_isHarmonizeIntent(prompt))")
|
||||
img = JS.index("if (mode === 'image')")
|
||||
assert harm < img
|
||||
|
||||
|
||||
def test_server_generate_route_exists():
|
||||
assert '@router.post("/api/image/generate")' in ROUTES
|
||||
assert "do_generate_image" in ROUTES
|
||||
assert "can_generate_images" in ROUTES.split('@router.post("/api/image/generate")', 1)[1][:1200]
|
||||
|
||||
|
||||
def test_sw_cache_bumped():
|
||||
m = re.search(r"CACHE_NAME = '(odysseus-v\d+-pr40-editor-precache)'", SW)
|
||||
assert m and re.fullmatch(r"odysseus-v\d+-pr40-editor-precache", m.group(1))
|
||||
Reference in New Issue
Block a user