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.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
version 4.1.0 update
tilakpatel22c1675621d7f7
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 0e14c48e0..c10b6498b 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -328,39 +328,16 @@ jobs:- name: Install yt-dlprun: pip install yt-dlp- # ── Configure + Build ─────────────────────────────────────────────────- # No FINCEPT_BUILD_INSTALLER / no QtIFW on Linux — we ship an AppImage- # instead (see "Build AppImage" step below).- - name: Configure CMake- working-directory: fincept-qt- run: |- cmake -B build -G Ninja \- -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \- -DCMAKE_PREFIX_PATH="${QT_ROOT_DIR}" \- -DOPENSSL_ROOT_DIR=/usr \- -DCMAKE_C_COMPILER_LAUNCHER=ccache \- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \- -DFINCEPT_REQUIRE_BUNDLED_YTDLP=ON-- - name: Build- working-directory: fincept-qt- run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel $(nproc)-- # ── Verify ───────────────────────────────────────────────────────────- - name: Verify binary- working-directory: fincept-qt- run: |- BINARY="build/${{ env.APP_NAME }}"- [ -f "$BINARY" ] || { echo "::error::Binary not found"; exit 1; }- echo "Binary: $BINARY ($(du -sh "$BINARY" | cut -f1))"- file "$BINARY"-# ── Generate Linux desktop icon (shared by AppImage/.deb/.rpm) ─────────# CMake's install rule renames resources/fincept.png → fincept-terminal.png# (the name the .desktop `Icon=` key and the .rpm %files manifest expect).- # The repo only ships resources/fincept.ico, so derive the PNG here once,- # before any packaging step runs `cmake --install`. Without this the .rpm- # build fails with: File not found: .../fincept-terminal.png.+ # The repo only ships resources/fincept.ico, so derive the PNG here.+ #+ # CRITICAL: this MUST run BEFORE `cmake -B build`. CMake evaluates the+ # install rule's `if(EXISTS resources/fincept.png)` (CMakeLists.txt) at+ # CONFIGURE time and bakes the decision into cmake_install.cmake. If the+ # PNG appears only after configure, `cmake --install` never emits it and+ # the .rpm build fails: File not found: .../fincept-terminal.png.- name: Generate Linux icon PNGworking-directory: fincept-qtrun: |@@ -385,6 +362,33 @@ jobs:fiecho "Icon ready: resources/fincept.png ($(du -h resources/fincept.png | cut -f1))"+ # ── Configure + Build ─────────────────────────────────────────────────+ # No FINCEPT_BUILD_INSTALLER / no QtIFW on Linux — we ship an AppImage+ # instead (see "Build AppImage" step below).+ - name: Configure CMake+ working-directory: fincept-qt+ run: |+ cmake -B build -G Ninja \+ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \+ -DCMAKE_PREFIX_PATH="${QT_ROOT_DIR}" \+ -DOPENSSL_ROOT_DIR=/usr \+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \+ -DFINCEPT_REQUIRE_BUNDLED_YTDLP=ON++ - name: Build+ working-directory: fincept-qt+ run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel $(nproc)++ # ── Verify ───────────────────────────────────────────────────────────+ - name: Verify binary+ working-directory: fincept-qt+ run: |+ BINARY="build/${{ env.APP_NAME }}"+ [ -f "$BINARY" ] || { echo "::error::Binary not found"; exit 1; }+ echo "Binary: $BINARY ($(du -sh "$BINARY" | cut -f1))"+ file "$BINARY"+# ── Build self-contained AppImage ─────────────────────────────────────# The previous release workflow ran CPack IFW on Linux but didn't bundle# Qt at all — the installer produced a "binary + desktop file" payload@@ -605,6 +609,20 @@ jobs:mkdir -p "${RPM_ROOT}/usr"cmake --install build --prefix "${RPM_ROOT}/usr"+ # Belt-and-suspenders: the %files manifest hard-requires+ # fincept-terminal.png. The "Generate Linux icon PNG" step should have+ # made cmake install it, but if that ever regresses, fall back to the+ # always-installed flatpak-named copy so rpmbuild never fails here.+ ICON_DIR="${RPM_ROOT}/usr/share/icons/hicolor/256x256/apps"+ if [ ! -f "${ICON_DIR}/fincept-terminal.png" ] && [ -f "${ICON_DIR}/in.fincept.FinceptTerminal.png" ]; then+ cp "${ICON_DIR}/in.fincept.FinceptTerminal.png" "${ICON_DIR}/fincept-terminal.png"+ fi+ if [ ! -f "${ICON_DIR}/fincept-terminal.png" ]; then+ echo "::error::fincept-terminal.png missing from staged RPM tree (${ICON_DIR})"+ ls -la "${ICON_DIR}" 2>&1 || true+ exit 1+ fi+mkdir -p ~/rpmbuild/{SPECS,BUILDROOT}cat > ~/rpmbuild/SPECS/fincept-terminal.spec <<EOFdiff --git a/fincept-qt/CMakeLists.txt b/fincept-qt/CMakeLists.txtindex 1fc7ff309..3b2ed2937 100644--- a/fincept-qt/CMakeLists.txt+++ b/fincept-qt/CMakeLists.txt@@ -751,6 +751,7 @@ set(DATAHUB_SOURCESset(AUTH_SOURCESsrc/auth/AuthManager.cppsrc/auth/AuthApi.cpp+ src/auth/GoogleDesktopLogin.cppsrc/auth/UserApi.cppsrc/auth/SessionGuard.cppsrc/auth/PinManager.cppdiff --git a/fincept-qt/src/auth/AuthApi.cpp b/fincept-qt/src/auth/AuthApi.cppindex 399b2811a..4abb775dd 100644--- a/fincept-qt/src/auth/AuthApi.cpp+++ b/fincept-qt/src/auth/AuthApi.cpp@@ -201,6 +201,12 @@ void AuthApi::verify_mfa(const QString& email, const QString& otp, Callback cb)request("POST", "/user/verify-mfa", body, cb);}+void AuthApi::redeem_desktop_handoff(const QString& code, Callback cb) {+ QJsonObject body;+ body["token"] = code;+ request("POST", "/user/auth/desktop-handoff/redeem", body, cb);+}+// ── Authenticated endpoints (HttpClient carries X-API-Key + X-Session-Token) ─void AuthApi::logout(Callback cb) {diff --git a/fincept-qt/src/auth/AuthApi.h b/fincept-qt/src/auth/AuthApi.hindex 3f9e586d8..41ba4cc7a 100644--- a/fincept-qt/src/auth/AuthApi.h+++ b/fincept-qt/src/auth/AuthApi.h@@ -24,6 +24,10 @@ class AuthApi : public QObject {void reset_password(const ResetPasswordRequest& req, Callback cb);void verify_mfa(const QString& email, const QString& otp, Callback cb);+ // Desktop Google login: exchange a one-time handoff code (from the browser+ // loopback redirect) for a real session. Unauthenticated.+ void redeem_desktop_handoff(const QString& code, Callback cb);+// Authenticated (uses api_key stored on HttpClient)void logout(Callback cb);void session_pulse(Callback cb);diff --git a/fincept-qt/src/auth/AuthManager.cpp b/fincept-qt/src/auth/AuthManager.cppindex 894c63904..110a1e720 100644--- a/fincept-qt/src/auth/AuthManager.cpp+++ b/fincept-qt/src/auth/AuthManager.cpp@@ -1,6 +1,7 @@#include "auth/AuthManager.h"#include "auth/AuthApi.h"+#include "auth/GoogleDesktopLogin.h"#include "auth/PinManager.h"#include "auth/UserApi.h"#include "core/logging/Logger.h"@@ -289,6 +290,55 @@ void AuthManager::login(const QString& email, const QString& password, bool forc});}+// ── Google desktop login (website loopback handoff) ──────────────────────────++void AuthManager::login_with_google() {+ set_loading(true);++ // Owned by AuthManager; self-deletes after emitting code_received/failed.+ auto* flow = new GoogleDesktopLogin(this);++ connect(flow, &GoogleDesktopLogin::code_received, this, [this](const QString& code) {+ AuthApi::instance().redeem_desktop_handoff(code, [this](ApiResponse r) {+ if (!r.success) {+ set_loading(false);+ emit login_failed(r.error.isEmpty() ? "Google login failed" : r.error);+ return;+ }+ const auto data = unwrap_data(r.data);+ complete_desktop_login(data["api_key"].toString(), data["session_token"].toString());+ });+ });++ connect(flow, &GoogleDesktopLogin::failed, this, [this](const QString& message) {+ set_loading(false);+ emit login_failed(message);+ });++ flow->start();+}++void AuthManager::complete_desktop_login(const QString& api_key, const QString& session_token) {+ if (api_key.isEmpty()) {+ set_loading(false);+ emit login_failed("No API key returned from server");+ return;+ }++ // Mirror the login() success tail exactly so the desktop handoff lands in+ // the same post-login machinery (profile + subscription fetch, save_session,+ // fincept LLM auto-config, login_succeeded).+ apply_tokens(api_key, session_token);++ session_.authenticated = true;+ session_.api_key = api_key;+ session_.session_token = session_token;+ session_.device_id = generate_device_id();++ LOG_INFO("Auth", "Desktop (Google) login successful");+ fetch_user_profile([this] { emit login_succeeded(); });+}+// ── Signup ───────────────────────────────────────────────────────────────────void AuthManager::signup(const QString& username, const QString& email, const QString& password, const QString& phone,diff --git a/fincept-qt/src/auth/AuthManager.h b/fincept-qt/src/auth/AuthManager.hindex 55932b3c2..eefe3c040 100644--- a/fincept-qt/src/auth/AuthManager.h+++ b/fincept-qt/src/auth/AuthManager.h@@ -20,6 +20,12 @@ class AuthManager : public QObject {// Auth flowsvoid login(const QString& email, const QString& password, bool force_login = false);++ /// Desktop Google sign-in via the website loopback handoff. Opens the+ /// browser, redeems the returned one-time code, then drives the same+ /// post-login flow as login() (emits login_succeeded / login_failed).+ void login_with_google();+void signup(const QString& username, const QString& email, const QString& password, const QString& phone,const QString& country = {}, const QString& country_code = {});void verify_otp(const QString& email, const QString& otp);@@ -74,6 +80,9 @@ class AuthManager : public QObject {void fetch_user_profile(std::function<void()> on_done = {});void fetch_user_subscription(std::function<void()> on_done = {});void complete_auth_flow(std::function<void()> on_done);+ /// Inject a redeemed desktop-handoff session (api_key + session_token) and+ /// run the shared post-login flow. Shared by login_with_google().+ void complete_desktop_login(const QString& api_key, const QString& session_token);void auto_configure_fincept_llm();QString generate_device_id() const;QJsonObject unwrap_data(const QJsonObject& raw) const;diff --git a/fincept-qt/src/auth/GoogleDesktopLogin.cpp b/fincept-qt/src/auth/GoogleDesktopLogin.cppnew file mode 100644index 000000000..3ccaa56fb--- /dev/null+++ b/fincept-qt/src/auth/GoogleDesktopLogin.cpp@@ -0,0 +1,154 @@+#include "auth/GoogleDesktopLogin.h"++#include "core/config/AppConfig.h"+#include "core/logging/Logger.h"++#include <QByteArray>+#include <QDesktopServices>+#include <QHostAddress>+#include <QTcpServer>+#include <QTcpSocket>+#include <QTimer>+#include <QUrl>+#include <QUrlQuery>++#include <memory>++namespace fincept::auth {++GoogleDesktopLogin::GoogleDesktopLogin(QObject* parent) : QObject(parent) {}++GoogleDesktopLogin::~GoogleDesktopLogin() = default;++void GoogleDesktopLogin::start() {+ server_ = new QTcpServer(this);+ connect(server_, &QTcpServer::newConnection, this, &GoogleDesktopLogin::on_new_connection);++ // Loopback only, ephemeral port — the website's open-redirect guard accepts+ // exactly 127.0.0.1 / localhost / [::1].+ if (!server_->listen(QHostAddress::LocalHost, 0)) {+ finish_error(tr("Could not start the local login listener."));+ return;+ }++ const quint16 port = server_->serverPort();+ const QString callback = QString("http://127.0.0.1:%1").arg(port);++ // Open the API's server-side OAuth start endpoint (it redirects to Google and+ // does the token exchange). Same base as HttpClient so dev/staging overrides+ // apply. QUrlQuery percent-encodes desktop_cb on serialization.+ QString base = AppConfig::instance().api_base_url();+ if (base.endsWith('/'))+ base.chop(1);+ QUrl start_url(base + QStringLiteral("/user/auth/google/start"));+ QUrlQuery query;+ query.addQueryItem(QStringLiteral("desktop_cb"), callback);+ start_url.setQuery(query);++ timeout_ = new QTimer(this);+ timeout_->setSingleShot(true);+ connect(timeout_, &QTimer::timeout, this,+ [this]() { finish_error(tr("Login timed out. Please try again.")); });+ timeout_->start(kTimeoutMs);++ LOG_INFO("GoogleLogin", QString("Loopback listening on %1; opening browser").arg(callback));++ if (!QDesktopServices::openUrl(start_url))+ finish_error(tr("Could not open the browser for Google sign-in."));+}++void GoogleDesktopLogin::on_new_connection() {+ QTcpSocket* sock = server_->nextPendingConnection();+ if (!sock)+ return;+ connect(sock, &QTcpSocket::disconnected, sock, &QObject::deleteLater);++ auto buffer = std::make_shared<QByteArray>();+ connect(sock, &QTcpSocket::readyRead, this, [this, sock, buffer]() {+ buffer->append(sock->readAll());++ // We only need the request line: "GET /?code=<code> HTTP/1.1".+ const int line_end = buffer->indexOf("\r\n");+ if (line_end < 0)+ return; // wait for the full request line++ const QByteArray request_line = buffer->left(line_end);+ const QList<QByteArray> parts = request_line.split(' ');+ if (parts.size() < 2) {+ send_page(sock, tr("Fincept"), tr("Malformed request."));+ sock->disconnectFromHost();+ return;+ }++ const QUrl url(QStringLiteral("http://127.0.0.1") + QString::fromUtf8(parts[1]));+ const QString code = QUrlQuery(url).queryItemValue("code");++ if (code.isEmpty()) {+ // Secondary request (e.g. /favicon.ico) or callback without a code.+ // Keep the listener alive — the real callback may still be coming.+ send_page(sock, tr("Fincept Terminal"), tr("Waiting for sign-in to complete…"));+ sock->disconnectFromHost();+ return;+ }++ if (done_) {+ send_page(sock, tr("Fincept Terminal"), tr("Login already completed — you can close this tab."));+ sock->disconnectFromHost();+ return;+ }+ finish_success(code, sock);+ });+}++void GoogleDesktopLogin::finish_success(const QString& code, QTcpSocket* sock) {+ done_ = true;+ send_page(sock, tr("Login complete"), tr("You can close this tab and return to Fincept Terminal."));+ sock->disconnectFromHost();+ LOG_INFO("GoogleLogin", "Handoff code received via loopback");+ emit code_received(code);+ cleanup();+}++void GoogleDesktopLogin::finish_error(const QString& message) {+ if (done_)+ return;+ done_ = true;+ LOG_WARN("GoogleLogin", "Login failed: " + message);+ emit failed(message);+ cleanup();+}++void GoogleDesktopLogin::send_page(QTcpSocket* sock, const QString& title, const QString& body) {+ const QString html =+ QStringLiteral(+ "<!doctype html><html><head><meta charset='utf-8'><title>%1</title>"+ "<style>body{font-family:-apple-system,Segoe UI,Roboto,sans-serif;background:#0d0d0d;color:#e6e6e6;"+ "display:flex;align-items:center;justify-content:center;height:100vh;margin:0}"+ ".card{text-align:center;padding:32px 44px;border:1px solid #2a2a2a;border-radius:8px;background:#161616}"+ "h1{color:#f5a623;font-size:18px;margin:0 0 10px;letter-spacing:1px}"+ "p{color:#9a9a9a;font-size:13px;margin:0}</style></head>"+ "<body><div class='card'><h1>%1</h1><p>%2</p></div></body></html>")+ .arg(title.toHtmlEscaped(), body.toHtmlEscaped());++ const QByteArray body_bytes = html.toUtf8();+ QByteArray resp;+ resp += "HTTP/1.1 200 OK\r\n";+ resp += "Content-Type: text/html; charset=utf-8\r\n";+ resp += "Content-Length: " + QByteArray::number(body_bytes.size()) + "\r\n";+ resp += "Connection: close\r\n\r\n";+ resp += body_bytes;++ sock->write(resp);+ sock->flush();+ sock->waitForBytesWritten(1000); // tiny local write — ensure the page lands before teardown+}++void GoogleDesktopLogin::cleanup() {+ if (timeout_)+ timeout_->stop();+ if (server_)+ server_->close();+ deleteLater();+}++} // namespace fincept::authdiff --git a/fincept-qt/src/auth/GoogleDesktopLogin.h b/fincept-qt/src/auth/GoogleDesktopLogin.hnew file mode 100644index 000000000..a8cf8ec3f--- /dev/null+++ b/fincept-qt/src/auth/GoogleDesktopLogin.h@@ -0,0 +1,48 @@+#pragma once++#include <QObject>+#include <QString>++class QTcpServer;+class QTcpSocket;+class QTimer;++namespace fincept::auth {++// Drives the server-side Google sign-in for the desktop app:+// 1. bind a loopback listener on 127.0.0.1:<ephemeral port>+// 2. open the browser to api.fincept.in/user/auth/google/start?desktop_cb=...+// (the API redirects to Google and does the token exchange server-side)+// 5. catch the redirect GET /?code=<handoff_code>, reply with a small page+//+// Emits exactly one of code_received / failed, then stops listening and+// schedules its own deletion. The caller (AuthManager) redeems the code.+class GoogleDesktopLogin : public QObject {+ Q_OBJECT+ public:+ explicit GoogleDesktopLogin(QObject* parent = nullptr);+ ~GoogleDesktopLogin() override;++ void start();++ signals:+ void code_received(const QString& code);+ void failed(const QString& message);++ private:+ void on_new_connection();+ void finish_success(const QString& code, QTcpSocket* sock);+ void finish_error(const QString& message);+ static void send_page(QTcpSocket* sock, const QString& title, const QString& body);+ void cleanup();++ QTcpServer* server_ = nullptr;+ QTimer* timeout_ = nullptr;+ bool done_ = false;++ // ~5 min: a new Google user is detoured through the website /complete-profile+ // form before the loopback code is issued, so the wait can be well over 2 min.+ static constexpr int kTimeoutMs = 300000;+};++} // namespace fincept::authdiff --git a/fincept-qt/src/screens/auth/LoginScreen.cpp b/fincept-qt/src/screens/auth/LoginScreen.cppindex c1195157f..48e8dbb69 100644--- a/fincept-qt/src/screens/auth/LoginScreen.cpp+++ b/fincept-qt/src/screens/auth/LoginScreen.cpp@@ -9,7 +9,10 @@#include <QFrame>#include <QHBoxLayout>#include <QHideEvent>+#include <QIcon>#include <QPainter>+#include <QPainterPath>+#include <QPixmap>#include <QStackedWidget>#include <QVBoxLayout>@@ -48,6 +51,60 @@ static QString btn_primary() {ui::colors::BORDER_DIM());}+// White "Continue with Google" button — high contrast against the dark theme,+// matching Google's own button styling (white surface, dark text, hairline border).+static QString btn_google() {+ return QString("QPushButton {"+ " background: #ffffff; color: #3c4043;"+ " border: 1px solid #dadce0; border-radius: 2px;"+ " padding: 0 16px; font-size: 14px; font-weight: 700;"+ " font-family: 'Consolas','Courier New',monospace;"+ "}"+ "QPushButton:hover { background: #f5f6f7; border-color: #c6c8ca; }"+ "QPushButton:disabled { background: %1; color: %2; border-color: %3; }")+ .arg(ui::colors::BG_RAISED(), ui::colors::TEXT_DIM(), ui::colors::BORDER_DIM());+}++// Render the multi-colour Google "G" with QPainter (no QtSvg / asset dependency).+// Super-sampled 2× for crisp edges on both retina and non-retina displays.+static QPixmap google_g_pixmap(int logical_px) {+ constexpr qreal dpr = 2.0;+ const qreal s = logical_px * dpr;+ QPixmap pm(static_cast<int>(s), static_cast<int>(s));+ pm.fill(Qt::transparent);++ QPainter p(&pm);+ p.setRenderHint(QPainter::Antialiasing, true);++ const QColor blue(0x42, 0x85, 0xF4), red(0xEA, 0x43, 0x35), yellow(0xFB, 0xBC, 0x05), green(0x34, 0xA8, 0x53);+ const qreal w = s * 0.22; // ring thickness+ const qreal margin = w / 2.0 + s * 0.04;+ const QRectF ring(margin, margin, s - 2 * margin, s - 2 * margin);++ QPen pen;+ pen.setWidthF(w);+ pen.setCapStyle(Qt::FlatCap);+ auto arc = [&](const QColor& c, int start_deg, int span_deg) {+ pen.setColor(c);+ p.setPen(pen);+ p.drawArc(ring, start_deg * 16, span_deg * 16); // Qt angles: 0°=east, CCW positive+ };+ arc(blue, -20, 110); // right → top+ arc(red, 90, 60); // top → upper-left+ arc(yellow, 150, 70); // upper-left → lower-left+ arc(green, 220, 90); // lower-left → bottom (gap 310°–340° = the G's mouth)++ // Blue crossbar (the "tongue") — from centre to the right inner edge at mid-height.+ p.setPen(Qt::NoPen);+ p.setBrush(blue);+ const qreal cy = s / 2.0;+ p.drawRect(QRectF(s / 2.0, cy - w / 2.0, ring.right() - s / 2.0, w));++ p.end();+ pm.setDevicePixelRatio(dpr);+ return pm;+}+static QString btn_standard() {return QString("QPushButton {"" background: %1; color: %2;"@@ -294,6 +351,25 @@ void LoginScreen::build_login_page() {brl->addWidget(login_btn_);vl->addWidget(btn_row);+ // ── "or" divider + Google sign-in ───────────────────────────────────────+ or_lbl_ = new QLabel;+ or_lbl_->setAlignment(Qt::AlignCenter);+ or_lbl_->setStyleSheet(muted_style());+ vl->addWidget(or_lbl_);++ google_btn_ = new QPushButton;+ google_btn_->setFixedHeight(38);+ google_btn_->setStyleSheet(btn_google());+ google_btn_->setIcon(QIcon(google_g_pixmap(18)));+ google_btn_->setIconSize(QSize(18, 18));+ google_btn_->setCursor(Qt::PointingHandCursor);+ connect(google_btn_, &QPushButton::clicked, this, [this]() {+ clear_error();+ set_loading(true);+ auth::AuthManager::instance().login_with_google();+ });+ vl->addWidget(google_btn_);+vl->addWidget(make_separator());// Register link@@ -482,6 +558,8 @@ void LoginScreen::retranslateUi() {}if (forgot_btn_) forgot_btn_->setText(tr("FORGOT PASSWORD?"));if (login_btn_) login_btn_->setText(tr(" SIGN IN "));+ if (or_lbl_) or_lbl_->setText(tr("or"));+ if (google_btn_) google_btn_->setText(tr("CONTINUE WITH GOOGLE"));if (no_account_lbl_) no_account_lbl_->setText(tr("No account?"));if (signup_btn_) signup_btn_->setText(tr("SIGN UP"));@@ -606,6 +684,10 @@ void LoginScreen::set_loading(bool loading) {email_input_->setEnabled(!loading);password_input_->setEnabled(!loading);login_btn_->setText(loading ? tr(" SIGNING IN... ") : tr(" SIGN IN "));+ if (google_btn_) {+ google_btn_->setEnabled(!loading);+ google_btn_->setText(loading ? tr("WAITING FOR BROWSER…") : tr("CONTINUE WITH GOOGLE"));+ }}} // namespace fincept::screensdiff --git a/fincept-qt/src/screens/auth/LoginScreen.h b/fincept-qt/src/screens/auth/LoginScreen.hindex a672a1afb..45f3e6318 100644--- a/fincept-qt/src/screens/auth/LoginScreen.h+++ b/fincept-qt/src/screens/auth/LoginScreen.h@@ -37,6 +37,8 @@ class LoginScreen : public QWidget {QLabel* no_account_lbl_ = nullptr;QPushButton* signup_btn_ = nullptr;QLabel* error_label_ = nullptr;+ QPushButton* google_btn_ = nullptr;+ QLabel* or_lbl_ = nullptr;// ── MFA page widgets ────────────────────────────────────────────────────QWidget* mfa_page_ = nullptr;diff --git a/fincept-qt/src/screens/settings/LlmConfigSection.cpp b/fincept-qt/src/screens/settings/LlmConfigSection.cppindex d19e94a97..36b8432c9 100644--- a/fincept-qt/src/screens/settings/LlmConfigSection.cpp+++ b/fincept-qt/src/screens/settings/LlmConfigSection.cpp@@ -18,6 +18,7 @@#include <QFormLayout>#include <QFrame>+#include <QHash>#include <QHBoxLayout>#include <QInputDialog>#include <QMessageBox>@@ -26,6 +27,7 @@#include <QTimer>#include <QVBoxLayout>+#include <algorithm>#include <memory>namespace fincept::screens {@@ -37,6 +39,34 @@ const QStringList LlmConfigSection::KNOWN_PROVIDERS = {"openai", "anthropic", ""openrouter", "minimax", "kimi", "ollama", "xai", "fincept","astraflow", "astraflow_cn", "aihubmix", "atlascloud"};+QString LlmConfigSection::provider_display_name(const QString& provider_id) {+ static const QHash<QString, QString> kNames = {+ {"openai", "OpenAI"}, {"anthropic", "Anthropic"}, {"gemini", "Gemini"},+ {"groq", "Groq"}, {"deepseek", "DeepSeek"}, {"openrouter", "OpenRouter"},+ {"minimax", "MiniMax"}, {"kimi", "Kimi"}, {"ollama", "Ollama"},+ {"xai", "xAI"}, {"fincept", "Fincept LLM (recommended)"}, {"astraflow", "AstraFlow"},+ {"astraflow_cn", "AstraFlow CN"}, {"aihubmix", "AIHubMix"}, {"atlascloud", "AtlasCloud"},+ };+ const QString id = provider_id.toLower();+ const auto it = kNames.find(id);+ if (it != kNames.end())+ return it.value();+ // Unknown/custom provider: capitalize the first letter as a sensible default.+ if (provider_id.isEmpty())+ return provider_id;+ QString s = provider_id;+ s[0] = s[0].toUpper();+ return s;+}++QStringList LlmConfigSection::providers_sorted() {+ QStringList ids = KNOWN_PROVIDERS;+ std::sort(ids.begin(), ids.end(), [](const QString& a, const QString& b) {+ return provider_display_name(a).compare(provider_display_name(b), Qt::CaseInsensitive) < 0;+ });+ return ids;+}+QString LlmConfigSection::default_base_url(const QString& provider) {const QString p = provider.toLower();if (p == "openai")diff --git a/fincept-qt/src/screens/settings/LlmConfigSection.h b/fincept-qt/src/screens/settings/LlmConfigSection.hindex b8f7c7ec0..49ae6bb41 100644--- a/fincept-qt/src/screens/settings/LlmConfigSection.h+++ b/fincept-qt/src/screens/settings/LlmConfigSection.h@@ -148,6 +148,11 @@ class LlmConfigSection : public QWidget {static const QStringList KNOWN_PROVIDERS;static QString default_base_url(const QString& provider);static QStringList fallback_models(const QString& provider);++ // Human-readable label for a provider id (e.g. "aihubmix" → "AIHubMix").+ static QString provider_display_name(const QString& provider_id);+ // KNOWN_PROVIDERS ids sorted alphabetically by their display name.+ static QStringList providers_sorted();};} // namespace fincept::screensdiff --git a/fincept-qt/src/screens/settings/LlmConfigSection_Profiles.cpp b/fincept-qt/src/screens/settings/LlmConfigSection_Profiles.cppindex 044664979..17f49f8f2 100644--- a/fincept-qt/src/screens/settings/LlmConfigSection_Profiles.cpp+++ b/fincept-qt/src/screens/settings/LlmConfigSection_Profiles.cpp@@ -153,11 +153,14 @@ QWidget* LlmConfigSection::build_profile_form_panel() {profile_provider_field_lbl_ = lbl(tr("PROVIDER"));vl->addWidget(profile_provider_field_lbl_);profile_provider_combo_ = new QComboBox;- profile_provider_combo_->addItems(KNOWN_PROVIDERS);+ // Formatted names, alphabetical; the provider id rides in itemData.+ for (const auto& id : providers_sorted())+ profile_provider_combo_->addItem(provider_display_name(id), id);profile_provider_combo_->setStyleSheet(QString("QComboBox{%1}QComboBox::drop-down{border:none;}").arg(field_style()));- connect(profile_provider_combo_, &QComboBox::currentTextChanged, this,- &LlmConfigSection::on_profile_provider_changed);+ connect(profile_provider_combo_, &QComboBox::currentIndexChanged, this, [this](int) {+ on_profile_provider_changed(profile_provider_combo_->currentData().toString());+ });vl->addWidget(profile_provider_combo_);profile_model_field_lbl_ = lbl(tr("MODEL"));@@ -280,12 +283,13 @@ void LlmConfigSection::load_profiles() {void LlmConfigSection::populate_profile_form(const LlmProfile& p) {profile_name_edit_->setText(p.name);- int idx = profile_provider_combo_->findText(p.provider, Qt::MatchFixedString | Qt::MatchCaseSensitive);+ int idx = profile_provider_combo_->findData(p.provider, Qt::UserRole, Qt::MatchFixedString);if (idx >= 0)profile_provider_combo_->setCurrentIndex(idx);else {- profile_provider_combo_->addItem(p.provider);- profile_provider_combo_->setCurrentText(p.provider);+ // Custom/unknown provider: add it with the id in itemData.+ profile_provider_combo_->addItem(provider_display_name(p.provider), p.provider);+ profile_provider_combo_->setCurrentIndex(profile_provider_combo_->count() - 1);}// Populate model combo from fallback list, then select saved model@@ -307,7 +311,7 @@ void LlmConfigSection::populate_profile_form(const LlmProfile& p) {void LlmConfigSection::clear_profile_form() {profile_name_edit_->clear();profile_provider_combo_->setCurrentIndex(0);- on_profile_provider_changed(profile_provider_combo_->currentText());+ on_profile_provider_changed(profile_provider_combo_->currentData().toString());profile_api_key_edit_->clear();profile_base_url_edit_->clear();profile_temp_spin_->setValue(0.7);@@ -402,7 +406,7 @@ void LlmConfigSection::on_save_profile() {show_profile_status(tr("Profile name is required"), true);return;}- QString provider = profile_provider_combo_->currentText().trimmed();+ QString provider = profile_provider_combo_->currentData().toString().trimmed();QString model = profile_model_combo_->currentText().trimmed();if (model.isEmpty()) {show_profile_status(tr("Model is required"), true);diff --git a/fincept-qt/src/screens/settings/LlmConfigSection_Providers.cpp b/fincept-qt/src/screens/settings/LlmConfigSection_Providers.cppindex de311dcc5..bfdbb3247 100644--- a/fincept-qt/src/screens/settings/LlmConfigSection_Providers.cpp+++ b/fincept-qt/src/screens/settings/LlmConfigSection_Providers.cpp@@ -16,6 +16,8 @@#include "ui/theme/Theme.h"#include "ui/theme/ThemeManager.h"+#include <QHash>+// Unity-build hygiene: this split TU shares an unstable unity bucket with// LlmConfigSection.cpp (static TAG) and LlmConfigSection_Profiles.cpp// (another anonymous-namespace TAG). Unique identifier prevents ambiguous@@ -96,12 +98,20 @@ QWidget* LlmConfigSection::build_provider_list_panel() {"QPushButton:hover{background:" +QString(ui::colors::BG_RAISED()) + ";}");connect(add_btn_, &QPushButton::clicked, this, [this]() {- // Show input dialog to pick provider- QStringList choices = KNOWN_PROVIDERS;+ // Show input dialog to pick provider — display formatted names in+ // alphabetical order, then map the choice back to its provider id.+ QStringList choices;+ QHash<QString, QString> display_to_id;+ for (const auto& id : providers_sorted()) {+ const QString disp = provider_display_name(id);+ choices << disp;+ display_to_id.insert(disp, id);+ }bool ok;- QString provider = QInputDialog::getItem(this, tr("Add Provider"), tr("Select provider:"), choices, 0, false, &ok);- if (!ok || provider.isEmpty())+ QString chosen = QInputDialog::getItem(this, tr("Add Provider"), tr("Select provider:"), choices, 0, false, &ok);+ if (!ok || chosen.isEmpty())return;+ QString provider = display_to_id.value(chosen, chosen);// Check if already existsauto existing = LlmConfigRepository::instance().list_providers();@@ -459,7 +469,7 @@ void LlmConfigSection::load_providers() {if (result.is_ok()) {for (const auto& p : result.value()) {bool is_fincept = (p.provider.toLower() == "fincept");- QString display = is_fincept ? tr("Fincept LLM") : p.provider;+ QString display = provider_display_name(p.provider);if (p.is_active) {display += " ✓";active_provider = p.provider;