mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-16 20:02:20 +02:00
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>
33 lines
1.4 KiB
Python
33 lines
1.4 KiB
Python
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
DOCK = ROOT / "static/js/editor/build/dock.js"
|
|
|
|
|
|
def test_dock_recomputes_tab_overflow_after_layout():
|
|
src = DOCK.read_text(encoding="utf-8")
|
|
# The dock is built before it is attached (width 0), so a one-shot check at
|
|
# build time could never see the real column width. A ResizeObserver plus a
|
|
# post-layout frame keeps the overflow chevron in sync.
|
|
assert "new ResizeObserver" in src
|
|
assert "ro.observe(dock)" in src
|
|
assert "requestAnimationFrame(() => groupEls.forEach(el => syncTabsOverflow(el)))" in src
|
|
|
|
|
|
def test_dock_overflow_chevron_tracks_scroll_width():
|
|
src = DOCK.read_text(encoding="utf-8")
|
|
assert "const overflowing = tabsEl.scrollWidth - tabsEl.clientWidth > 1;" in src
|
|
assert "moreEl.hidden = !overflowing;" in src
|
|
|
|
|
|
def test_dock_hides_partial_tabs_instead_of_clipping_labels():
|
|
src = DOCK.read_text(encoding="utf-8")
|
|
# Reset then hide trailing tabs so no label is clipped mid-word
|
|
# (Photoshop-style tab overflow).
|
|
assert "items.forEach(item => { item.style.display = ''; });" in src
|
|
assert "item.style.display = 'none';" in src
|
|
# The active tab is always kept visible so the open panel keeps its anchor.
|
|
assert "const activeItem = active ? active.closest('.ge-dock-tab-item') : null;" in src
|
|
assert "if (item === activeItem || (!cutting && used + w <= limit + 0.5))" in src
|