Skip to content

Commit ef290af

Browse files
authored
Merge pull request #13 from Shikakiben/test
some change
2 parents 96709d6 + 3c6c5b7 commit ef290af

File tree

4 files changed

+73
-2
lines changed

4 files changed

+73
-2
lines changed

main.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,16 +889,26 @@ ipcMain.handle('list-apps-detailed', async () => {
889889
/^TOTAL/i,
890890
/^\*has/i
891891
];
892+
let versionColIdx = 2; // par défaut, colonne 3 (0-based)
893+
let headerParsed = false;
892894
for (const raw of lines) {
893895
let line = raw.trim();
894896
if (!line) continue;
897+
if (line.startsWith('APPNAME') || line.startsWith('- APPNAME')) {
898+
// Détecter la colonne version dynamiquement
899+
const headerCols = line.replace(/^- /, '').split('|').map(s => s.trim());
900+
versionColIdx = headerCols.findIndex(col => col.toLowerCase().startsWith('version'));
901+
headerParsed = true;
902+
continue;
903+
}
904+
if (line.startsWith('-------')) continue; // ignorer la ligne de séparation
895905
if (line.startsWith('\u25c6')) line = line.slice(1).trim();
896906
if (!line) continue;
897-
// Try to parse "name | version | type | size" separated by | if present
907+
// Try to parse "name | ... | version | ..." separated by |
898908
if (line.includes('|')) {
899909
const cols = line.split('|').map(s => s.trim()).filter(Boolean);
900910
const name = cols[0] ? cols[0].split(/\s+/)[0].trim() : null;
901-
const version = cols[1] ? cols[1] : null;
911+
const version = (typeof versionColIdx === 'number' && versionColIdx >= 0 && versionColIdx < cols.length) ? cols[versionColIdx] : null;
902912
if (name && !ignoreNamePatterns.some(re => re.test(name))) {
903913
installedSet.add(name);
904914
if (version) installedDesc.set(name, version);

src/renderer/i18n/translations.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
'missingPm.popup.autoCta': 'Installer',
1818
'missingPm.popup.manualTitle': 'Installation personnalisée',
1919
'missingPm.popup.manualDesc': "Exécutez le script AM-INSTALLER dans votre terminal pour choisir entre AM ou AppMan et leurs options. Consultez la documentation pour plus d'informations.",
20+
'missingPm.manual.confirmTitle': "Commande copiée",
21+
'missingPm.manual.confirmDesc': "Commande copiée. Collez‑la dans un terminal, faites l’installation qui vous convient, puis rouvrez AM‑GUI.",
22+
'missingPm.manual.ok': 'OK',
23+
'missingPm.manual.cancel': 'Annuler',
2024
'missingPm.popup.manualCta': 'Copier la commande',
2125
'missingPm.popup.docs': 'Voir la documentation',
2226
'missingPm.popup.statusIdle': 'Choisissez une option pour continuer.',
@@ -217,6 +221,10 @@
217221
'missingPm.auto.error': 'Auto-install failed: {msg}',
218222
'missingPm.auto.errorShort': 'Auto-install failed.',
219223
'missingPm.manual.copied': 'Command copied. Open a terminal and paste it.',
224+
'missingPm.manual.confirmTitle': 'Command copied',
225+
'missingPm.manual.confirmDesc': 'Command copied. Paste it into a terminal, run the installation you prefer, then reopen AM-GUI.',
226+
'missingPm.manual.ok': 'OK',
227+
'missingPm.manual.cancel': 'Cancel',
220228
'missingPm.manual.copyError': 'Unable to copy the command.',
221229
'toast.cancelRequested': 'Cancel requested…',
222230
'settings.gpuTitle': 'GPU acceleration',
@@ -402,6 +410,10 @@
402410
'missingPm.popup.manualTitle': 'Installazione personalizzata',
403411
'missingPm.popup.manualDesc': "Esegui lo script AM-INSTALLER nel terminale per scegliere tra AM o AppMan e le rispettive opzioni. Consulta la documentazione per maggiori informazioni.",
404412
'missingPm.popup.manualCta': 'Copia il comando',
413+
'missingPm.manual.confirmTitle': 'Comando copiato',
414+
'missingPm.manual.confirmDesc': "Comando copiato. Incollalo in un terminale, esegui l'installazione che preferisci, poi riapri AM‑GUI.",
415+
'missingPm.manual.ok': 'OK',
416+
'missingPm.manual.cancel': 'Annulla',
405417
'missingPm.popup.docs': 'Apri la documentazione',
406418
'missingPm.popup.statusIdle': 'Scegli un\'opzione per continuare.',
407419
'missingPm.auto.installing': 'Download e configurazione in corso…',

src/renderer/renderer.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,6 +1750,27 @@ async function handleManualInstallClick() {
17501750
await copyTextToClipboard(command);
17511751
showToast(t('missingPm.manual.copied'));
17521752
setPmPopupStatus('missingPm.manual.copied');
1753+
1754+
// Show a confirmation dialog instructing user what to do next
1755+
const confirmed = await openActionConfirm({
1756+
message: t('missingPm.manual.confirmDesc'),
1757+
okLabel: t('missingPm.manual.ok'),
1758+
intent: 'install'
1759+
});
1760+
if (confirmed) {
1761+
// close the missingPm popup and exit the app so user can follow instructions
1762+
hideMissingPmPopup();
1763+
if (window.electronAPI?.closeWindow) {
1764+
window.electronAPI.closeWindow();
1765+
}
1766+
} else {
1767+
// User cancelled: keep popup open (return to choices)
1768+
setPmPopupStatus('missingPm.popup.statusIdle');
1769+
setTimeout(() => {
1770+
const ctrl = ensureMissingPmPopup();
1771+
ctrl?.autoBtn?.focus?.();
1772+
}, 60);
1773+
}
17531774
} catch (err) {
17541775
console.error('Manual install copy error', err);
17551776
showToast(t('missingPm.manual.copyError'));

style.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,14 @@ body.details-mode .scroll-shell { top:calc(var(--header-h) + var(--subbar-h)); }
555555
/* Recherche centrée dans header */
556556
.header-center .search input { width:clamp(320px, 42vw, 560px); }
557557

558+
/* Focus : recherche atténuée (permanent) */
559+
.search input:focus, .search input:focus-visible {
560+
outline: none !important;
561+
box-shadow: 0 0 0 1.5px rgba(90,120,150,0.35) !important;
562+
border-color: rgba(90,120,150,0.8) !important;
563+
background: var(--card) !important;
564+
}
565+
558566
.header-actions { display:flex; align-items:center; gap:8px; margin-right:12px; -webkit-app-region:no-drag; }
559567
.search input {
560568
min-width: 280px; max-width: 460px; width: 30vw;
@@ -1259,6 +1267,12 @@ body.pm-popup-open { overflow: hidden; }
12591267

12601268
/* Modale générique */
12611269
.modal { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.55); z-index:600; padding:40px 30px; backdrop-filter:blur(4px); }
1270+
1271+
/* Ensure action confirm modal is above missingPm popup layer */
1272+
#actionConfirmModal { z-index: 1601; }
1273+
1274+
/* Ensure action confirm modal shows above pm popup layer */
1275+
#actionConfirmModal { z-index: 1600; }
12621276
.modal[hidden] { display:none !important; }
12631277
.modal-dialog { background:var(--card); border:1px solid var(--border); border-radius:14px; width: clamp(420px, 70vw, 900px); max-height:80vh; display:flex; flex-direction:column; box-shadow:var(--shadow); }
12641278
.modal-header { display:flex; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid var(--border); }
@@ -1281,6 +1295,20 @@ body.pm-popup-open { overflow: hidden; }
12811295
.password-modal .password-input { width:100%; padding:0.5em; margin-bottom:1em; font-size:1em; border-radius:6px; border:1px solid var(--border); background:var(--bg); color:var(--text); }
12821296
.password-modal .password-error { color:#c00; display:none; margin-bottom:1em; }
12831297
.password-modal .modal-actions { display:flex; gap:0.5em; justify-content:flex-end; }
1298+
1299+
/* Focus: inputs in modals (password, confirmations, etc.) */
1300+
.password-modal .password-input:focus,
1301+
.modal-content input:focus,
1302+
.modal-content textarea:focus,
1303+
.password-modal .password-input:focus-visible,
1304+
.modal-content input:focus-visible,
1305+
.modal-content textarea:focus-visible {
1306+
outline: none !important;
1307+
box-shadow: 0 0 0 1.5px rgba(90,120,150,0.35) !important;
1308+
border-color: rgba(90,120,150,0.8) !important;
1309+
background: var(--card) !important;
1310+
}
1311+
12841312
@media (prefers-color-scheme: dark) {
12851313
.password-modal .password-error { color:#ff6b6b; }
12861314
}

0 commit comments

Comments
 (0)