kafox-cli 0.9.0 → 0.9.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/src/tui.js +9 -4
package/package.json
CHANGED
package/src/tui.js
CHANGED
|
@@ -1477,17 +1477,18 @@ async function runTUI({
|
|
|
1477
1477
|
function wallpaperGrid(cols, rows) {
|
|
1478
1478
|
const bg = state.wallpaper;
|
|
1479
1479
|
if (!bg?.image) return null;
|
|
1480
|
-
if (!bg.grid || bg.cols !== cols || bg.rows !== rows) {
|
|
1480
|
+
if (!bg.grid || bg.cols !== cols || bg.rows !== rows || bg.theme !== state.theme) {
|
|
1481
1481
|
const base = wallpaper.hexToRgb(themeColors(state.theme).bg) || [12, 12, 16];
|
|
1482
1482
|
bg.grid = wallpaper.buildGrid(bg.image, cols, rows, { dim: 0.45, base });
|
|
1483
1483
|
bg.cols = cols;
|
|
1484
1484
|
bg.rows = rows;
|
|
1485
|
+
bg.theme = state.theme;
|
|
1485
1486
|
}
|
|
1486
1487
|
return bg.grid;
|
|
1487
1488
|
}
|
|
1488
1489
|
|
|
1489
1490
|
/** `/background <arquivo|url>` desenha a foto atras da conversa. */
|
|
1490
|
-
async function setBackground(source) {
|
|
1491
|
+
async function setBackground(source, { quiet = false } = {}) {
|
|
1491
1492
|
const value = String(source || "").trim();
|
|
1492
1493
|
if (!value || ["off", "none", "0", "limpar"].includes(value.toLowerCase())) {
|
|
1493
1494
|
state.wallpaper = null;
|
|
@@ -1505,7 +1506,11 @@ async function runTUI({
|
|
|
1505
1506
|
storage.setConfig({ background: value });
|
|
1506
1507
|
} catch (error) {
|
|
1507
1508
|
state.wallpaper = null;
|
|
1508
|
-
|
|
1509
|
+
// No inicio da sessao o fundo salvo pode falhar (offline, arquivo movido):
|
|
1510
|
+
// nao vale abrir um modal por isso, so avisa quando o usuario pediu.
|
|
1511
|
+
if (!quiet) {
|
|
1512
|
+
state.modal = { title: "Fundo", text: `Nao consegui carregar ${value}.\n${error.message}` };
|
|
1513
|
+
}
|
|
1509
1514
|
}
|
|
1510
1515
|
return render();
|
|
1511
1516
|
}
|
|
@@ -2345,7 +2350,7 @@ async function runTUI({
|
|
|
2345
2350
|
if (resumePick) openChatPicker();
|
|
2346
2351
|
connectMcp().catch(() => {});
|
|
2347
2352
|
const savedBackground = storage.getConfig().background;
|
|
2348
|
-
if (savedBackground) setBackground(savedBackground).catch(() => {});
|
|
2353
|
+
if (savedBackground) setBackground(savedBackground, { quiet: true }).catch(() => {});
|
|
2349
2354
|
|
|
2350
2355
|
spinner = setInterval(() => {
|
|
2351
2356
|
if (!state.busy || closed) return;
|