@giladbarnea/pi-simple-team 2.0.0 → 2.0.1
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/package.json +1 -1
- package/team-ui.ts +14 -5
package/package.json
CHANGED
package/team-ui.ts
CHANGED
|
@@ -209,10 +209,15 @@ class TeamOverviewOverlay implements Component {
|
|
|
209
209
|
this.tui.requestRender();
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
|
-
if (!this.selectedTeamName
|
|
212
|
+
if (!this.selectedTeamName) return;
|
|
213
|
+
if (keybindings.matches(data, "tui.select.confirm")) {
|
|
214
|
+
this.zoomedWidget = this.zoomedWidget ? undefined : this.focusedWidget;
|
|
215
|
+
this.tui.requestRender();
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (this.zoomedWidget) return;
|
|
213
219
|
if (keybindings.matches(data, "tui.select.up")) this.focusedWidget = "messages";
|
|
214
220
|
else if (keybindings.matches(data, "tui.select.down")) this.focusedWidget = "log";
|
|
215
|
-
else if (keybindings.matches(data, "tui.select.confirm")) this.zoomedWidget = this.focusedWidget;
|
|
216
221
|
else return;
|
|
217
222
|
this.tui.requestRender();
|
|
218
223
|
}
|
|
@@ -292,7 +297,11 @@ class TeamOverviewOverlay implements Component {
|
|
|
292
297
|
const message = teamMessage(entry);
|
|
293
298
|
return message ? [message] : [];
|
|
294
299
|
});
|
|
295
|
-
const messageGroups = allMessages.map((message) => teamMessageLines(this.theme, message, team.roster).map(
|
|
300
|
+
const messageGroups = allMessages.map((message) => teamMessageLines(this.theme, message, team.roster).map((line) =>
|
|
301
|
+
teamLineText(typeof line === "object" && "prefix" in line
|
|
302
|
+
? { ...line, prefix: `${this.theme.fg("dim", glyphs().codeBar)} ` }
|
|
303
|
+
: line),
|
|
304
|
+
));
|
|
296
305
|
const selectedMessages = selectNewestMessageLines(messageGroups, Math.max(0, contentHeight));
|
|
297
306
|
const lines = selectedMessages.lines.length > 0 ? selectedMessages.lines : [this.theme.fg("muted", "No recent messages.")];
|
|
298
307
|
return { title: `Messages · latest ${selectedMessages.messageCount} of ${allMessages.length}`, lines };
|
|
@@ -306,7 +315,7 @@ class TeamOverviewOverlay implements Component {
|
|
|
306
315
|
entries: allLogEntries,
|
|
307
316
|
totalMatched: allLogEntries.length,
|
|
308
317
|
returned: allLogEntries.length,
|
|
309
|
-
}).slice(1);
|
|
318
|
+
}).slice(1).map((line) => sliceByColumn(line, 2, visibleWidth(line)));
|
|
310
319
|
const lines = renderedLogLines.slice(-Math.max(0, contentHeight));
|
|
311
320
|
return { title: `Team Log ${team.name} · latest ${lines.length} rows · ${allLogEntries.length} events`, lines };
|
|
312
321
|
}
|
|
@@ -345,7 +354,7 @@ class TeamOverviewOverlay implements Component {
|
|
|
345
354
|
const view = widget === "messages" ? this.messageWidget(team, widgetHeight - 2) : this.logWidget(team, widgetHeight - 2);
|
|
346
355
|
const breadcrumb = widget === "messages" ? "Messages" : "Team Log";
|
|
347
356
|
const content = [
|
|
348
|
-
...this.headerRegion(team, "Esc back to team view", contentWidth, headerHeight, breadcrumb),
|
|
357
|
+
...this.headerRegion(team, "Enter/Esc back to team view", contentWidth, headerHeight, breadcrumb),
|
|
349
358
|
...this.region(view.title, view.lines, contentWidth, widgetHeight, true),
|
|
350
359
|
];
|
|
351
360
|
return this.frame(content, width, height);
|