mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-17 04:12:24 +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,34 @@
|
||||
"""Quick Edit sets a layer's opacity (Photoshop Layers-panel Opacity field).
|
||||
|
||||
"Set the layer opacity to 50%" previously fell through the command box to the
|
||||
keyword planner, which had no intent for it, so nothing happened. It now routes
|
||||
deterministically to the `layers.setOpacity` op.
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
EDITOR = (ROOT / "static" / "js" / "galleryEditor.js").read_text(encoding="utf-8")
|
||||
SERVER = (ROOT / "routes" / "editor_agent_routes.py").read_text(encoding="utf-8")
|
||||
COVERAGE = (ROOT / "docs" / "QUICKEDIT_COVERAGE.md").read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def test_opacity_routing_present():
|
||||
assert "// --- Layer ▸ Opacity (Photoshop Layers-panel Opacity field, deterministic) ---" in EDITOR
|
||||
assert "await _runQuickControlOp('layers.setOpacity', { opacity: _val });" in EDITOR
|
||||
assert "const _opWord = /\\b(?:opacity|opaque|transparen(?:t|cy))\\b/.test(p);" in EDITOR
|
||||
|
||||
|
||||
def test_opacity_routing_precedes_layer_management():
|
||||
routing = EDITOR.index("await _runQuickControlOp('layers.setOpacity', { opacity: _val });")
|
||||
assert routing < EDITOR.index("// --- Layer management commands ---")
|
||||
|
||||
|
||||
def test_setopacity_op_in_both_catalogs():
|
||||
assert "'layers.setOpacity':" in EDITOR
|
||||
assert '"layers.setOpacity"' in SERVER
|
||||
|
||||
|
||||
def test_coverage_doc_marks_layer_opacity_ok():
|
||||
row = next(line for line in COVERAGE.splitlines() if "Layer → Opacity" in line)
|
||||
assert "OK" in row
|
||||
assert "fast path" in row
|
||||
Reference in New Issue
Block a user