reslop 0.2.5 → 0.2.7
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 +22 -1
- package/LICENSE +1 -1
- package/README.md +11 -11
- package/bin/reslop.js +3 -8
- package/lib/ansi.js +72 -19
- package/lib/api.js +1 -1
- package/lib/capabilities.js +8 -8
- package/lib/cli.js +61 -75
- package/lib/clipboard.js +39 -47
- package/lib/dashboard/git.js +128 -0
- package/lib/dashboard/model.js +357 -0
- package/lib/dashboard/npm.js +290 -0
- package/lib/dashboard/tree.js +278 -0
- package/lib/deps-diff.js +197 -402
- package/lib/deps.js +113 -240
- package/lib/detect.js +8 -18
- package/lib/diff/align.js +41 -113
- package/lib/diff/diff.js +12 -43
- package/lib/diff/display.js +25 -36
- package/lib/diff/edit.js +6 -20
- package/lib/diff/inline.js +76 -144
- package/lib/diff/items.js +33 -47
- package/lib/diff/parse.js +28 -56
- package/lib/diff/patch.js +12 -33
- package/lib/diff/unit.js +79 -178
- package/lib/editor.js +52 -69
- package/lib/files.js +79 -91
- package/lib/find.js +61 -0
- package/lib/git-branches.js +254 -416
- package/lib/git-deps.js +148 -272
- package/lib/git-reword-todo.js +5 -13
- package/lib/git-worktree.js +161 -214
- package/lib/git.js +21 -49
- package/lib/github.js +67 -181
- package/lib/gitlab.js +40 -90
- package/lib/highlight/bash.js +55 -177
- package/lib/highlight/core.js +155 -141
- package/lib/highlight/css.js +25 -58
- package/lib/highlight/csv.js +19 -37
- package/lib/highlight/dart.js +72 -213
- package/lib/highlight/dot.js +14 -14
- package/lib/highlight/html.js +42 -63
- package/lib/highlight/js.js +177 -506
- package/lib/highlight/json.js +17 -37
- package/lib/highlight/log.js +19 -25
- package/lib/highlight/txt.js +7 -10
- package/lib/highlight.js +17 -46
- package/lib/keys.js +75 -83
- package/lib/manifest.js +67 -126
- package/lib/npm-commands.js +120 -169
- package/lib/remote.js +140 -190
- package/lib/render/branches.js +63 -61
- package/lib/render/chrome.js +412 -347
- package/lib/render/commits.js +160 -361
- package/lib/render/dash-activity.js +212 -0
- package/lib/render/dash-blocks.js +496 -0
- package/lib/render/dash-table.js +295 -0
- package/lib/render/dashboard.js +62 -0
- package/lib/render/diff.js +123 -258
- package/lib/render/files.js +60 -86
- package/lib/render/frame.js +82 -117
- package/lib/render/notes.js +150 -210
- package/lib/render/npm.js +213 -177
- package/lib/render/packages.js +93 -0
- package/lib/render/present.js +4 -11
- package/lib/render/primitives.js +77 -172
- package/lib/render/render.js +5 -14
- package/lib/render/report.js +43 -0
- package/lib/render/repos.js +226 -0
- package/lib/render/search.js +25 -0
- package/lib/render/tiles.js +355 -0
- package/lib/render/unit.js +15 -31
- package/lib/report-model.js +110 -33
- package/lib/report-parse.js +56 -37
- package/lib/report-render.js +102 -59
- package/lib/report-run.js +87 -77
- package/lib/report-test.js +221 -99
- package/lib/report-tools.js +96 -154
- package/lib/review-merge.js +33 -41
- package/lib/review.js +69 -129
- package/lib/runs.js +225 -0
- package/lib/select.js +53 -91
- package/lib/session/accessors.js +14 -21
- package/lib/session/actions.js +189 -65
- package/lib/session/branches.js +164 -222
- package/lib/session/change-actions.js +49 -119
- package/lib/session/commit.js +298 -352
- package/lib/session/compose.js +572 -715
- package/lib/session/dashboard.js +530 -0
- package/lib/session/dispatch.js +197 -171
- package/lib/session/files-pane.js +92 -45
- package/lib/session/find.js +94 -0
- package/lib/session/items.js +6 -17
- package/lib/session/lifecycle.js +420 -466
- package/lib/session/load.js +1 -14
- package/lib/session/navigation.js +4 -2
- package/lib/session/npm.js +403 -420
- package/lib/session/ops.js +5 -13
- package/lib/session/packages.js +143 -0
- package/lib/session/pointer.js +30 -14
- package/lib/session/progress.js +39 -30
- package/lib/session/review.js +1 -3
- package/lib/session/tasks.js +277 -236
- package/lib/session/templates.js +51 -59
- package/lib/session/terminal.js +85 -132
- package/lib/session/view.js +59 -80
- package/lib/session/watch.js +201 -212
- package/lib/session/workspace.js +455 -0
- package/lib/session.js +95 -161
- package/lib/update.js +44 -111
- package/lib/utilities.js +46 -88
- package/lib/workspace.js +166 -0
- package/lib/wrap.js +29 -55
- package/package.json +1 -1
package/lib/session/terminal.js
CHANGED
|
@@ -10,152 +10,105 @@ const LEAVE_TERM =
|
|
|
10
10
|
'\x1b[?1006l\x1b[?1002l\x1b[?7h\x1b[0 q\x1b[?12l\x1b[?25h\x1b[?1049l';
|
|
11
11
|
|
|
12
12
|
const sameCursor = (a, b) => {
|
|
13
|
-
if (!a
|
|
14
|
-
if (!a || !b) return false;
|
|
13
|
+
if (!a || !b) return !a && !b;
|
|
15
14
|
return a.x === b.x && a.y === b.y;
|
|
16
15
|
};
|
|
17
16
|
|
|
18
|
-
const
|
|
17
|
+
const sameSize = (a, b) =>
|
|
18
|
+
a !== null && a.width === b.width && a.height === b.height;
|
|
19
|
+
|
|
20
|
+
class Terminal {
|
|
21
|
+
constructor({ stdin = null, stdout, proc = process }) {
|
|
22
|
+
this.stdin = stdin;
|
|
23
|
+
this.stdout = stdout;
|
|
24
|
+
this.proc = proc;
|
|
25
|
+
this.timers = new Map();
|
|
26
|
+
this.disposers = [];
|
|
27
|
+
this.open = false;
|
|
28
|
+
this.disposed = false;
|
|
29
|
+
this.resetCache();
|
|
30
|
+
}
|
|
19
31
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
32
|
+
resetCache() {
|
|
33
|
+
this.carry = '';
|
|
34
|
+
this.lastFrame = null;
|
|
35
|
+
this.lastCursor = null;
|
|
36
|
+
this.lastSize = null;
|
|
37
|
+
}
|
|
26
38
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
api.timers.delete(name);
|
|
31
|
-
fn();
|
|
32
|
-
}, ms);
|
|
33
|
-
if (typeof id.unref === 'function') id.unref();
|
|
34
|
-
api.timers.set(name, id);
|
|
35
|
-
};
|
|
39
|
+
hasTimer(name) {
|
|
40
|
+
return this.timers.has(name);
|
|
41
|
+
}
|
|
36
42
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
cancel(name) {
|
|
44
|
+
const id = this.timers.get(name);
|
|
45
|
+
if (id === undefined) return;
|
|
46
|
+
clearTimeout(id);
|
|
47
|
+
this.timers.delete(name);
|
|
48
|
+
}
|
|
40
49
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
50
|
+
later(name, fn, ms) {
|
|
51
|
+
if (this.disposed || this.timers.has(name)) return;
|
|
52
|
+
const id = setTimeout(() => {
|
|
53
|
+
this.timers.delete(name);
|
|
54
|
+
fn();
|
|
55
|
+
}, ms);
|
|
56
|
+
id.unref();
|
|
57
|
+
this.timers.set(name, id);
|
|
45
58
|
}
|
|
46
|
-
};
|
|
47
59
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (stdin && typeof stdin.resume === 'function') stdin.resume();
|
|
53
|
-
stdout.write(ENTER_TERM);
|
|
54
|
-
state.open = true;
|
|
55
|
-
};
|
|
60
|
+
clearTimers() {
|
|
61
|
+
for (const id of this.timers.values()) clearTimeout(id);
|
|
62
|
+
this.timers.clear();
|
|
63
|
+
}
|
|
56
64
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
enter() {
|
|
66
|
+
if (this.disposed) return;
|
|
67
|
+
const stdin = this.stdin;
|
|
68
|
+
if (stdin && stdin.setRawMode) stdin.setRawMode(true);
|
|
69
|
+
if (stdin && stdin.resume) stdin.resume();
|
|
70
|
+
this.stdout.write(ENTER_TERM);
|
|
71
|
+
this.open = true;
|
|
72
|
+
}
|
|
63
73
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
74
|
+
leave() {
|
|
75
|
+
if (!this.open) return;
|
|
76
|
+
this.stdout.write(LEAVE_TERM);
|
|
77
|
+
if (this.stdin && this.stdin.setRawMode) this.stdin.setRawMode(false);
|
|
78
|
+
this.open = false;
|
|
79
|
+
}
|
|
70
80
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
81
|
+
close() {
|
|
82
|
+
this.stopListening();
|
|
83
|
+
this.clearTimers();
|
|
84
|
+
this.leave();
|
|
85
|
+
this.disposed = true;
|
|
86
|
+
}
|
|
77
87
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
api.disposers.push(watchResize(api.stdout, api.proc, onResize));
|
|
84
|
-
};
|
|
88
|
+
startListening({ onData, onResize }) {
|
|
89
|
+
if (this.disposed) return;
|
|
90
|
+
this.disposers.push(listen(this.stdin, 'data', onData));
|
|
91
|
+
this.disposers.push(watchResize(this.stdout, this.proc, onResize));
|
|
92
|
+
}
|
|
85
93
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const lastSize = api.state.lastSize;
|
|
89
|
-
const resized =
|
|
90
|
-
!lastSize ||
|
|
91
|
-
lastSize.width !== size.width ||
|
|
92
|
-
lastSize.height !== size.height;
|
|
93
|
-
if (
|
|
94
|
-
!resized &&
|
|
95
|
-
api.state.lastFrame &&
|
|
96
|
-
api.state.lastFrame.text === frame.text
|
|
97
|
-
) {
|
|
98
|
-
api.state.lastFrame = frame;
|
|
99
|
-
if (sameCursor(api.state.lastPresentedCursor, cursor)) return;
|
|
100
|
-
api.state.lastPresentedCursor = cursor;
|
|
101
|
-
api.stdout.write(presentCursor(cursor));
|
|
102
|
-
return;
|
|
94
|
+
stopListening() {
|
|
95
|
+
while (this.disposers.length) this.disposers.pop()();
|
|
103
96
|
}
|
|
104
|
-
api.state.lastSize = size;
|
|
105
|
-
api.state.lastFrame = frame;
|
|
106
|
-
api.state.lastPresentedCursor = cursor;
|
|
107
|
-
api.stdout.write(presentRows(frame.rows, { clear: resized, cursor }));
|
|
108
|
-
};
|
|
109
97
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
state,
|
|
126
|
-
};
|
|
127
|
-
return {
|
|
128
|
-
get lastFrame() {
|
|
129
|
-
return state.lastFrame;
|
|
130
|
-
},
|
|
131
|
-
get lastSize() {
|
|
132
|
-
return state.lastSize;
|
|
133
|
-
},
|
|
134
|
-
get carry() {
|
|
135
|
-
return state.carry;
|
|
136
|
-
},
|
|
137
|
-
set carry(value) {
|
|
138
|
-
state.carry = value;
|
|
139
|
-
},
|
|
140
|
-
get disposed() {
|
|
141
|
-
return state.disposed;
|
|
142
|
-
},
|
|
143
|
-
enter: () => enter(api),
|
|
144
|
-
leave: () => leave(api),
|
|
145
|
-
close: () => close(api),
|
|
146
|
-
paint: (frame, size, cursor) => paint(api, frame, size, cursor),
|
|
147
|
-
startListening: (handlers) => startListening(api, handlers),
|
|
148
|
-
stopListening: () => stopListening(api),
|
|
149
|
-
later: (name, fn, ms) => later(api, name, fn, ms),
|
|
150
|
-
cancel: (name) => cancel(api, name),
|
|
151
|
-
clearTimers: () => clearTimers(api),
|
|
152
|
-
hasTimer: (name) => hasTimer(api, name),
|
|
153
|
-
resetCache: () => resetCache(api),
|
|
154
|
-
};
|
|
155
|
-
};
|
|
98
|
+
paint(frame, size, cursor) {
|
|
99
|
+
if (this.disposed) return;
|
|
100
|
+
const resized = !sameSize(this.lastSize, size);
|
|
101
|
+
const last = this.lastFrame;
|
|
102
|
+
this.lastFrame = frame;
|
|
103
|
+
if (!resized && last && last.text === frame.text) {
|
|
104
|
+
if (sameCursor(this.lastCursor, cursor)) return;
|
|
105
|
+
this.lastCursor = cursor;
|
|
106
|
+
return void this.stdout.write(presentCursor(cursor));
|
|
107
|
+
}
|
|
108
|
+
this.lastSize = size;
|
|
109
|
+
this.lastCursor = cursor;
|
|
110
|
+
this.stdout.write(presentRows(frame.rows, { clear: resized, cursor }));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
156
113
|
|
|
157
|
-
module.exports = {
|
|
158
|
-
ENTER_TERM,
|
|
159
|
-
LEAVE_TERM,
|
|
160
|
-
createTerminal,
|
|
161
|
-
};
|
|
114
|
+
module.exports = { ENTER_TERM, LEAVE_TERM, Terminal };
|
package/lib/session/view.js
CHANGED
|
@@ -5,11 +5,12 @@ const path = require('node:path');
|
|
|
5
5
|
const files = require('../files.js');
|
|
6
6
|
const commit = require('./commit.js');
|
|
7
7
|
const { listedCommits } = commit;
|
|
8
|
-
const { fileEntries, fileTotals
|
|
8
|
+
const { fileEntries, fileTotals } = files;
|
|
9
9
|
const review = require('../review.js');
|
|
10
10
|
const { noteCounts } = review;
|
|
11
11
|
const diff = require('../diff/diff.js');
|
|
12
12
|
const { unitLines, itemsForPath, splitEditor, mergeEditRows } = diff;
|
|
13
|
+
const unit = require('./unit.js');
|
|
13
14
|
|
|
14
15
|
const relabelStatus = (entries, from, to) => {
|
|
15
16
|
if (!to) return entries;
|
|
@@ -19,29 +20,11 @@ const relabelStatus = (entries, from, to) => {
|
|
|
19
20
|
});
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
const repoNameOf = (
|
|
23
|
-
const { ui } = api;
|
|
23
|
+
const repoNameOf = (ui) => {
|
|
24
24
|
if (ui.repoName) return ui.repoName;
|
|
25
25
|
return path.basename(ui.top || ui.cwd || '');
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const tasksEntry = (counts) => ({
|
|
29
|
-
path: REPO_TASKS_LABEL,
|
|
30
|
-
kind: 'tasks',
|
|
31
|
-
status: 'tasks',
|
|
32
|
-
remaining: counts.tasks,
|
|
33
|
-
staged: counts.tasksDone,
|
|
34
|
-
firstIndex: 0,
|
|
35
|
-
openIndex: 0,
|
|
36
|
-
added: 0,
|
|
37
|
-
removed: 0,
|
|
38
|
-
stagedAdded: 0,
|
|
39
|
-
stagedRemoved: 0,
|
|
40
|
-
unstagedAdded: 0,
|
|
41
|
-
unstagedRemoved: 0,
|
|
42
|
-
unstaged: 0,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
28
|
const blankEntry = (rel) => ({
|
|
46
29
|
path: rel,
|
|
47
30
|
origins: [],
|
|
@@ -60,12 +43,12 @@ const blankEntry = (rel) => ({
|
|
|
60
43
|
status: '',
|
|
61
44
|
});
|
|
62
45
|
|
|
63
|
-
const listedNames = (
|
|
64
|
-
const repo =
|
|
65
|
-
if (!repo
|
|
46
|
+
const listedNames = (ui) => {
|
|
47
|
+
const repo = ui.repo;
|
|
48
|
+
if (!repo.listFiles) return [];
|
|
66
49
|
try {
|
|
67
|
-
return repo.listFiles(
|
|
68
|
-
commit:
|
|
50
|
+
return repo.listFiles(ui.top || ui.cwd, ui.paths ?? [], {
|
|
51
|
+
commit: ui.rev,
|
|
69
52
|
});
|
|
70
53
|
} catch {
|
|
71
54
|
return [];
|
|
@@ -85,20 +68,18 @@ const mergeUnitFiles = (entries, names) => {
|
|
|
85
68
|
return merged;
|
|
86
69
|
};
|
|
87
70
|
|
|
88
|
-
const fileList = (
|
|
89
|
-
const entries = fileEntries(
|
|
90
|
-
const sourceLabel =
|
|
71
|
+
const fileList = (ui) => {
|
|
72
|
+
const entries = fileEntries(ui.collection.items);
|
|
73
|
+
const sourceLabel = ui.sourceLabel;
|
|
91
74
|
const from = sourceLabel ? 'pr' : 'commit';
|
|
92
|
-
const to = sourceLabel ||
|
|
75
|
+
const to = sourceLabel || ui.revShort;
|
|
93
76
|
const labeled = relabelStatus(entries, from, to);
|
|
94
|
-
const names = listedNames(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
scoped.unshift(tasksEntry(notes));
|
|
98
|
-
return scoped;
|
|
77
|
+
const names = listedNames(ui);
|
|
78
|
+
if (ui.nav.fileScope === 'file') return mergeUnitFiles(labeled, names);
|
|
79
|
+
return labeled;
|
|
99
80
|
};
|
|
100
81
|
|
|
101
|
-
const counts = (
|
|
82
|
+
const counts = (ui, notes = noteCounts(ui.review.store)) => {
|
|
102
83
|
const next = {
|
|
103
84
|
staged: 0,
|
|
104
85
|
unstaged: 0,
|
|
@@ -106,42 +87,37 @@ const counts = (api, notes = noteCounts(api.review.store)) => {
|
|
|
106
87
|
commit: 0,
|
|
107
88
|
pr: 0,
|
|
108
89
|
tasks: 0,
|
|
90
|
+
tasksDone: 0,
|
|
109
91
|
feedback: 0,
|
|
110
92
|
code: 0,
|
|
111
93
|
};
|
|
112
|
-
for (const item of
|
|
94
|
+
for (const item of ui.collection.items) {
|
|
113
95
|
if (!Object.hasOwn(next, item.origin)) continue;
|
|
114
96
|
next[item.origin] += 1;
|
|
115
97
|
}
|
|
116
98
|
next.feedback = notes.feedback;
|
|
117
99
|
next.tasks = notes.tasks;
|
|
100
|
+
next.tasksDone = notes.tasksDone;
|
|
118
101
|
next.code = notes.code;
|
|
119
102
|
return next;
|
|
120
103
|
};
|
|
121
104
|
|
|
122
|
-
const viewStatus = (
|
|
123
|
-
|
|
124
|
-
const unitFileText = (api) => {
|
|
125
|
-
const rel = api.nav.reviewPath;
|
|
126
|
-
if (!rel) return '';
|
|
127
|
-
const repo = api.ui.repo;
|
|
128
|
-
if (repo && typeof repo.fileText === 'function') {
|
|
129
|
-
return repo.fileText(api.ui.top, rel, api.ui.rev);
|
|
130
|
-
}
|
|
105
|
+
const viewStatus = (ui) => {
|
|
106
|
+
if (ui.status || ui.busy) return ui.status || ui.busy;
|
|
131
107
|
return '';
|
|
132
108
|
};
|
|
133
109
|
|
|
134
|
-
const unitBodyLines = (
|
|
135
|
-
if (
|
|
136
|
-
const rel =
|
|
137
|
-
const group = itemsForPath(
|
|
138
|
-
const live =
|
|
110
|
+
const unitBodyLines = (ui) => {
|
|
111
|
+
if (ui.nav.pane !== 'unit') return [];
|
|
112
|
+
const rel = ui.nav.reviewPath;
|
|
113
|
+
const group = itemsForPath(ui.collection.items, rel);
|
|
114
|
+
const live = ui.composer.liveFileText();
|
|
139
115
|
if (live !== null) {
|
|
140
|
-
const base =
|
|
116
|
+
const base = ui.composer.fileEditRows;
|
|
141
117
|
if (base && base.length) return mergeEditRows(base, splitEditor(live));
|
|
142
118
|
return mergeEditRows(unitLines(live, group), splitEditor(live));
|
|
143
119
|
}
|
|
144
|
-
return unitLines(
|
|
120
|
+
return unitLines(unit.fileText(ui, rel), group);
|
|
145
121
|
};
|
|
146
122
|
|
|
147
123
|
const pendingLines = (items, rev, revShort) => {
|
|
@@ -152,10 +128,10 @@ const pendingLines = (items, rev, revShort) => {
|
|
|
152
128
|
return fileTotals(fileEntries(items));
|
|
153
129
|
};
|
|
154
130
|
|
|
155
|
-
const commitRows = (
|
|
156
|
-
const rows = listedCommits(
|
|
157
|
-
const lines = pendingLines(
|
|
158
|
-
if (!lines
|
|
131
|
+
const commitRows = (ui) => {
|
|
132
|
+
const rows = listedCommits(ui.commits.commits);
|
|
133
|
+
const lines = pendingLines(ui.collection.items, ui.rev, ui.revShort);
|
|
134
|
+
if (!lines) return rows;
|
|
159
135
|
rows[0] = {
|
|
160
136
|
...rows[0],
|
|
161
137
|
added: lines.added,
|
|
@@ -168,34 +144,35 @@ const commitRows = (api) => {
|
|
|
168
144
|
return rows;
|
|
169
145
|
};
|
|
170
146
|
|
|
171
|
-
const view = (
|
|
172
|
-
const { composer, nav,
|
|
173
|
-
const templates = composer.shownTemplates();
|
|
147
|
+
const view = (ui) => {
|
|
148
|
+
const { composer, nav, gitBranches, commits, npm, updater } = ui;
|
|
149
|
+
const templates = composer.templates.shownTemplates();
|
|
174
150
|
const change = ui.change;
|
|
175
151
|
const sourceKind = (change && change.source) || '';
|
|
176
|
-
const notes = noteCounts(
|
|
152
|
+
const notes = noteCounts(ui.review.store);
|
|
177
153
|
return {
|
|
178
154
|
item: ui.current(),
|
|
179
155
|
index: nav.index,
|
|
180
|
-
total:
|
|
156
|
+
total: ui.collection.items.length,
|
|
181
157
|
scroll: nav.scroll,
|
|
182
158
|
listScroll: nav.listScroll,
|
|
183
|
-
status: viewStatus(
|
|
159
|
+
status: viewStatus(ui),
|
|
184
160
|
progressFrame: ui.progressFrame,
|
|
185
161
|
layout: ui.layout,
|
|
186
|
-
counts: counts(
|
|
162
|
+
counts: counts(ui, notes),
|
|
187
163
|
selection: nav.selection,
|
|
188
164
|
pane: nav.pane,
|
|
189
165
|
fileScope: nav.fileScope,
|
|
190
|
-
files: fileList(
|
|
166
|
+
files: fileList(ui),
|
|
191
167
|
fileCursor: nav.fileCursor,
|
|
168
|
+
find: nav.find,
|
|
192
169
|
reviewPath: nav.reviewPath,
|
|
193
170
|
unitLine: nav.unitLine,
|
|
194
|
-
unitLines: unitBodyLines(
|
|
171
|
+
unitLines: unitBodyLines(ui),
|
|
195
172
|
branch: ui.branch,
|
|
196
173
|
branches: gitBranches.branches,
|
|
197
174
|
branchCursor: nav.branchCursor,
|
|
198
|
-
commits: commitRows(
|
|
175
|
+
commits: commitRows(ui),
|
|
199
176
|
commitCursor: nav.commitCursor,
|
|
200
177
|
commitView: commits.commitView,
|
|
201
178
|
npmCommands: npm.commands,
|
|
@@ -210,7 +187,7 @@ const view = (api) => {
|
|
|
210
187
|
npmDraftCommand: npm.draftCommand,
|
|
211
188
|
npmRunning: npm.running,
|
|
212
189
|
npmLogs: nav.pane === 'npm' ? npm.logLabel : '',
|
|
213
|
-
repoName: repoNameOf(
|
|
190
|
+
repoName: repoNameOf(ui),
|
|
214
191
|
rev: ui.rev || '',
|
|
215
192
|
revShort: ui.revShort || '',
|
|
216
193
|
sourceLabel: ui.sourceLabel || '',
|
|
@@ -218,23 +195,25 @@ const view = (api) => {
|
|
|
218
195
|
mode: ui.mode,
|
|
219
196
|
compose: composer.composeView(),
|
|
220
197
|
noteText: composer.idleNoteText(),
|
|
221
|
-
tasks: composer.taskTexts(),
|
|
222
|
-
|
|
223
|
-
|
|
198
|
+
tasks: composer.tasks.taskTexts(),
|
|
199
|
+
taskSections: composer.tasks.taskSections(),
|
|
200
|
+
tasksFocus: composer.tasks.clampedTaskFocus(),
|
|
201
|
+
taskEdit: composer.tasks.taskEditView(),
|
|
224
202
|
codeOverlay: composer.codeOverlayView(),
|
|
225
203
|
templates,
|
|
226
|
-
templateIndex: composer.clampedTemplateIndex(templates),
|
|
204
|
+
templateIndex: composer.templates.clampedTemplateIndex(templates),
|
|
227
205
|
updateFrom: updater.from,
|
|
228
206
|
updateTo: updater.to,
|
|
229
|
-
dropName:
|
|
207
|
+
dropName:
|
|
208
|
+
ui.packages.dropName ||
|
|
209
|
+
gitBranches.dropName ||
|
|
210
|
+
commits.dropName ||
|
|
211
|
+
npm.dropName,
|
|
212
|
+
dashboard: nav.pane === 'dashboard' ? ui.dashboard.view() : null,
|
|
213
|
+
packages: nav.pane === 'packages' ? ui.dashboard.packagesView() : null,
|
|
214
|
+
packagesCursor: nav.packagesCursor,
|
|
215
|
+
repos: nav.pane === 'repos' ? ui.workspace.view() : null,
|
|
230
216
|
};
|
|
231
217
|
};
|
|
232
218
|
|
|
233
|
-
|
|
234
|
-
fileList: () => fileList(api),
|
|
235
|
-
counts: () => counts(api),
|
|
236
|
-
viewStatus: () => viewStatus(api),
|
|
237
|
-
view: () => view(api),
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
module.exports = { createView };
|
|
219
|
+
module.exports = { fileList, counts, viewStatus, view };
|