Skip to content

Commit 8296a6c

Browse files
committed
Auto-install updates; add Map view placeholder
Switch update flow to auto-install new releases (skip in dev): remove interactive prompt/changelog flow and call runUpdate immediately when a newer version is detected (runUpdate will relaunch the process). Adjust imports accordingly. Add a new Map view placeholder: create MapView component and CSS, register the view in App.jsx, and add a Map nav item to the sidebar.
1 parent c88c4f0 commit 8296a6c

5 files changed

Lines changed: 56 additions & 21 deletions

File tree

src/app.js

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ import { runFiableMode, filterByTierOrExit, fetchOpenRouterFreeModels } from '..
112112
import { PROVIDER_METADATA, ENV_VAR_NAMES, isWindows, isMac } from '../src/provider-metadata.js'
113113
import { parseTelemetryEnv, isTelemetryDebugEnabled, telemetryDebug, ensureTelemetryConfig, getTelemetryDistinctId, getTelemetrySystem, getTelemetryTerminal, isTelemetryEnabled, sendUsageTelemetry } from '../src/telemetry.js'
114114
import { ensureFavoritesConfig, toFavoriteKey, syncFavoriteFlags, toggleFavoriteModel, reorderFavorite, pruneOrphanedFavorites } from '../src/favorites.js'
115-
import { checkForUpdateDetailed, checkForUpdate, runUpdate, promptUpdateNotification, fetchLastReleaseDate } from './updater.js'
115+
import { checkForUpdateDetailed, checkForUpdate, runUpdate, fetchLastReleaseDate } from './updater.js'
116116
import { promptApiKey } from '../src/setup.js'
117117
import { syncShellEnv, ensureShellRcSource, promptShellEnvMigration, removeShellEnv } from '../src/shell-env.js'
118118
import { stripAnsi, maskApiKey, displayWidth, padEndDisplay, tintOverlayLines, keepOverlayTargetVisible, sliceOverlayLines, calculateViewport, sortResultsWithPinnedFavorites, adjustScrollOffset } from '../src/render-helpers.js'
@@ -315,27 +315,12 @@ export async function runApp(cliArgs, config) {
315315
saveConfig(config)
316316
}
317317

318-
// 📖 Show interactive update prompt if a new version is available (skip in dev mode)
318+
// 📖 Auto-update: if a new version is available, install it immediately (skip in dev mode)
319+
// 📖 runUpdate() will relaunch the process with the new version after install completes
319320
if (latestVersion && !isDevMode) {
320-
const choice = await promptUpdateNotification(latestVersion)
321-
if (choice === 'update') {
322-
runUpdate(latestVersion)
323-
return // 📖 runUpdate relaunches the process — this line is a safety guard
324-
} else if (choice === 'changelogs') {
325-
const { execSync: _exec } = await import('child_process')
326-
const url = 'https://github.com/vava-nessa/free-coding-models/releases'
327-
try {
328-
if (process.platform === 'darwin') _exec(`open ${url}`)
329-
else if (process.platform === 'linux') _exec(`xdg-open ${url}`)
330-
else console.log(chalk.dim(` 📋 ${url}`))
331-
} catch { console.log(chalk.dim(` 📋 ${url}`)) }
332-
// 📖 After opening changelogs, re-prompt so user can still update or continue
333-
const choice2 = await promptUpdateNotification(latestVersion)
334-
if (choice2 === 'update') {
335-
runUpdate(latestVersion)
336-
return
337-
}
338-
}
321+
console.log(chalk.dim(` ⬆ New version v${latestVersion} detected, updating...`))
322+
runUpdate(latestVersion)
323+
return // 📖 runUpdate relaunches the process — this line is a safety guard
339324
}
340325

341326
// 📖 Dynamic OpenRouter free model discovery — fetch live free models from API

web/src/App.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import DetailPanel from './components/dashboard/DetailPanel.jsx'
2020
import ExportModal from './components/dashboard/ExportModal.jsx'
2121
import SettingsView from './components/settings/SettingsView.jsx'
2222
import AnalyticsView from './components/analytics/AnalyticsView.jsx'
23+
import MapView from './components/map/MapView.jsx'
2324
import ToastContainer from './components/atoms/ToastContainer.jsx'
2425

2526
let toastIdCounter = 0
@@ -128,6 +129,12 @@ export default function App() {
128129
</div>
129130
)}
130131

132+
{currentView === 'map' && (
133+
<div className="view">
134+
<MapView />
135+
</div>
136+
)}
137+
131138
<Footer />
132139
</div>
133140

web/src/components/layout/Sidebar.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const NAV_ITEMS = [
88
{ id: 'dashboard', icon: '▤', label: 'Dashboard' },
99
{ id: 'settings', icon: '⚙', label: 'Settings' },
1010
{ id: 'analytics', icon: '▌▌', label: 'Analytics' },
11+
{ id: 'map', icon: '🌍', label: 'Map' },
1112
]
1213

1314
export default function Sidebar({ currentView, onNavigate, onToggleTheme }) {

web/src/components/map/MapView.jsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @file web/src/components/map/MapView.jsx
3+
* @description WIP - Live map view showing users location and activity.
4+
* @exports MapView → placeholder component for user map visualization
5+
*/
6+
import styles from './MapView.module.css'
7+
8+
export default function MapView() {
9+
return (
10+
<div className={styles.container}>
11+
<div className={styles.wip}>
12+
<h1>WIP : map users live</h1>
13+
<p>Coming soon...</p>
14+
</div>
15+
</div>
16+
)
17+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.container {
2+
padding: 2rem;
3+
width: 100%;
4+
}
5+
6+
.wip {
7+
display: flex;
8+
flex-direction: column;
9+
align-items: center;
10+
justify-content: center;
11+
min-height: 60vh;
12+
text-align: center;
13+
}
14+
15+
.wip h1 {
16+
font-size: 2rem;
17+
font-weight: 700;
18+
color: var(--text-primary);
19+
margin-bottom: 1rem;
20+
}
21+
22+
.wip p {
23+
font-size: 1.125rem;
24+
color: var(--text-secondary);
25+
}

0 commit comments

Comments
 (0)