Repository Public
1// Author: Simon-Pierre Boucher — contact@spboucher.ai2// File: Features/Research/ResearchView.swift3// Description: Entry of research and analysis: the market explorer, the status of the server's market-data worker, the automated research jobs and the strategy laboratory's results. Everything here is read-only analysis; observed data, estimates, simulations and AI analysis carry distinct labels, no figure is advice, and nothing on this screen places an order.4import SwiftUI5import SPWalletCore67struct ResearchView: View {8 let model: AppModel9 enum Tab: String, CaseIterable, Identifiable {10 case markets, quality, jobs, lab11 var id: String { rawValue }12 var label: String { switch self { case .markets: "Marchés"; case .quality: "Qualité des données"; case .jobs: "Recherches automatisées"; case .lab: "Laboratoire" } }13 }14 @State private var tab: Tab = .markets1516 var body: some View {17 VStack(spacing: 0) {18 HStack(alignment: .firstTextBaseline, spacing: 14) {19 Text("Recherche et analyse").font(.largeTitle.weight(.semibold))20 Spacer()21 Picker("Section", selection: $tab) { ForEach(Tab.allCases) { Text($0.label).tag($0) } }.pickerStyle(.segmented).labelsHidden().frame(width: 620)22 }.padding([.horizontal, .top], 24).padding(.bottom, 8)23 HStack(spacing: 8) {24 Text("Nature des chiffres :").font(.caption).foregroundStyle(.secondary)25 ProvenanceTag(p: .verified, text: "Donnée observée")26 ProvenanceTag(p: .estimate, text: "Estimation ou valeur dérivée")27 ProvenanceTag(p: .simulated, text: "Simulation (backtest)")28 ProvenanceTag(p: .ai, text: "Analyse générée par IA")29 Spacer()30 Text("Lecture seule — aucune information ici n’est un conseil en placement.").font(.caption).foregroundStyle(.secondary)31 }.padding(.horizontal, 24).padding(.bottom, 10)32 if model.isOffline { Banner(.warning, "Portefeuille injoignable : les données de marché ne peuvent pas être relues. Ce qui reste affiché porte la date de sa dernière lecture.").padding(.horizontal, 24).padding(.bottom, 8) }33 Divider()34 switch tab {35 case .markets: RsMarketsTab(model: model)36 case .quality: RsDataQualityTab(model: model)37 case .jobs: RsJobsTab(model: model)38 case .lab: RsLabTab(model: model)39 }40 }41 .background(Color(nsColor: .windowBackgroundColor))42 }43}44