Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

general bug fixes

tilakpatel2284c99bb6fc13
diff --git a/.github/workflows/release-production.yml b/.github/workflows/release-production.yml
index efba34575..fa1800dab 100644
--- a/.github/workflows/release-production.yml
+++ b/.github/workflows/release-production.yml
@@ -139,6 +139,10 @@ jobs:
fi
fi
+ # Copy macOS updater signature files
+ TAR_GZ_SIG=$(find fincept-terminal-desktop/src-tauri/target/${{ matrix.target }}/release/bundle/macos -name "*.tar.gz.sig" -type f 2>/dev/null | head -1)
+ [ -f "$TAR_GZ_SIG" ] && cp "$TAR_GZ_SIG" "release-artifacts/" && echo "Found macOS signature: $TAR_GZ_SIG" || echo "Warning: macOS signature not found"
+
elif [[ "${{ matrix.platform }}" == "ubuntu-22.04" ]]; then
SUFFIX="Linux-x64"
APPIMAGE=$(find fincept-terminal-desktop/src-tauri/target/${{ matrix.target }}/release/bundle -name "*.AppImage" -type f 2>/dev/null | head -1)
@@ -146,10 +150,31 @@ jobs:
[ -f "$APPIMAGE" ] && cp "$APPIMAGE" "release-artifacts/FinceptTerminal-v${VERSION}-${SUFFIX}.AppImage" || { echo "Error: AppImage not found"; exit 1; }
[ -f "$DEB" ] && cp "$DEB" "release-artifacts/FinceptTerminal-v${VERSION}-${SUFFIX}.deb" || echo "Warning: DEB not found"
+ # Copy Linux updater signature files
+ APPIMAGE_TAR_GZ_SIG=$(find fincept-terminal-desktop/src-tauri/target/${{ matrix.target }}/release/bundle/appimage -name "*.tar.gz.sig" -type f 2>/dev/null | head -1)
+ [ -f "$APPIMAGE_TAR_GZ_SIG" ] && cp "$APPIMAGE_TAR_GZ_SIG" "release-artifacts/" && echo "Found Linux signature: $APPIMAGE_TAR_GZ_SIG" || echo "Warning: Linux signature not found"
+
elif [[ "${{ matrix.platform }}" == "windows-2022" ]]; then
SUFFIX="Windows-x64"
MSI=$(find fincept-terminal-desktop/src-tauri/target/${{ matrix.target }}/release/bundle -name "*.msi" -type f 2>/dev/null | head -1)
[ -f "$MSI" ] && cp "$MSI" "release-artifacts/FinceptTerminal-v${VERSION}-${SUFFIX}.msi" || { echo "Error: MSI not found"; exit 1; }
+
+ # Copy Windows updater signature files
+ NSIS_ZIP=$(find fincept-terminal-desktop/src-tauri/target/${{ matrix.target }}/release/bundle/nsis -name "*.nsis.zip" -type f 2>/dev/null | head -1)
+ NSIS_ZIP_SIG=$(find fincept-terminal-desktop/src-tauri/target/${{ matrix.target }}/release/bundle/nsis -name "*.nsis.zip.sig" -type f 2>/dev/null | head -1)
+ [ -f "$NSIS_ZIP" ] && cp "$NSIS_ZIP" "release-artifacts/" && echo "Found NSIS zip: $NSIS_ZIP" || echo "Warning: NSIS zip not found"
+ [ -f "$NSIS_ZIP_SIG" ] && cp "$NSIS_ZIP_SIG" "release-artifacts/" && echo "Found Windows signature: $NSIS_ZIP_SIG" || echo "Warning: Windows signature not found"
+ fi
+
+ # Copy latest.json (updater manifest) - only one platform needs to generate this
+ LATEST_JSON=$(find fincept-terminal-desktop/src-tauri/target/${{ matrix.target }}/release/bundle -name "latest.json" -type f 2>/dev/null | head -1)
+ if [ -f "$LATEST_JSON" ]; then
+ cp "$LATEST_JSON" "release-artifacts/latest.json"
+ echo "Found latest.json: $LATEST_JSON"
+ echo "latest.json content:"
+ cat "$LATEST_JSON"
+ else
+ echo "Warning: latest.json not found for ${{ matrix.platform }}"
fi
echo "=== Release Artifacts ==="
@@ -196,12 +221,24 @@ jobs:
run: |
mkdir -p release-files
+ # Copy installer files
find all-artifacts -type f \( -name "*.dmg" -o -name "*.msi" -o -name "*.AppImage" -o -name "*.deb" -o -name "*.app.tar.gz" \) -exec cp {} release-files/ \;
- find all-artifacts -type f \( -name "latest.json" -o -name "*.tar.gz.sig" -o -name "*.zip" -o -name "*.zip.sig" \) -exec cp {} release-files/ \; 2>/dev/null || echo "No updater files found"
+
+ # Copy updater files (signatures and manifest)
+ find all-artifacts -type f \( -name "latest.json" -o -name "*.tar.gz.sig" -o -name "*.nsis.zip" -o -name "*.nsis.zip.sig" \) -exec cp {} release-files/ \; 2>/dev/null || echo "No updater files found"
echo "=== Release Files ==="
ls -lh release-files/
+ # Validate latest.json exists
+ if [ -f "release-files/latest.json" ]; then
+ echo "SUCCESS: latest.json found"
+ echo "latest.json content:"
+ cat release-files/latest.json
+ else
+ echo "WARNING: latest.json not found - auto-updater will not work!"
+ fi
+
file_count=$(find release-files -type f | wc -l)
[ "$file_count" -eq 0 ] && { echo "Error: No release files found"; exit 1; }
echo "file_count=$file_count" >> $GITHUB_OUTPUT
diff --git a/.gitignore b/.gitignore
index a72fbfca6..0959661ee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,9 @@
# .gitignore - Root level for entire finceptTerminal project
# ============================================================
+# Version management notes
+versionterminal.txt
+
# Python artifacts
*.egg-info/
__pycache__/
diff --git a/fincept-terminal-desktop/package.json b/fincept-terminal-desktop/package.json
index 628622ce8..a423a18af 100644
--- a/fincept-terminal-desktop/package.json
+++ b/fincept-terminal-desktop/package.json
@@ -1,7 +1,7 @@
{
"name": "fincept-terminal-desktop",
"private": true,
- "version": "3.1.5",
+ "version": "3.1.6",
"type": "module",
"license": "AGPL-3.0-or-later",
"scripts": {
@@ -12,6 +12,7 @@
"tauri:dev": "bun run tauri dev",
"tauri:build": "bun run tauri build",
"tauri:build:msstore": "bun run tauri build --config src-tauri/tauri.microsoftstore.conf.json",
+ "sync-version": "bun scripts/sync-version.js",
"bump-version": "bun scripts/bump-version.js",
"i18n:audit": "bun scripts/audit-translations.js",
"i18n:sync": "bun scripts/sync-translations.js",
diff --git a/fincept-terminal-desktop/scripts/bump-version.js b/fincept-terminal-desktop/scripts/bump-version.js
new file mode 100644
index 000000000..9355c44fa
--- /dev/null
+++ b/fincept-terminal-desktop/scripts/bump-version.js
@@ -0,0 +1,166 @@
+#!/usr/bin/env node
+
+/**
+ * Version Bump Script
+ *
+ * This script increments the version number in package.json and syncs it across all files.
+ *
+ * Usage:
+ * bun run bump-version [patch|minor|major]
+ *
+ * Examples:
+ * bun run bump-version patch -> 3.1.5 -> 3.1.6
+ * bun run bump-version minor -> 3.1.5 -> 3.2.0
+ * bun run bump-version major -> 3.1.5 -> 4.0.0
+ *
+ * Default: patch
+ */
+
+import fs from 'fs';
+import path from 'path';
+import { fileURLToPath } from 'url';
+import { execSync } from 'child_process';
+
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
+const rootDir = path.resolve(__dirname, '..');
+
+// Colors for console output
+const colors = {
+ reset: '\x1b[0m',
+ bright: '\x1b[1m',
+ green: '\x1b[32m',
+ yellow: '\x1b[33m',
+ blue: '\x1b[34m',
+ red: '\x1b[31m',
+ cyan: '\x1b[36m',
+};
+
+function log(message, color = colors.reset) {
+ console.log(`${color}${message}${colors.reset}`);
+}
+
+function logSuccess(message) {
+ log(`✓ ${message}`, colors.green);
+}
+
+function logError(message) {
+ log(`✗ ${message}`, colors.red);
+}
+
+function logInfo(message) {
+ log(`ℹ ${message}`, colors.blue);
+}
+
+// Parse semver version
+function parseVersion(version) {
+ const match = version.match(/^(\d+)\.(\d+)\.(\d+)$/);
+ if (!match) {
+ throw new Error(`Invalid version format: ${version}`);
+ }
+ return {
+ major: parseInt(match[1], 10),
+ minor: parseInt(match[2], 10),
+ patch: parseInt(match[3], 10),
+ };
+}
+
+// Increment version based on type
+function incrementVersion(version, type = 'patch') {
+ const parts = parseVersion(version);
+
+ switch (type) {
+ case 'major':
+ parts.major += 1;
+ parts.minor = 0;
+ parts.patch = 0;
+ break;
+ case 'minor':
+ parts.minor += 1;
+ parts.patch = 0;
+ break;
+ case 'patch':
+ default:
+ parts.patch += 1;
+ break;
+ }
+
+ return `${parts.major}.${parts.minor}.${parts.patch}`;
+}
+
+// Update package.json
+function updatePackageJson(newVersion) {
+ const packageJsonPath = path.join(rootDir, 'package.json');
+
+ try {
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
+ const oldVersion = packageJson.version;
+
+ packageJson.version = newVersion;
+ fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n', 'utf8');
+
+ logSuccess(`Updated package.json: v${oldVersion} → v${newVersion}`);
+ return oldVersion;
+ } catch (error) {
+ logError(`Failed to update package.json: ${error.message}`);
+ process.exit(1);
+ }
+}
+
+// Run sync-version script
+function runSyncVersion() {
+ try {
+ logInfo('\nSyncing version across all files...\n');
+ execSync('bun run sync-version', { stdio: 'inherit', cwd: rootDir });
+ } catch (error) {
+ logError('Failed to run sync-version script');
+ process.exit(1);
+ }
+}
+
+// Main function
+function main() {
+ const args = process.argv.slice(2);
+ const bumpType = args[0] || 'patch';
+
+ if (!['patch', 'minor', 'major'].includes(bumpType)) {
+ logError(`Invalid bump type: ${bumpType}`);
+ logInfo('Usage: bun run bump-version [patch|minor|major]');
+ process.exit(1);
+ }
+
+ log('\n' + '='.repeat(60), colors.bright);
+ log(' VERSION BUMP SCRIPT', colors.bright);
+ log('='.repeat(60) + '\n', colors.bright);
+
+ // Read current version
+ const packageJsonPath = path.join(rootDir, 'package.json');
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
+ const currentVersion = packageJson.version;
+
+ // Calculate new version
+ const newVersion = incrementVersion(currentVersion, bumpType);
+
+ logInfo(`Bump type: ${colors.bright}${bumpType}${colors.reset}`);
+ logInfo(`Current version: ${colors.yellow}v${currentVersion}${colors.reset}`);
+ logInfo(`New version: ${colors.green}v${newVersion}${colors.reset}\n`);
+
+ // Update package.json
+ updatePackageJson(newVersion);
+
+ // Run sync-version to update all other files
+ runSyncVersion();
+
+ log('\n' + '='.repeat(60), colors.bright);
+ logSuccess('Version bump completed!');
+ log('='.repeat(60) + '\n', colors.bright);
+
+ log(`${colors.cyan}Next steps:${colors.reset}`);
+ log(' 1. Review the changes: git diff');
+ log(' 2. Commit the changes: git add . && git commit -m "chore: bump version to v' + newVersion + '"');
+ log(' 3. Tag the release: git tag v' + newVersion);
+ log(' 4. Push changes: git push && git push --tags\n');
+}
+
+// Run the script
+main();
diff --git a/fincept-terminal-desktop/scripts/sync-version.js b/fincept-terminal-desktop/scripts/sync-version.js
new file mode 100644
index 000000000..290fcb380
--- /dev/null
+++ b/fincept-terminal-desktop/scripts/sync-version.js
@@ -0,0 +1,164 @@
+#!/usr/bin/env node
+
+/**
+ * Version Sync Script
+ *
+ * This script ensures version consistency across all files in the project:
+ * - package.json (source of truth)
+ * - src/constants/version.ts
+ * - src-tauri/tauri.conf.json
+ * - src-tauri/Cargo.toml
+ *
+ * Usage:
+ * bun run sync-version
+ */
+
+import fs from 'fs';
+import path from 'path';
+import { fileURLToPath } from 'url';
+
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
+const rootDir = path.resolve(__dirname, '..');
+
+// Colors for console output
+const colors = {
+ reset: '\x1b[0m',
+ bright: '\x1b[1m',
+ green: '\x1b[32m',
+ yellow: '\x1b[33m',
+ blue: '\x1b[34m',
+ red: '\x1b[31m',
+};
+
+function log(message, color = colors.reset) {
+ console.log(`${color}${message}${colors.reset}`);
+}
+
+function logSuccess(message) {
+ log(`✓ ${message}`, colors.green);
+}
+
+function logWarning(message) {
+ log(`⚠ ${message}`, colors.yellow);
+}
+
+function logError(message) {
+ log(`✗ ${message}`, colors.red);
+}
+
+function logInfo(message) {
+ log(`ℹ ${message}`, colors.blue);
+}
+
+// Read package.json to get the version
+function getPackageVersion() {
+ const packageJsonPath = path.join(rootDir, 'package.json');
+ try {
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
+ return packageJson.version;
+ } catch (error) {
+ logError(`Failed to read package.json: ${error.message}`);
+ process.exit(1);
+ }
+}
+
+// Update src/constants/version.ts
+function updateVersionConstant(version) {
+ const versionFilePath = path.join(rootDir, 'src', 'constants', 'version.ts');
+
+ try {
+ let content = fs.readFileSync(versionFilePath, 'utf8');
+
+ // Replace the APP_VERSION constant
+ const updatedContent = content.replace(
+ /export const APP_VERSION = ['"][\d.]+['"]/,
+ `export const APP_VERSION = '${version}'`
+ );
+
+ if (content === updatedContent) {
+ logWarning('version.ts already has the correct version');
+ } else {
+ fs.writeFileSync(versionFilePath, updatedContent, 'utf8');
+ logSuccess(`Updated src/constants/version.ts to v${version}`);
+ }
+ } catch (error) {
+ logError(`Failed to update version.ts: ${error.message}`);
+ }
+}
+
+// Update src-tauri/tauri.conf.json
+function updateTauriConfig(version) {
+ const tauriConfigPath = path.join(rootDir, 'src-tauri', 'tauri.conf.json');
+
+ try {
+ const config = JSON.parse(fs.readFileSync(tauriConfigPath, 'utf8'));
+
+ if (config.version === version) {
+ logWarning('tauri.conf.json already has the correct version');
+ } else {
+ config.version = version;
+ fs.writeFileSync(tauriConfigPath, JSON.stringify(config, null, 2) + '\n', 'utf8');
+ logSuccess(`Updated src-tauri/tauri.conf.json to v${version}`);
+ }
+ } catch (error) {
+ logError(`Failed to update tauri.conf.json: ${error.message}`);
+ }
+}
+
+// Update src-tauri/Cargo.toml
+function updateCargoToml(version) {
+ const cargoTomlPath = path.join(rootDir, 'src-tauri', 'Cargo.toml');
+
+ try {
+ let content = fs.readFileSync(cargoTomlPath, 'utf8');
+
+ // Replace the version in [package] section (first occurrence)
+ const lines = content.split('\n');
+ let updated = false;
+
+ for (let i = 0; i < lines.length; i++) {
+ if (lines[i].startsWith('version = ') && !updated) {
+ const currentVersion = lines[i].match(/version = "(.+)"/)?.[1];
+ if (currentVersion !== version) {
+ lines[i] = `version = "${version}"`;
+ updated = true;
+ }
+ break;
+ }
+ }
+
+ if (!updated) {
+ logWarning('Cargo.toml already has the correct version');
+ } else {
+ fs.writeFileSync(cargoTomlPath, lines.join('\n'), 'utf8');
+ logSuccess(`Updated src-tauri/Cargo.toml to v${version}`);
+ }
+ } catch (error) {
+ logError(`Failed to update Cargo.toml: ${error.message}`);
+ }
+}
+
+// Main function
+function main() {
+ log('\n' + '='.repeat(60), colors.bright);
+ log(' VERSION SYNC SCRIPT', colors.bright);
+ log('='.repeat(60) + '\n', colors.bright);
+
+ const version = getPackageVersion();
+ logInfo(`Source version from package.json: v${version}\n`);
+
+ updateVersionConstant(version);
+ updateTauriConfig(version);
+ updateCargoToml(version);
+
+ log('\n' + '='.repeat(60), colors.bright);
+ logSuccess('Version sync completed!');
+ log('='.repeat(60) + '\n', colors.bright);
+
+ logInfo('Version has been synced across all files.');
+ logInfo(`Current version: ${colors.bright}v${version}${colors.reset}\n`);
+}
+
+// Run the script
+main();
diff --git a/fincept-terminal-desktop/src-tauri/Cargo.toml b/fincept-terminal-desktop/src-tauri/Cargo.toml
index 48eb3bf79..fa27a2f10 100644
--- a/fincept-terminal-desktop/src-tauri/Cargo.toml
+++ b/fincept-terminal-desktop/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "fincept-terminal-desktop"
-version = "3.1.5"
+version = "3.1.6"
description = "Professional-grade financial analysis platform with AI-powered insights and real-time market data"
authors = ["Fincept Corporation <[email protected]>"]
edition = "2021"
diff --git a/fincept-terminal-desktop/src-tauri/tauri.conf.json b/fincept-terminal-desktop/src-tauri/tauri.conf.json
index 64e0d623f..513a4f255 100644
--- a/fincept-terminal-desktop/src-tauri/tauri.conf.json
+++ b/fincept-terminal-desktop/src-tauri/tauri.conf.json
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "FinceptTerminal",
- "version": "3.1.5",
+ "version": "3.1.6",
"identifier": "com.fincept.terminal",
"build": {
"beforeDevCommand": "bun run dev",
diff --git a/fincept-terminal-desktop/src/components/auth/CompactLanguageSelector.tsx b/fincept-terminal-desktop/src/components/auth/CompactLanguageSelector.tsx
new file mode 100644
index 000000000..a4c21a381
--- /dev/null
+++ b/fincept-terminal-desktop/src/components/auth/CompactLanguageSelector.tsx
@@ -0,0 +1,204 @@
+// File: src/components/auth/CompactLanguageSelector.tsx
+// Compact language selector for login/auth screens
+
+import React, { useState } from 'react';
+import { useLanguage } from '@/contexts/LanguageContext';
+import { Globe, Check, ChevronDown } from 'lucide-react';
+
+export const CompactLanguageSelector: React.FC = () => {
+ const { currentLanguage, changeLanguage, availableLanguages } = useLanguage();
+ const [isOpen, setIsOpen] = useState(false);
+
+ const currentLang = availableLanguages.find(lang => lang.code === currentLanguage);
+
+ return (
+ <div style={{ position: 'relative', width: '100%' }}>
+ {/* Selector Button */}
+ <button
+ type="button"
+ onClick={() => setIsOpen(!isOpen)}
+ style={{
+ width: '100%',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'space-between',
+ padding: '8px 12px',
+ backgroundColor: '#27272a',
+ border: '1px solid #3f3f46',
+ borderRadius: '6px',
+ cursor: 'pointer',
+ transition: 'all 0.2s',
+ fontSize: '12px',
+ color: '#ffffff',
+ fontFamily: 'system-ui, -apple-system, sans-serif'
+ }}
+ onMouseEnter={(e) => {
+ e.currentTarget.style.backgroundColor = '#3f3f46';
+ e.currentTarget.style.borderColor = '#52525b';
+ }}
+ onMouseLeave={(e) => {
+ e.currentTarget.style.backgroundColor = '#27272a';
+ e.currentTarget.style.borderColor = '#3f3f46';
+ }}
+ >
+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
+ <Globe size={14} color="#a1a1aa" />
+ <span style={{ fontSize: '16px' }}>{currentLang?.flag}</span>
+ <span style={{ color: '#d4d4d8', fontWeight: 500 }}>
+ {currentLang?.nativeName || 'English'}
+ </span>
+ </div>
+ <ChevronDown
+ size={14}
+ color="#a1a1aa"
+ style={{
+ transform: isOpen ? 'rotate(180deg)' : 'rotate(0deg)',
+ transition: 'transform 0.2s'
+ }}
+ />
+ </button>
+
+ {/* Dropdown Menu */}
+ {isOpen && (
+ <>
+ {/* Backdrop */}
+ <div
+ onClick={() => setIsOpen(false)}
+ style={{
+ position: 'fixed',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ zIndex: 40
+ }}
+ />
+
+ {/* Dropdown */}
+ <div
+ style={{
+ position: 'absolute',
+ top: 'calc(100% + 4px)',
+ left: 0,
+ right: 0,
+ maxHeight: '300px',
+ overflowY: 'auto',
+ backgroundColor: '#27272a',
+ border: '1px solid #3f3f46',
+ borderRadius: '6px',
+ boxShadow: '0 10px 25px rgba(0, 0, 0, 0.5)',
+ zIndex: 50,
+ animation: 'slideDown 0.2s ease-out',
+ fontFamily: 'system-ui, -apple-system, sans-serif'
+ }}
+ >
+ {/* Scrollbar styling */}
+ <style>{`
+ @keyframes slideDown {
+ from {
+ opacity: 0;
+ transform: translateY(-10px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+ }
+
+ div[style*="overflowY: auto"]::-webkit-scrollbar {
+ width: 6px;
+ }
+ div[style*="overflowY: auto"]::-webkit-scrollbar-track {
+ background: #18181b;
+ }
+ div[style*="overflowY: auto"]::-webkit-scrollbar-thumb {
+ background: #3f3f46;
+ border-radius: 3px;
+ }
+ div[style*="overflowY: auto"]::-webkit-scrollbar-thumb:hover {
+ background: #52525b;
+ }
+ `}</style>
+
+ {availableLanguages.map((lang) => {
+ const isActive = currentLanguage === lang.code;
+
+ return (
+ <button
+ key={lang.code}
+ type="button"
+ onClick={() => {
+ changeLanguage(lang.code);
+ setIsOpen(false);
+ }}
+ style={{
+ width: '100%',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'space-between',
+ padding: '10px 12px',
+ backgroundColor: isActive ? '#3f3f46' : 'transparent',
+ border: 'none',
+ borderBottom: '1px solid #3f3f46',
+ cursor: 'pointer',
+ transition: 'background-color 0.15s',
+ fontSize: '12px',
+ textAlign: 'left'
+ }}
+ onMouseEnter={(e) => {
+ if (!isActive) {
+ e.currentTarget.style.backgroundColor = '#3f3f46';
+ }
+ }}
+ onMouseLeave={(e) => {
+ if (!isActive) {
+ e.currentTarget.style.backgroundColor = 'transparent';
+ }
+ }}
+ >
+ <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
+ <span style={{
+ fontSize: '18px',
+ width: '24px',
+ filter: isActive ? 'brightness(1.2)' : 'brightness(0.8)'
+ }}>
+ {lang.flag}
+ </span>
+ <div>
+ <div style={{
+ color: isActive ? '#ffffff' : '#d4d4d8',
+ fontWeight: isActive ? 600 : 500,
+ marginBottom: '2px'
+ }}>
+ {lang.nativeName}
+ </div>
+ <div style={{
+ color: '#a1a1aa',
+ fontSize: '10px'
+ }}>
+ {lang.name}
+ </div>
+ </div>
+ </div>
+
+ {isActive && (
+ <div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>
+ <Check size={14} color="#22c55e" />
+ <div style={{
+ width: '6px',
+ height: '6px',
+ borderRadius: '50%',
+ backgroundColor: '#22c55e',
+ boxShadow: '0 0 8px #22c55e'
+ }} />
+ </div>
+ )}
+ </button>
+ );
+ })}
+ </div>
+ </>
+ )}
+ </div>
+ );
+};
diff --git a/fincept-terminal-desktop/src/components/auth/ForgotPasswordScreen.tsx b/fincept-terminal-desktop/src/components/auth/ForgotPasswordScreen.tsx
index 2539ea234..ddbf417c7 100644
--- a/fincept-terminal-desktop/src/components/auth/ForgotPasswordScreen.tsx
+++ b/fincept-terminal-desktop/src/components/auth/ForgotPasswordScreen.tsx
@@ -8,6 +8,7 @@ import { Label } from "@/components/ui/label";
import { ArrowLeft, Mail, Key, Eye, EyeOff } from "lucide-react";
import { Screen } from '../../App';
import { AuthApiService } from '@/services/authApi';
+import { CompactLanguageSelector } from './CompactLanguageSelector';
interface ForgotPasswordScreenProps {
onNavigate: (screen: Screen) => void;
@@ -135,6 +136,11 @@ const ForgotPasswordScreen: React.FC<ForgotPasswordScreenProps> = ({ onNavigate
if (step === 'email') {
return (
<div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-sm mx-4 shadow-2xl">
+ {/* Language Selector at Top */}
+ <div className="mb-4">
+ <CompactLanguageSelector />
+ </div>
+
<div className="mb-6">
<div className="flex items-center mb-3">
<button
diff --git a/fincept-terminal-desktop/src/components/auth/LoginScreen.tsx b/fincept-terminal-desktop/src/components/auth/LoginScreen.tsx
index 004672584..548eb240f 100644
--- a/fincept-terminal-desktop/src/components/auth/LoginScreen.tsx
+++ b/fincept-terminal-desktop/src/components/auth/LoginScreen.tsx
@@ -9,6 +9,7 @@ import { Mail, Lock, Eye, EyeOff, Shield } from "lucide-react";
import { Screen } from '../../App';
import { useAuth } from '@/contexts/AuthContext';
import { useTranslation } from 'react-i18next';
+import { CompactLanguageSelector } from './CompactLanguageSelector';
interface LoginScreenProps {
onNavigate: (screen: Screen) => void;
@@ -126,6 +127,11 @@ const LoginScreen: React.FC<LoginScreenProps> = ({ onNavigate }) => {
if (mfaRequired) {
return (
<div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-sm mx-4 shadow-2xl">
+ {/* Language Selector at Top */}
+ <div className="mb-4">
+ <CompactLanguageSelector />
+ </div>
+
<div className="mb-6">
<div className="flex items-center gap-2 mb-3">
<Shield className="h-6 w-6 text-blue-400" />
@@ -199,6 +205,11 @@ const LoginScreen: React.FC<LoginScreenProps> = ({ onNavigate }) => {
// Regular Login Screen
return (
<div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-sm mx-4 shadow-2xl">
+ {/* Language Selector at Top */}
+ <div className="mb-4">
+ <CompactLanguageSelector />
+ </div>
+
<div className="mb-6">
<h2 className="text-white text-2xl font-light mb-3">{t('login.title')}</h2>
<p className="text-zinc-400 text-xs leading-5">
diff --git a/fincept-terminal-desktop/src/components/auth/RegisterScreen.tsx b/fincept-terminal-desktop/src/components/auth/RegisterScreen.tsx
index 90b89b840..da84d01ff 100644
--- a/fincept-terminal-desktop/src/components/auth/RegisterScreen.tsx
+++ b/fincept-terminal-desktop/src/components/auth/RegisterScreen.tsx
@@ -12,6 +12,7 @@ import { useTranslation } from 'react-i18next';
import PhoneInput, { getCountryCallingCode as getCallingCode } from 'react-phone-number-input';
import 'react-phone-number-input/style.css';
import './phone-input.css';
+import { CompactLanguageSelector } from './CompactLanguageSelector';
interface RegisterScreenProps {
onNavigate: (screen: Screen) => void;
@@ -351,6 +352,11 @@ const RegisterScreen: React.FC<RegisterScreenProps> = ({ onNavigate }) => {
if (step === 'form') {
return (
<div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-lg mx-4 shadow-2xl">
+ {/* Language Selector at Top */}
+ <div className="mb-4">
+ <CompactLanguageSelector />
+ </div>
+
<div className="mb-5">
<div className="flex items-center mb-2.5">
<button
@@ -606,6 +612,11 @@ const RegisterScreen: React.FC<RegisterScreenProps> = ({ onNavigate }) => {
if (step === 'otp-verification') {
return (
<div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-sm mx-4 shadow-2xl">
+ {/* Language Selector at Top */}
+ <div className="mb-4">
+ <CompactLanguageSelector />
+ </div>
+
<div className="mb-6">
<div className="flex items-center mb-3">
<button
diff --git a/fincept-terminal-desktop/src/components/common/AutoUpdater.tsx b/fincept-terminal-desktop/src/components/common/AutoUpdater.tsx
index 0be133bea..2e0eff070 100644
--- a/fincept-terminal-desktop/src/components/common/AutoUpdater.tsx
+++ b/fincept-terminal-desktop/src/components/common/AutoUpdater.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useState } from 'react';
+import { useEffect, useState, useRef, useCallback } from 'react';
import { check, Update } from '@tauri-apps/plugin-updater';
import { relaunch } from '@tauri-apps/plugin-process';
import { Button } from '@/components/ui/button';
@@ -29,18 +29,28 @@ export function AutoUpdater({ checkOnMount = true, checkIntervalMinutes = 30 }:
const [showDialog, setShowDialog] = useState(false);
const [updateReady, setUpdateReady] = useState(false);
- const checkForUpdates = async (silent = false) => {
+ const checkingRef = useRef<boolean>(false);
+ const relaunchTimerRef = useRef<NodeJS.Timeout | undefined>(undefined);
+
+ const checkForUpdates = useCallback(async (silent = false) => {
+ // Prevent duplicate checks
+ if (checkingRef.current) {
+ console.log('[AutoUpdater Component] Check already in progress, skipping');
+ return;
+ }
+
try {
+ checkingRef.current = true;
setChecking(true);
setError(null);
- console.log('[AutoUpdater] Checking for updates...');
+ console.log('[AutoUpdater Component] Checking for updates...');
const update = await check();
if (update?.available) {
- console.log(`[AutoUpdater] Update available: v${update.version}`);
- console.log(`[AutoUpdater] Current version: v${update.currentVersion}`);
- console.log(`[AutoUpdater] Release date: ${update.date}`);
+ console.log(`[AutoUpdater Component] Update available: v${update.version}`);
+ console.log(`[AutoUpdater Component] Current version: v${update.currentVersion}`);
+ console.log(`[AutoUpdater Component] Release date: ${update.date}`);
setUpdateInfo(update);
setUpdateAvailable(true);
@@ -49,7 +59,7 @@ export function AutoUpdater({ checkOnMount = true, checkIntervalMinutes = 30 }:
setShowDialog(true);
}
} else {
- console.log('[AutoUpdater] No updates available');
+ console.log('[AutoUpdater Component] No updates available');
if (!silent) {
// Show a brief notification that app is up to date
@@ -59,18 +69,25 @@ export function AutoUpdater({ checkOnMount = true, checkIntervalMinutes = 30 }:
}
} catch (err) {
const errorMessage = err instanceof Error ? err.message : 'Unknown error occurred';
- console.error('[AutoUpdater] Error checking for updates:', errorMessage);
+ console.error('[AutoUpdater Component] Error checking for updates:', errorMessage, err);
- // Only show error if it's not a silent check and not a network error
- if (!silent && !errorMessage.includes('network')) {
- setError(`Failed to check for updates: ${errorMessage}`);
+ // Silently fail for development/network errors
+ if (!silent) {
+ if (!errorMessage.toLowerCase().includes('network') &&
+ !errorMessage.toLowerCase().includes('fetch') &&
+ !errorMessage.toLowerCase().includes('failed to fetch')) {
+ setError(`Failed to check for updates: ${errorMessage}`);
+ } else {
+ console.log('[AutoUpdater Component] Network error during update check (silent)');
+ }
}
} finally {
setChecking(false);
+ checkingRef.current = false;
}
- };
+ }, []);
- const downloadAndInstall = async () => {
+ const downloadAndInstall = useCallback(async () => {
if (!updateInfo) return;
try {
@@ -78,7 +95,7 @@ export function AutoUpdater({ checkOnMount = true, checkIntervalMinutes = 30 }:
setError(null);
setDownloadProgress(0);
- console.log('[AutoUpdater] Starting download and installation...');
+ console.log('[AutoUpdater Component] Starting download and installation...');
// Download and install with progress tracking
let totalBytes = 0;
@@ -89,66 +106,78 @@ export function AutoUpdater({ checkOnMount = true, checkIntervalMinutes = 30 }:
case 'Started':
totalBytes = (event.data as any).contentLength || 0;
downloadedBytes = 0;
- console.log(`[AutoUpdater] Download started - Total size: ${totalBytes} bytes`);
+ console.log(`[AutoUpdater Component] Download started - Total size: ${totalBytes} bytes`);
setDownloadProgress(0);
break;
case 'Progress':
downloadedBytes += event.data.chunkLength;
const progress = totalBytes > 0 ? (downloadedBytes / totalBytes) * 100 : 0;
- console.log(`[AutoUpdater] Download progress: ${progress.toFixed(2)}%`);
setDownloadProgress(progress);
break;
case 'Finished':
- console.log('[AutoUpdater] Download finished, installing...');
+ console.log('[AutoUpdater Component] Download finished, installing...');
setDownloadProgress(100);
break;
}
});
- console.log('[AutoUpdater] Update installed successfully! Preparing to relaunch...');
+ console.log('[AutoUpdater Component] Update installed successfully! Preparing to relaunch...');
setUpdateReady(true);
+ // Clear any existing relaunch timer
+ if (relaunchTimerRef.current) {
+ clearTimeout(relaunchTimerRef.current);
+ }
+
// Auto-relaunch after 2 seconds
- setTimeout(async () => {
- console.log('[AutoUpdater] Relaunching application...');
+ relaunchTimerRef.current = setTimeout(async () => {
+ console.log('[AutoUpdater Component] Relaunching application...');
await relaunch();
}, 2000);
} catch (err) {
const errorMessage = err instanceof Error ? err.message : 'Unknown error occurred';
- console.error('[AutoUpdater] Error during download/install:', errorMessage);
+ console.error('[AutoUpdater Component] Error during download/install:', errorMessage);
setError(`Failed to install update: ${errorMessage}`);
setDownloading(false);
}
- };
+ }, [updateInfo]);
- const handleLater = () => {
+ const handleLater = useCallback(() => {
setShowDialog(false);
- console.log('[AutoUpdater] Update postponed by user');
- };
+ console.log('[AutoUpdater Component] Update postponed by user');
+ }, []);
// Check for updates on mount
useEffect(() => {
if (checkOnMount) {
- // Delay initial check by 3 seconds to not interfere with app startup
+ console.log('[AutoUpdater Component] Initialized');
+ // Delay initial check by 15 seconds to not interfere with app startup
const timer = setTimeout(() => {
+ console.log('[AutoUpdater Component] Running initial update check...');
checkForUpdates(true);
- }, 3000);
+ }, 15000); // Increased to 15s to avoid conflict with hook
- return () => clearTimeout(timer);
+ return () => {
+ clearTimeout(timer);
+ if (relaunchTimerRef.current) {
+ clearTimeout(relaunchTimerRef.current);
+ }
+ };
}
- }, [checkOnMount]);
+ }, [checkOnMount, checkForUpdates]);
// Set up periodic update checks
useEffect(() => {
if (checkIntervalMinutes > 0) {
const interval = setInterval(() => {
+ console.log('[AutoUpdater Component] Running periodic update check...');
checkForUpdates(true);
}, checkIntervalMinutes * 60 * 1000);
return () => clearInterval(interval);
}
- }, [checkIntervalMinutes]);
+ }, [checkIntervalMinutes, checkForUpdates]);
return (
<>
diff --git a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx
index fd17404de..55d1a3334 100644
--- a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx
+++ b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx
@@ -576,6 +576,7 @@ function FinxeptTerminalContent() {
{ label: 'AI Assistant', shortcut: 'F10', action: () => setActiveTab('chat') },
{ label: 'Agent Config', action: () => setActiveTab('agents') },
{ label: 'MCP Servers', action: () => setActiveTab('mcp'), separator: true },
+ { label: 'Monitoring', action: () => setActiveTab('monitoring') },
{ label: 'Trade Visualization', action: () => setActiveTab('trade-viz') },
{ label: 'Excel Workbook', action: () => setActiveTab('excel') },
{ label: 'Node Editor', action: () => setActiveTab('nodes') },
@@ -860,13 +861,6 @@ function FinxeptTerminalContent() {
>
{t('navigation.news')}
</TabsTrigger>
- <TabsTrigger
- value="monitoring"
- style={activeTab === 'monitoring' ? tabStyles.active : tabStyles.default}
- title="Monitoring"
- >
- Monitoring
- </TabsTrigger>
<TabsTrigger
value="portfolio"
style={activeTab === 'portfolio' ? tabStyles.active : tabStyles.default}
diff --git a/fincept-terminal-desktop/src/components/tabs/EquityResearchTab.tsx b/fincept-terminal-desktop/src/components/tabs/EquityResearchTab.tsx
index c41e1b910..1cd9ed839 100644
--- a/fincept-terminal-desktop/src/components/tabs/EquityResearchTab.tsx
+++ b/fincept-terminal-desktop/src/components/tabs/EquityResearchTab.tsx
@@ -1892,8 +1892,24 @@ const EquityResearchTab: React.FC = () => {
flexDirection: 'column',
gap: SPACING.MEDIUM,
}}>
- <AlertCircle size={32} color={COLORS.GRAY} />
- <span>{loading ? 'Loading chart data...' : 'No chart data available'}</span>
+ {loading ? (
+ <>
+ <div style={{
+ width: '40px',
+ height: '40px',
+ border: '3px solid #404040',
+ borderTop: '3px solid #ea580c',
+ borderRadius: '50%',
+ animation: 'spin 1s linear infinite'
+ }} />
+ <span>Loading chart data...</span>
+ </>
+ ) : (
+ <>
+ <AlertCircle size={32} color={COLORS.GRAY} />
+ <span>No chart data available</span>
+ </>
+ )}
</div>
)}
</div>
@@ -2142,6 +2158,16 @@ const EquityResearchTab: React.FC = () => {
height: '400px',
gap: '16px',
}}>
+ {loading && (
+ <div style={{
+ width: '50px',
+ height: '50px',
+ border: '4px solid #404040',
+ borderTop: '4px solid #ea580c',
+ borderRadius: '50%',
+ animation: 'spin 1s linear infinite'
+ }} />
+ )}
<div style={{ color: COLORS.YELLOW, fontSize: '14px', fontWeight: 'bold' }}>
{loading ? ' LOADING FINANCIAL DATA...' : '[WARN]️ NO FINANCIAL DATA AVAILABLE'}
</div>
@@ -2991,6 +3017,14 @@ const EquityResearchTab: React.FC = () => {
height: '400px',
gap: '16px',
}}>
+ <div style={{
+ width: '50px',
+ height: '50px',
+ border: '4px solid #404040',
+ borderTop: '4px solid #ea580c',
+ borderRadius: '50%',
+ animation: 'spin 1s linear infinite'
+ }} />
<div style={{ color: COLORS.YELLOW, fontSize: '14px', fontWeight: 'bold' }}>
FETCHING LATEST NEWS...
</div>
@@ -3200,6 +3234,14 @@ const EquityResearchTab: React.FC = () => {
height: '400px',
gap: '16px',
}}>
+ <div style={{
+ width: '50px',
+ height: '50px',
+ border: '4px solid #404040',
+ borderTop: '4px solid #ea580c',
+ borderRadius: '50%',
+ animation: 'spin 1s linear infinite'
+ }} />
<div style={{ color: COLORS.YELLOW, fontSize: '14px', fontWeight: 'bold' }}>
COMPUTING TECHNICAL INDICATORS...
</div>
diff --git a/fincept-terminal-desktop/src/components/tabs/LoginAuditDashboard.tsx b/fincept-terminal-desktop/src/components/tabs/LoginAuditDashboard.tsx
index 6fcb94b0c..815e20930 100644
--- a/fincept-terminal-desktop/src/components/tabs/LoginAuditDashboard.tsx
+++ b/fincept-terminal-desktop/src/components/tabs/LoginAuditDashboard.tsx
@@ -15,6 +15,7 @@ import React, { useState, useEffect } from 'react';
import { useTerminalTheme } from '@/contexts/ThemeContext';
import { useAuth } from '@/contexts/AuthContext';
import { useTranslation } from 'react-i18next';
+import { APP_VERSION } from '@/constants/version';
// Types
interface LoginEvent {
@@ -64,7 +65,7 @@ const mockLoginEvents: LoginEvent[] = [
ipAddress: '192.168.1.1',
geoCountry: 'US',
geoCity: 'New York',
- clientVersion: '3.1.4',
+ clientVersion: APP_VERSION,
},
{
logId: '2',
diff --git a/fincept-terminal-desktop/src/components/tabs/MaritimeTabDeck.tsx b/fincept-terminal-desktop/src/components/tabs/MaritimeTabDeck.tsx
index 4e3e25fb4..0fb3395ec 100644
--- a/fincept-terminal-desktop/src/components/tabs/MaritimeTabDeck.tsx
+++ b/fincept-terminal-desktop/src/components/tabs/MaritimeTabDeck.tsx
@@ -556,7 +556,7 @@ export default function MaritimeTabDeck() {
)}
</div>
<button
- onClick={searchByLocation}
+ onClick={() => searchByLocation()}
disabled={searchingLocation || !locationSearch.trim()}
style={{
padding: '4px 12px',
diff --git a/fincept-terminal-desktop/src/components/tabs/MarketsTab.tsx b/fincept-terminal-desktop/src/components/tabs/MarketsTab.tsx
index 1d934eced..3879492e0 100644
--- a/fincept-terminal-desktop/src/components/tabs/MarketsTab.tsx
+++ b/fincept-terminal-desktop/src/components/tabs/MarketsTab.tsx
@@ -437,6 +437,48 @@ const MarketsTab: React.FC = () => {
);
};
+ // Show loading screen while database initializes
+ if (!dbInitialized) {
+ return (
+ <div style={{
+ height: '100%',
+ backgroundColor: colors.background,
+ color: colors.text,
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ justifyContent: 'center',
+ gap: '20px'
+ }}>
+ <div style={{
+ width: '60px',
+ height: '60px',
+ border: '4px solid #404040',
+ borderTop: '4px solid #ea580c',
+ borderRadius: '50%',
+ animation: 'spin 1s linear infinite'
+ }} />
+ <style>{`
+ @keyframes spin {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(360deg); }
+ }
+ `}</style>
+ <div style={{ textAlign: 'center', maxWidth: '500px' }}>
+ <h3 style={{ color: '#ea580c', fontSize: '18px', marginBottom: '10px' }}>
+ {t('loading.title', 'Initializing Markets Terminal')}
+ </h3>
+ <p style={{ color: '#a3a3a3', fontSize: '13px', lineHeight: '1.5' }}>
+ {t('loading.description', 'Setting up database and market data connections...')}
+ </p>
+ <p style={{ color: '#787878', fontSize: '11px', marginTop: '10px' }}>
+ {t('loading.note', 'This may take a few moments on first launch')}
+ </p>
+ </div>
+ </div>
+ );
+ }
+
return (
<div style={{
height: '100%',
diff --git a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/CFAQuantPanel.tsx b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/CFAQuantPanel.tsx
index ce5506b0d..e3e0e13f1 100644
--- a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/CFAQuantPanel.tsx
+++ b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/CFAQuantPanel.tsx
@@ -332,17 +332,19 @@ export function CFAQuantPanel() {
}, [analysisResult, priceData.length, selectedAnalysis]);
// Mouse selection handlers for drag zoom
- const handleMouseDown = useCallback((e: { activeLabel?: number }, chartType: 'data' | 'results') => {
- if (e.activeLabel !== undefined) {
- setRefAreaLeft(e.activeLabel);
+ const handleMouseDown = useCallback((e: any, chartType: 'data' | 'results') => {
+ const activeLabel = typeof e.activeLabel === 'string' ? parseInt(e.activeLabel, 10) : e.activeLabel;
+ if (activeLabel !== undefined && !isNaN(activeLabel)) {
+ setRefAreaLeft(activeLabel);
setIsSelecting(true);
setActiveChart(chartType);
}
}, []);
- const handleMouseMove = useCallback((e: { activeLabel?: number }) => {
- if (isSelecting && e.activeLabel !== undefined) {
- setRefAreaRight(e.activeLabel);
+ const handleMouseMove = useCallback((e: any) => {
+ const activeLabel = typeof e.activeLabel === 'string' ? parseInt(e.activeLabel, 10) : e.activeLabel;
+ if (isSelecting && activeLabel !== undefined && !isNaN(activeLabel)) {
+ setRefAreaRight(activeLabel);
}
}, [isSelecting]);
@@ -1705,7 +1707,7 @@ export function CFAQuantPanel() {
projection: projectedValue,
projectionUpper: projectedValue + ciWidth,
projectionLower: projectedValue - ciWidth,
- });
+ } as any);
}
}
@@ -1805,7 +1807,7 @@ export function CFAQuantPanel() {
forecast: forecast,
forecastUpper: ciUpper ?? (forecast + defaultCiWidth),
forecastLower: ciLower ?? (forecast - defaultCiWidth),
- });
+ } as any);
});
} else {
// Generate simple forecast projection if not provided by backend
@@ -1830,7 +1832,7 @@ export function CFAQuantPanel() {
forecast: forecastVal,
forecastUpper: forecastVal + ciWidth,
forecastLower: forecastVal - ciWidth,
- });
+ } as any);
}
}
@@ -1920,7 +1922,7 @@ export function CFAQuantPanel() {
enhancedData[lastTrainIdx] = {
...enhancedData[lastTrainIdx],
forecastStart: enhancedData[lastTrainIdx].value,
- };
+ } as any;
}
return [...enhancedData, ...futureForecasts];
@@ -2116,10 +2118,10 @@ export function CFAQuantPanel() {
bootstrapCiHigh = ci[1];
}
// Get indices from chart data
- if (resultChartData.length > 0 && resultChartData[0]?.meanBinIdx !== undefined) {
- bootstrapMeanIdx = resultChartData[0].meanBinIdx as number;
- bootstrapCiLowIdx = resultChartData[0].ciLowIdx as number;
- bootstrapCiHighIdx = resultChartData[0].ciHighIdx as number;
+ if (resultChartData.length > 0 && (resultChartData[0] as any)?.meanBinIdx !== undefined) {
+ bootstrapMeanIdx = (resultChartData[0] as any).meanBinIdx as number;
+ bootstrapCiLowIdx = (resultChartData[0] as any).ciLowIdx as number;
+ bootstrapCiHighIdx = (resultChartData[0] as any).ciHighIdx as number;
}
}
}
@@ -2243,8 +2245,8 @@ export function CFAQuantPanel() {
axisLine={{ stroke: BB.borderDark }}
interval={selectedAnalysis === 'resampling_methods' ? 'preserveStartEnd' : 'preserveStartEnd'}
tickFormatter={(val) => {
- if (selectedAnalysis === 'resampling_methods' && resultChartData[val]?.binCenter !== undefined) {
- return formatNumber(resultChartData[val].binCenter as number, 1);
+ if (selectedAnalysis === 'resampling_methods' && (resultChartData[val] as any)?.binCenter !== undefined) {
+ return formatNumber((resultChartData[val] as any).binCenter as number, 1);
}
return val;
}}
@@ -2361,9 +2363,9 @@ export function CFAQuantPanel() {
/>
)}
{/* Stationarity Test: Overall Mean Reference */}
- {selectedAnalysis === 'stationarity_test' && resultChartData.length > 0 && (resultChartData[0] as { overallMean?: number }).overallMean !== undefined && (
+ {selectedAnalysis === 'stationarity_test' && resultChartData.length > 0 && (resultChartData[0] as any).overallMean !== undefined && (
<ReferenceLine
- y={(resultChartData[0] as { overallMean: number }).overallMean}
+ y={(resultChartData[0] as any).overallMean}
stroke={BB.blueLight}
strokeWidth={2}
strokeDasharray="5 5"
@@ -2388,8 +2390,8 @@ export function CFAQuantPanel() {
dataKey="suspiciousValue"
fill={BB.amber}
name="Suspicious"
- shape={(props: { cx: number; cy: number }) => {
- if (!props.cx || !props.cy) return null;
+ shape={(props: any) => {
+ if (!props.cx || !props.cy) return <g />;
return (
<circle
cx={props.cx}
@@ -2409,8 +2411,8 @@ export function CFAQuantPanel() {
dataKey="outlierValue"
fill={BB.red}
name="Outlier"
- shape={(props: { cx: number; cy: number }) => {
- if (!props.cx || !props.cy) return null;
+ shape={(props: any) => {
+ if (!props.cx || !props.cy) return <g />;
return (
<g>
<circle
@@ -2437,9 +2439,9 @@ export function CFAQuantPanel() {
/>
)}
{/* Data Quality: Mean reference line */}
- {selectedAnalysis === 'validate_data' && resultChartData.length > 0 && (resultChartData[0] as { mean?: number }).mean !== undefined && (
+ {selectedAnalysis === 'validate_data' && resultChartData.length > 0 && (resultChartData[0] as any).mean !== undefined && (
<ReferenceLine
- y={(resultChartData[0] as { mean: number }).mean}
+ y={(resultChartData[0] as any).mean}
stroke={BB.blueLight}
strokeWidth={2}
strokeDasharray="5 5"
@@ -2462,7 +2464,7 @@ export function CFAQuantPanel() {
<Bar
dataKey="value"
name="Frequency"
- shape={(props: { x: number; y: number; width: number; height: number; payload?: { inCI?: boolean; isMean?: boolean } }) => {
+ shape={(props: any) => {
const { x, y, width, height, payload } = props;
const inCI = payload?.inCI;
const isMean = payload?.isMean;
diff --git a/fincept-terminal-desktop/src/components/tabs/dashboard/widgets/BaseWidget.tsx b/fincept-terminal-desktop/src/components/tabs/dashboard/widgets/BaseWidget.tsx
index b06f25707..7a8d9dabf 100644
--- a/fincept-terminal-desktop/src/components/tabs/dashboard/widgets/BaseWidget.tsx
+++ b/fincept-terminal-desktop/src/components/tabs/dashboard/widgets/BaseWidget.tsx
@@ -147,12 +147,28 @@ export const BaseWidget: React.FC<BaseWidgetProps> = ({
</div>
) : isLoading ? (
<div style={{
- padding: '12px',
- color: BLOOMBERG_GRAY,
- fontSize: '10px',
- textAlign: 'center'
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ justifyContent: 'center',
+ height: '100%',
+ gap: '8px'
}}>
- {t('widgets.loading')}
+ <div style={{
+ width: '30px',
+ height: '30px',
+ border: '3px solid #404040',
+ borderTop: '3px solid #ea580c',
+ borderRadius: '50%',
+ animation: 'spin 1s linear infinite'
+ }} />
+ <div style={{
+ color: BLOOMBERG_GRAY,
+ fontSize: '9px',
+ textAlign: 'center'
+ }}>
+ {t('widgets.loading')}
+ </div>
</div>
) : (
children
diff --git a/fincept-terminal-desktop/src/components/tabs/equity-trading/integrations/PaperTradingIntegration.ts b/fincept-terminal-desktop/src/components/tabs/equity-trading/integrations/PaperTradingIntegration.ts
index c88bdae3f..e09cff104 100644
--- a/fincept-terminal-desktop/src/components/tabs/equity-trading/integrations/PaperTradingIntegration.ts
+++ b/fincept-terminal-desktop/src/components/tabs/equity-trading/integrations/PaperTradingIntegration.ts
@@ -8,6 +8,7 @@ import { OrderRequest, UnifiedOrder, UnifiedPosition, BrokerType, OrderSide, Ord
import { createPaperTradingAdapter } from '@/paper-trading';
import type { IExchangeAdapter } from '@/brokers/crypto/types';
import type { PaperTradingConfig } from '@/paper-trading/types';
+import { APP_VERSION } from '@/constants/version';
/**
* Adapter bridge to make equity brokers compatible with crypto paper trading system
@@ -193,7 +194,7 @@ export class PaperTradingIntegration {
id: 'paper-trading',
name: 'Paper Trading',
type: PluginType.PRE_ORDER,
- version: '3.1.4', // Updated to match paper trading system version
+ version: APP_VERSION, // Automatically synced with app version
execute: async (context: PluginContext): Promise<PluginResult> => {
if (!this.enabled) {
diff --git a/fincept-terminal-desktop/src/constants/version.ts b/fincept-terminal-desktop/src/constants/version.ts
index 20858cc9b..4f81da9c9 100644
--- a/fincept-terminal-desktop/src/constants/version.ts
+++ b/fincept-terminal-desktop/src/constants/version.ts
@@ -1,8 +1,12 @@
// Application version constants
// This file is the single source of truth for the app version displayed in the UI
-// The build version comes from tauri.conf.json and package.json
+// Version is automatically synced from package.json during build
-export const APP_VERSION = '3.1.4';
+// IMPORTANT: Do not modify this file manually
+// Run `bun run sync-version` to sync from package.json
+// Or edit package.json and run build/dev to auto-sync
+
+export const APP_VERSION = '3.1.6';
export const APP_NAME = 'Fincept Terminal';
export const APP_BUILD_DATE = new Date().toISOString().split('T')[0];
diff --git a/fincept-terminal-desktop/src/hooks/useAutoUpdater.ts b/fincept-terminal-desktop/src/hooks/useAutoUpdater.ts
index 884c15200..5098b6b0a 100644
--- a/fincept-terminal-desktop/src/hooks/useAutoUpdater.ts
+++ b/fincept-terminal-desktop/src/hooks/useAutoUpdater.ts
@@ -1,10 +1,10 @@
-import { useEffect, useState } from 'react';
+import { useEffect, useState, useCallback, useRef } from 'react';
import { check, type Update } from '@tauri-apps/plugin-updater';
import { relaunch } from '@tauri-apps/plugin-process';
const CHECK_INTERVAL_MS = 30 * 60 * 1000; // Check every 30 minutes
-const LAST_CHECK_KEY = 'updater_last_check';
-const DISMISSED_VERSION_KEY = 'updater_dismissed_version';
+const LAST_CHECK_KEY = 'hook_updater_last_check';
+const DISMISSED_VERSION_KEY = 'hook_updater_dismissed_version';
interface UseAutoUpdaterReturn {
updateAvailable: boolean;
@@ -26,20 +26,33 @@ export function useAutoUpdater(): UseAutoUpdaterReturn {
const [installProgress, setInstallProgress] = useState(0);
const [error, setError] = useState<string | null>(null);
- const checkForUpdate = async (silent = false) => {
+ const checkingRef = useRef<boolean>(false);
+ const relaunchTimerRef = useRef<NodeJS.Timeout | undefined>(undefined);
+
+ const checkForUpdate = useCallback(async (silent = false) => {
+ // Prevent duplicate checks
+ if (checkingRef.current) {
+ console.log('[AutoUpdater] Check already in progress, skipping');
+ return;
+ }
+
try {
+ checkingRef.current = true;
setIsChecking(true);
setError(null);
const update = await check();
if (update?.available) {
+ console.log('[AutoUpdater] Update available:', update.version);
// Check if this version was previously dismissed
const dismissedVersion = localStorage.getItem(DISMISSED_VERSION_KEY);
if (dismissedVersion === update.version) {
+ console.log('[AutoUpdater] Update was dismissed by user');
if (!silent) {
- setError('This update was previously dismissed. A new update will be shown when available.');
+ // Don't show as error, just log
+ console.log('[AutoUpdater] This update was previously dismissed');
}
return;
}
@@ -50,6 +63,7 @@ export function useAutoUpdater(): UseAutoUpdaterReturn {
// Update last check timestamp
localStorage.setItem(LAST_CHECK_KEY, Date.now().toString());
} else {
+ console.log('[AutoUpdater] No updates available');
if (!silent) {
setError('You are running the latest version!');
setTimeout(() => setError(null), 3000);
@@ -57,18 +71,26 @@ export function useAutoUpdater(): UseAutoUpdaterReturn {
}
} catch (err) {
const errorMessage = err instanceof Error ? err.message : 'Unknown error occurred';
- console.error('[AutoUpdater] Error checking for updates:', errorMessage);
-
- // Only show error if it's not a network-related error or if not silent
- if (!silent && !errorMessage.toLowerCase().includes('network') && !errorMessage.toLowerCase().includes('fetch')) {
- setError(`Failed to check for updates: ${errorMessage}`);
+ console.error('[AutoUpdater] Error checking for updates:', errorMessage, err);
+
+ // Silently fail for development/network errors
+ if (!silent) {
+ // Only show user-facing errors for non-network issues
+ if (!errorMessage.toLowerCase().includes('network') &&
+ !errorMessage.toLowerCase().includes('fetch') &&
+ !errorMessage.toLowerCase().includes('failed to fetch')) {
+ setError(`Failed to check for updates: ${errorMessage}`);
+ } else {
+ console.log('[AutoUpdater] Network error during update check (silent)');
+ }
}
} finally {
setIsChecking(false);
+ checkingRef.current = false;
}
- };
+ }, []);
- const installUpdate = async () => {
+ const installUpdate = useCallback(async () => {
if (!updateInfo) {
console.error('[AutoUpdater] No update info available');
setError('No update information available');
@@ -80,7 +102,6 @@ export function useAutoUpdater(): UseAutoUpdaterReturn {
setInstallProgress(0);
setError(null);
-
// Download and install with progress tracking
let totalBytes = 0;
let downloadedBytes = 0;
@@ -91,6 +112,7 @@ export function useAutoUpdater(): UseAutoUpdaterReturn {
totalBytes = (event.data as any).contentLength || 0;
downloadedBytes = 0;
setInstallProgress(0);
+ console.log('[AutoUpdater] Download started, size:', totalBytes);
break;
case 'Progress':
downloadedBytes += event.data.chunkLength;
@@ -99,13 +121,20 @@ export function useAutoUpdater(): UseAutoUpdaterReturn {
break;
case 'Finished':
setInstallProgress(100);
+ console.log('[AutoUpdater] Download finished');
break;
}
});
+ console.log('[AutoUpdater] Update installed, relaunching in 2s...');
+
+ // Clear any existing relaunch timer
+ if (relaunchTimerRef.current) {
+ clearTimeout(relaunchTimerRef.current);
+ }
// Give user a moment to see the success message
- setTimeout(async () => {
+ relaunchTimerRef.current = setTimeout(async () => {
try {
await relaunch();
} catch (relaunchError) {
@@ -122,34 +151,43 @@ export function useAutoUpdater(): UseAutoUpdaterReturn {
setIsInstalling(false);
setInstallProgress(0);
}
- };
+ }, [updateInfo]);
- const dismissUpdate = () => {
+ const dismissUpdate = useCallback(() => {
if (updateInfo?.version) {
// Store the dismissed version so we don't show it again
localStorage.setItem(DISMISSED_VERSION_KEY, updateInfo.version);
+ console.log('[AutoUpdater] Update dismissed:', updateInfo.version);
}
setUpdateAvailable(false);
setUpdateInfo(null);
setError(null);
- };
+ }, [updateInfo]);
useEffect(() => {
- // Perform initial check on mount (delayed by 5 seconds to not interfere with app startup)
+ console.log('[AutoUpdater] Hook initialized');
+
+ // Perform initial check on mount (delayed by 10 seconds to not interfere with app startup)
const initialCheckTimer = setTimeout(() => {
+ console.log('[AutoUpdater] Running initial update check...');
checkForUpdate(true);
- }, 5000);
+ }, 10000); // Increased delay to 10s
// Set up periodic checks every 30 minutes
const interval = setInterval(() => {
+ console.log('[AutoUpdater] Running periodic update check...');
checkForUpdate(true);
}, CHECK_INTERVAL_MS);
return () => {
+ console.log('[AutoUpdater] Hook cleanup');
clearTimeout(initialCheckTimer);
clearInterval(interval);
+ if (relaunchTimerRef.current) {
+ clearTimeout(relaunchTimerRef.current);
+ }
};
- }, []);
+ }, [checkForUpdate]);
return {
updateAvailable,