blob: 78ca94e5ab9d57e17e1f90506467b42e84c90177 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# A file dropped ON the grid opens beside the pane it was dropped on.
#
# Finder and the Dock already reach the app through application(_:open:), but
# that path cannot say WHERE — it opens next to whichever pane happened to have
# focus. A drop knows where the hand was, and in acme that is the whole
# difference: `Look` places the document relative to the pane it runs in.
#
# So a drop is defined as a CLICK followed by `Look`, and nothing more. The
# click focuses the pane under the pointer exactly as a left click there would,
# then the ordinary builtin runs in it. There is no drop concept in the core
# and none was added — everything here the hand could have done itself.
#
# `drop` drives PardesView.drop, one call below performDragOperation, because
# NSDraggingInfo is a protocol with no public conformer: a test that had to
# build one would be testing its own stub. See the trackpad scripts for the
# same reasoning about NSTouch and pressure stages.
start 30 100
wait 8000 $
stable 700 20000
text printf 'first file\n' > one.txt; printf 'second file\n' > two.txt
key enter
wait 8000 $
stable 700 20000
snap booted
# Dropped on the shell: one.txt opens as a document beside it. Absolute,
# because the core resolves a relative Look against the PANE's directory —
# the same absolute path the AppKit side builds out of an NSURL.
drop /private/tmp/pardes-macos-e2e/drop/cwd/one.txt 10 6
stable 700 15000
snap dropped_on_shell
# ...and now the placement is the assertion. Dropping the SECOND file inside
# the pane the first one opened puts it next to that pane, not next to the
# shell — which is only true because the click went where the pointer was.
# Row 5, not row 20: since c3d0b84 a document only claims a COLUMN when both
# halves would still be 100 cells wide, so on this 100-cell grid one.txt
# stacks ABOVE the shell instead of beside it, and row 20 is now the shell.
# The coordinate has to stay inside the pane the comment names.
drop /private/tmp/pardes-macos-e2e/drop/cwd/two.txt 10 5
stable 700 15000
snap dropped_on_document
draw drop
|