Inspector: one row per channel, names from symbols, tweens you can see
The inspector shows what can be changed and nothing else. Ids, spans and the facts the fields below them already said are gone; explanations are hover text. Performance only appears for a face. Every animatable thing is one row: ◀ ◆ ▶, its name, its value, its gap. The arrows jump to the key before and after on every channel. A drawing's keys are an ordinary `shape` row, as are a palette placement's and a tracing layer's holds. The gap switch is about the gap the playhead is in, and on a key the one arriving at it, so keying B asks about A→B. The timeline draws every gap on a channel row, tween or hold, and a click switches it. An instance has no name of its own: it is called what it places, a rename renames the symbol, and `(n)` says how many places show it. Export numbers two placements of one symbol. Instance names in old documents are ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e2ca251ef4
commit
4b780f9e91
13 changed files with 569 additions and 510 deletions
|
|
@ -281,9 +281,10 @@
|
|||
(testing "an unnamed symbol falls back to its id, not to the node's uuid"
|
||||
(is (= "inner" (clip/node-label (update-in c [:symbols :inner] dissoc :name)
|
||||
id n))))
|
||||
(testing "but a name somebody typed on the instance still wins"
|
||||
;; Two instances of one symbol are told apart only by this.
|
||||
(is (= "left eye" (clip/node-label c id (assoc n :name "left eye")))))
|
||||
(testing "and a name left on the instance is not read: it has none of its own"
|
||||
(is (= "mouth" (clip/node-label c id (assoc n :name "left eye")))))
|
||||
(testing "every placement of a symbol is counted"
|
||||
(is (= 1 (clip/uses c :inner))))
|
||||
(testing "and a node that places nothing is labelled by its own name or id"
|
||||
(is (= "lid" (clip/node-label c :lid {:id :lid :kind :rect :name "lid"})))
|
||||
(is (= "lid" (clip/node-label c :lid {:id :lid :kind :rect}))))))
|
||||
|
|
|
|||
|
|
@ -61,26 +61,26 @@
|
|||
#uuid "22222222-2222-4222-8222-222222222222"
|
||||
{:id #uuid "22222222-2222-4222-8222-222222222222"
|
||||
:kind :instance :parent :root :z "a2"
|
||||
:name "8625 right"
|
||||
:source {:symbol :sym/face}}
|
||||
#uuid "11111111-1111-4111-8111-111111111111"
|
||||
{:id #uuid "11111111-1111-4111-8111-111111111111"
|
||||
:kind :instance :parent :root :z "a1"
|
||||
:name "8625 left"
|
||||
:source {:symbol :sym/face}}
|
||||
:a-rect {:id :a-rect :kind :rect :parent :root :z "a3"}}}
|
||||
:sym/face {:frames 40 :nodes {:root {:id :root :kind :group :z "a1"}}}}})
|
||||
|
||||
(deftest the-picker-offers-every-symbol-then-every-instance-in-the-open-one
|
||||
(let [ts (export/targets clip :main)]
|
||||
(is (= ["main" "face" "8625 left" "8625 right"] (mapv :label ts))
|
||||
(is (= ["main" "face" "face 1" "face 2"] (mapv :label ts))
|
||||
"every symbol, then the instances in the open one")
|
||||
(testing "the instances isolate a node in the open symbol and the symbols do not"
|
||||
(is (= [nil nil] (mapv :isolate (take 2 ts))))
|
||||
(is (every? uuid? (mapv :isolate (drop 2 ts))))
|
||||
(is (every? #(= :main (:symbol %)) (drop 2 ts))))
|
||||
(testing "ordered by label, because a uuid sorts at random"
|
||||
(is (= ["8625 left" "8625 right"] (mapv :label (drop 2 ts)))))
|
||||
(testing "one symbol placed twice is numbered in stacking order, because a uuid sorts at random"
|
||||
(is (= [#uuid "11111111-1111-4111-8111-111111111111"
|
||||
#uuid "22222222-2222-4222-8222-222222222222"]
|
||||
(mapv :isolate (drop 2 ts)))))
|
||||
(testing "and a node that is not an instance is not offered"
|
||||
(is (not-any? #{"a-rect"} (map :label ts))))))
|
||||
|
||||
|
|
|
|||
|
|
@ -562,31 +562,26 @@ async function main() {
|
|||
await page.eval(SEEK(f));
|
||||
await sleep(100);
|
||||
check(await page.eval(`(() => {
|
||||
const button = [...document.querySelectorAll('.params button')]
|
||||
.find(b => b.textContent === 'drawing key here');
|
||||
if (!button || button.disabled) return false;
|
||||
const button = document.querySelector('.params .chan[data-channel="geom pts"] button.key');
|
||||
if (!button || button.disabled || button.classList.contains('on')) return false;
|
||||
button.click();
|
||||
return true;
|
||||
})()`), `a drawing key can be added at frame ${f}`);
|
||||
await sleep(100);
|
||||
}
|
||||
await page.eval(SEEK(8));
|
||||
// Standing on key 16, the gap switch is about the gap arriving at it, 8 → 16.
|
||||
const GAP = `document.querySelector('.params .chan[data-channel="geom pts"] button.gap')`;
|
||||
await page.eval(SEEK(16));
|
||||
await sleep(100);
|
||||
const tweenSelected = await page.eval(`(() => {
|
||||
const label = [...document.querySelectorAll('.params label')]
|
||||
.find(el => el.textContent.startsWith('key 8 → 16'));
|
||||
const select = label?.querySelector('select');
|
||||
if (!select) return false;
|
||||
select.value = 'linear';
|
||||
select.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
const gap = ${GAP};
|
||||
if (!gap || gap.getAttribute('aria-label') !== 'hold') return false;
|
||||
gap.click();
|
||||
return true;
|
||||
})()`);
|
||||
await sleep(100);
|
||||
check(tweenSelected && await page.eval(`(() => {
|
||||
const label = [...document.querySelectorAll('.params label')]
|
||||
.find(el => el.textContent.startsWith('key 8 → 16'));
|
||||
return label?.querySelector('select')?.value === 'linear';
|
||||
})()`), 'the second drawing gap can be set to tween');
|
||||
check(tweenSelected && await page.eval(`${GAP}?.getAttribute('aria-label') === 'tween'`),
|
||||
'the second drawing gap can be set to tween');
|
||||
check((await statusMatching(/saved r\d+/)) !== null,
|
||||
'the painted shape saves by itself', await page.eval(STATUS));
|
||||
check(await fromMenu(MENU_PICK_NEWEST), 'the painted document can be reopened');
|
||||
|
|
@ -610,13 +605,10 @@ async function main() {
|
|||
re_frame.core.dispatch_sync(c.vector(k('arthur.events.ui/select'),
|
||||
c.vector(k('node'), k('main'), id, c.vector(id))));
|
||||
})()`);
|
||||
await page.eval(SEEK(8));
|
||||
await page.eval(SEEK(16));
|
||||
await sleep(100);
|
||||
check(await page.eval(`(() => {
|
||||
const label = [...document.querySelectorAll('.params label')]
|
||||
.find(el => el.textContent.startsWith('key 8 → 16'));
|
||||
return label?.querySelector('select')?.value === 'linear';
|
||||
})()`), 'the per-gap tween setting survives the project round trip');
|
||||
check(await page.eval(`${GAP}?.getAttribute('aria-label') === 'tween'`),
|
||||
'the per-gap tween setting survives the project round trip');
|
||||
|
||||
// The local 8625 study is optional in a fresh test database. When present,
|
||||
// tune its shared symbol while its stage is playing.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue