mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-17 12:22:21 +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,49 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
EDITOR = ROOT / "static/js/galleryEditor.js"
|
||||
|
||||
|
||||
def test_view_menu_block_drives_the_real_menu_items():
|
||||
src = EDITOR.read_text(encoding="utf-8")
|
||||
start = src.index("// --- View menu (Photoshop View")
|
||||
block = src[start:src.index("// No deterministic local op matched", start)]
|
||||
# Drives the real View-menu items so the overlay refresh + persistence run.
|
||||
assert 'document.querySelector(`#ge-view-menu [data-view-action="${action}"]`)' in block
|
||||
for action in ("clear-guides", "snap-grid", "snap", "grid", "rulers"):
|
||||
assert f"'{action}'" in block
|
||||
assert "state.rulersVisible" in block
|
||||
assert "state.gridVisible" in block
|
||||
assert "state.snapEnabled" in block
|
||||
assert "state.snapToGrid" in block
|
||||
|
||||
|
||||
def test_view_menu_requires_an_explicit_view_verb():
|
||||
src = EDITOR.read_text(encoding="utf-8")
|
||||
start = src.index("// --- View menu (Photoshop View")
|
||||
block = src[start:src.index("// No deterministic local op matched", start)]
|
||||
assert "if (/\\b(rulers?|grid|guides?|snap(?:ping)?)\\b/.test(p)) {" in block
|
||||
assert "const viewOff = /\\b(hide|turn\\s+off|switch\\s+off|disable|remove|clear)\\b/.test(p);" in block
|
||||
assert "const viewToggle = /\\btoggle\\b/.test(p);" in block
|
||||
assert "const viewOn = /\\b(show|display|reveal|turn\\s+on|switch\\s+on|enable)\\b/.test(p);" in block
|
||||
# A bare noun with no verb must not flip a toggle.
|
||||
assert "if (viewOn || viewOff || viewToggle) {" in block
|
||||
|
||||
|
||||
def test_view_menu_status_messages():
|
||||
src = EDITOR.read_text(encoding="utf-8")
|
||||
start = src.index("// --- View menu (Photoshop View")
|
||||
block = src[start:src.index("// No deterministic local op matched", start)]
|
||||
assert "_setAiCommandStatus('Cleared the guides.', 'done');" in block
|
||||
assert "`Snapping to the grid ${want ? 'is on' : 'is off'}.`" in block
|
||||
assert "`Snapping ${want ? 'is on' : 'is off'}.`" in block
|
||||
assert "`${label} ${want ? 'shown' : 'hidden'}.`" in block
|
||||
|
||||
|
||||
def test_view_menu_block_sits_after_clipboard_and_before_the_fallthrough():
|
||||
src = EDITOR.read_text(encoding="utf-8")
|
||||
paste = src.index("await _runQuickControlOp('selection.paste', {});")
|
||||
view = src.index("// --- View menu (Photoshop View")
|
||||
fallthrough = src.index("// No deterministic local op matched")
|
||||
assert paste < view < fallthrough
|
||||
Reference in New Issue
Block a user