@lukekaalim/act-insight 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/InsightApp.module.css +36 -0
- package/InsightApp2.ts +82 -0
- package/TreeViewer.module.css +3 -8
- package/TreeViewer.ts +16 -12
- package/Virtual.ts +29 -11
- package/assets/icons/ancestor_column.png +0 -0
- package/assets/icons/ancestor_column.svg +26 -0
- package/assets/icons/ancestor_skip_row_column.png +0 -0
- package/assets/icons/ancestor_skip_row_column.svg +52 -0
- package/assets/icons/breakpoint.png +0 -0
- package/assets/icons/breakpoint.svg +33 -0
- package/assets/icons/breakpoint_arrow.png +0 -0
- package/assets/icons/breakpoint_arrow.svg +22 -0
- package/assets/icons/breakpoint_arrow_paused.png +0 -0
- package/assets/icons/breakpoint_arrow_paused.svg +38 -0
- package/assets/icons/breakpoint_panel.png +0 -0
- package/assets/icons/breakpoint_panel.svg +121 -0
- package/assets/icons/breakpoint_unset.png +0 -0
- package/assets/icons/breakpoint_unset.svg +26 -0
- package/assets/icons/bug.png +0 -0
- package/assets/icons/bug.svg +65 -0
- package/assets/icons/children.png +0 -0
- package/assets/icons/children.svg +38 -0
- package/assets/icons/collapse.png +0 -0
- package/assets/icons/collapse.svg +38 -0
- package/assets/icons/commit.png +0 -0
- package/assets/icons/commit.svg +30 -0
- package/assets/icons/commit_tree.png +0 -0
- package/assets/icons/commit_tree.svg +44 -0
- package/assets/icons/effect.png +0 -0
- package/assets/icons/effect.svg +28 -0
- package/assets/icons/expand.png +0 -0
- package/assets/icons/expand.svg +47 -0
- package/assets/icons/eye.png +0 -0
- package/assets/icons/eye.svg +36 -0
- package/assets/icons/eye_closed.png +0 -0
- package/assets/icons/eye_closed.svg +32 -0
- package/assets/icons/filter.png +0 -0
- package/assets/icons/filter.svg +22 -0
- package/assets/icons/graph.png +0 -0
- package/assets/icons/graph.svg +129 -0
- package/assets/icons/history_list.png +0 -0
- package/assets/icons/history_list.svg +60 -0
- package/assets/icons/hook.png +0 -0
- package/assets/icons/hook.svg +22 -0
- package/assets/icons/index.ts +76 -0
- package/assets/icons/inspector_panel.png +0 -0
- package/assets/icons/inspector_panel.svg +135 -0
- package/assets/icons/magnifying_glass.png +0 -0
- package/assets/icons/magnifying_glass.svg +39 -0
- package/assets/icons/pause.png +0 -0
- package/assets/icons/pause.svg +34 -0
- package/assets/icons/play.png +0 -0
- package/assets/icons/play.svg +23 -0
- package/assets/icons/reload.png +0 -0
- package/assets/icons/reload.svg +39 -0
- package/assets/icons/selection.png +0 -0
- package/assets/icons/selection.svg +22 -0
- package/assets/icons/side_effects.png +0 -0
- package/assets/icons/side_effects.svg +48 -0
- package/assets/icons/skip.png +0 -0
- package/assets/icons/skip.svg +22 -0
- package/assets/icons/source.svg +1366 -0
- package/assets/icons/step.png +0 -0
- package/assets/icons/step.svg +51 -0
- package/assets/icons/step_over_children.png +0 -0
- package/assets/icons/step_over_children.svg +57 -0
- package/assets/icons/thread.png +0 -0
- package/assets/icons/thread.svg +32 -0
- package/assets/icons/tree_column.png +0 -0
- package/assets/icons/tree_column.svg +26 -0
- package/assets/icons/tree_end.png +0 -0
- package/assets/icons/tree_end.svg +35 -0
- package/assets/icons/tree_junction.png +0 -0
- package/assets/icons/tree_junction.svg +35 -0
- package/assets/icons/vertical_grab_handle.png +0 -0
- package/assets/icons/vertical_grab_handle.svg +36 -0
- package/components/BreakpointPanel.ts +110 -0
- package/components/BreakpointToggle.ts +14 -0
- package/components/Button.ts +53 -0
- package/components/Checkbox.ts +17 -0
- package/components/CommitInspector.ts +161 -0
- package/components/CommitTree.ts +295 -0
- package/components/ControlBar.ts +60 -0
- package/components/EffectTable.ts +125 -0
- package/components/FiltersPanel.ts +45 -0
- package/components/HistoryList.ts +0 -0
- package/components/InspectorPanel.ts +54 -0
- package/components/PlaybackBar.ts +42 -0
- package/components/ThreadInspector.ts +26 -0
- package/components/index.module.css +414 -0
- package/lib/controller.ts +222 -0
- package/lib/list.ts +82 -0
- package/lib/selection.ts +32 -0
- package/package.json +4 -4
- package/public/icons/icons.svg +520 -0
- package/public/icons/icons__breakpoint.png +0 -0
- package/public/icons/icons__breakpoint.svg +30 -0
- package/public/icons/icons__breakpoint_panel.png +0 -0
- package/public/icons/icons__breakpoint_panel.svg +121 -0
- package/public/icons/icons__children.png +0 -0
- package/public/icons/icons__children.svg +38 -0
- package/public/icons/icons__eye.png +0 -0
- package/public/icons/icons__eye.svg +36 -0
- package/public/icons/icons__inspector_panel.png +0 -0
- package/public/icons/icons__inspector_panel.svg +131 -0
- package/public/icons/icons__magnifying_glass.png +0 -0
- package/public/icons/icons__magnifying_glass.svg +39 -0
- package/public/icons/icons__pause.png +0 -0
- package/public/icons/icons__pause.svg +34 -0
- package/public/icons/icons__play.png +0 -0
- package/public/icons/icons__play.svg +23 -0
- package/public/icons/icons__skip.png +0 -0
- package/public/icons/icons__skip.svg +22 -0
- package/public/icons/icons__step.png +0 -0
- package/public/icons/icons__step.svg +51 -0
- package/utils.ts +71 -7
- package/InsightApp.ts +0 -404
- package/MenuBar.module.css +0 -18
- package/MenuBar.ts +0 -39
- package/ScheduleControls.ts +0 -61
- package/lookup.ts +0 -185
package/lookup.ts
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { CommitReport, DeltaReport, ElementReport, ThreadReport, TreeReport, WorkTaskReport } from "@lukekaalim/act-debug";
|
|
2
|
-
import { CommitID, CommitVersion, WorkThread2 } from "@lukekaalim/act-recon";
|
|
3
|
-
|
|
4
|
-
export class MutableCommitRef {
|
|
5
|
-
element: ElementReport;
|
|
6
|
-
id: CommitID;
|
|
7
|
-
version: CommitVersion;
|
|
8
|
-
distance: number;
|
|
9
|
-
|
|
10
|
-
report: CommitReport;
|
|
11
|
-
|
|
12
|
-
children: MutableCommitRef[] = [];
|
|
13
|
-
parent: null | MutableCommitRef = null;
|
|
14
|
-
|
|
15
|
-
constructor(commit: CommitReport) {
|
|
16
|
-
this.element = commit.element;
|
|
17
|
-
this.id = commit.id;
|
|
18
|
-
this.version = commit.version;
|
|
19
|
-
this.distance = commit.distance;
|
|
20
|
-
|
|
21
|
-
this.report = commit;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
update(commit: CommitReport) {
|
|
25
|
-
this.report = commit;
|
|
26
|
-
this.version = commit.version;
|
|
27
|
-
this.element = commit.element;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
resolve(lookupMap: Map<CommitID, MutableCommitRef>) {
|
|
31
|
-
if (this.report.parent !== null)
|
|
32
|
-
this.linkParent(this.report.parent, lookupMap);
|
|
33
|
-
this.linkChildren(this.report.children, lookupMap);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
linkParent(parent: CommitID, lookupMap: Map<CommitID, MutableCommitRef>) {
|
|
37
|
-
this.parent = lookupMap.get(parent) || null;
|
|
38
|
-
}
|
|
39
|
-
linkChildren(children: CommitID[], lookupMap: Map<CommitID, MutableCommitRef>) {
|
|
40
|
-
this.children = children.map(c => lookupMap.get(c)).filter(x => !!x);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export class CommitLookupCache {
|
|
45
|
-
map: Map<CommitID, CommitReport> = new Map();
|
|
46
|
-
roots: Set<CommitID> = new Set();
|
|
47
|
-
|
|
48
|
-
setTree(tree: TreeReport) {
|
|
49
|
-
this.map.clear();
|
|
50
|
-
this.roots.clear();
|
|
51
|
-
|
|
52
|
-
for (const commit of tree.commits) {
|
|
53
|
-
this.map.set(commit.id, commit)
|
|
54
|
-
if (!commit.parent)
|
|
55
|
-
this.roots.add(commit.id);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
ingest(delta: DeltaReport) {
|
|
60
|
-
for (const create of delta.created) {
|
|
61
|
-
this.map.set(create.id, create);
|
|
62
|
-
if (!create.parent)
|
|
63
|
-
this.roots.add(create.id);
|
|
64
|
-
}
|
|
65
|
-
for (const update of delta.updated)
|
|
66
|
-
this.map.set(update.id, update);
|
|
67
|
-
for (const remove of delta.removed) {
|
|
68
|
-
this.map.delete(remove.id);
|
|
69
|
-
this.roots.delete(remove.id);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* A bunch of relevant data for a Tree in the progress of changing
|
|
76
|
-
*/
|
|
77
|
-
export class ThreadLookupCache {
|
|
78
|
-
canon: CommitLookupCache;
|
|
79
|
-
|
|
80
|
-
report: DeltaReport | null = null;
|
|
81
|
-
thread: ThreadReport | null = null;
|
|
82
|
-
|
|
83
|
-
constructor(canon: CommitLookupCache) {
|
|
84
|
-
this.canon = canon;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
roots: Set<CommitID> = new Set();
|
|
88
|
-
|
|
89
|
-
created: Set<CommitID> = new Set();
|
|
90
|
-
updated: Set<CommitID> = new Set();
|
|
91
|
-
removed: Set<CommitID> = new Set();
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* An up to date map of the tree, plus deleted notes in this delta
|
|
95
|
-
*/
|
|
96
|
-
all: Map<CommitID, CommitReport> = new Map();
|
|
97
|
-
|
|
98
|
-
nextTask: WorkTaskReport | null = null;
|
|
99
|
-
prevTask: WorkTaskReport | null = null;
|
|
100
|
-
|
|
101
|
-
allTasks: Map<CommitID, WorkTaskReport> = new Map();
|
|
102
|
-
|
|
103
|
-
targets: Set<CommitID> = new Set();
|
|
104
|
-
visited: Set<CommitID> = new Set();
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Clear the delta cache
|
|
108
|
-
*/
|
|
109
|
-
reset() {
|
|
110
|
-
this.roots = new Set(this.canon.roots)
|
|
111
|
-
this.all = new Map(this.canon.map);
|
|
112
|
-
this.allTasks = new Map();
|
|
113
|
-
|
|
114
|
-
this.nextTask = null;
|
|
115
|
-
this.prevTask = null;
|
|
116
|
-
this.report = null;
|
|
117
|
-
|
|
118
|
-
this.created.clear();
|
|
119
|
-
this.updated.clear();
|
|
120
|
-
this.removed.clear();
|
|
121
|
-
|
|
122
|
-
this.targets.clear();
|
|
123
|
-
this.visited.clear();
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
ingestThread(thread: ThreadReport) {
|
|
127
|
-
this.thread = thread;
|
|
128
|
-
|
|
129
|
-
this.nextTask = thread.pendingTasks[thread.pendingTasks.length - 1];
|
|
130
|
-
this.targets = new Set(thread.reasons.map(reason => reason.target));
|
|
131
|
-
this.visited = new Set(thread.visited)
|
|
132
|
-
this.allTasks = new Map(thread.pendingTasks.map(task => [task.id, task]))
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
ingestDelta(delta: DeltaReport) {
|
|
136
|
-
this.report = delta;
|
|
137
|
-
const createdIds = new Set(delta.created.map(c => c.id));
|
|
138
|
-
|
|
139
|
-
for (const commit of delta.created) {
|
|
140
|
-
this.created.add(commit.id)
|
|
141
|
-
|
|
142
|
-
const children = [...new Set(commit.children.filter(c => this.all.has(c) || createdIds.has(c)))]
|
|
143
|
-
this.all.set(commit.id, { ...commit, children });
|
|
144
|
-
|
|
145
|
-
if (!commit.parent)
|
|
146
|
-
this.roots.add(commit.id);
|
|
147
|
-
}
|
|
148
|
-
for (const commit of delta.updated) {
|
|
149
|
-
const existingCommit = this.canon.map.get(commit.id) as CommitReport;
|
|
150
|
-
|
|
151
|
-
const children = [...new Set([
|
|
152
|
-
...commit.children.filter(c => this.all.has(c)),
|
|
153
|
-
...existingCommit.children,
|
|
154
|
-
])]
|
|
155
|
-
const mergedCommitReport = { ...commit, children };
|
|
156
|
-
|
|
157
|
-
this.updated.add(commit.id)
|
|
158
|
-
this.all.set(commit.id, mergedCommitReport)
|
|
159
|
-
}
|
|
160
|
-
for (const commit of delta.removed) {
|
|
161
|
-
this.removed.add(commit.id);
|
|
162
|
-
this.all.set(commit.id, commit);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
getFlat() {
|
|
167
|
-
const pending: CommitReport[] = [...this.roots.values()]
|
|
168
|
-
.map(root => this.all.get(root))
|
|
169
|
-
.filter(x => !!x);
|
|
170
|
-
|
|
171
|
-
const flat: CommitReport[] = [];
|
|
172
|
-
|
|
173
|
-
while (pending.length > 0) {
|
|
174
|
-
const commit = pending.pop() as CommitReport;
|
|
175
|
-
flat.push(commit);
|
|
176
|
-
for (const childId of [...commit.children].reverse()) {
|
|
177
|
-
const child = this.all.get(childId);
|
|
178
|
-
if (child)
|
|
179
|
-
pending.push(child);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
return flat;
|
|
184
|
-
}
|
|
185
|
-
}
|