From 15a6d7395e4b166f21edc5a1abb3d3e5bdd541b8 Mon Sep 17 00:00:00 2001 From: alexandrev-tibco Date: Wed, 16 Sep 2026 15:30:10 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20selecci=C3=B3n=20de=20mes=20en=20Diario?= =?UTF-8?q?=20y=20dashboard=20a=201=20columna=20cuando=20hay=20panel=20lat?= =?UTF-8?q?eral?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - JournalView: el .id() extra sobre las filas envolvía el .tag y la selección de la List no navegaba (ni en compacto ni en regular). ForEach ya aporta la identidad que usa el ScrollViewReader. - DashboardView: masonry pasa a 1 columna por debajo de 600 pt (inspector de Quick Update abierto, Split View) en vez de apretar dos tarjetas. - DuoLayoutUITests: selecciona el mes anterior por etiqueta y comprueba que se abre el check-in. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01F1u4K16xy7eQVtgsYNZ9Vn --- .../Views/Dashboard/DashboardView.swift | 5 ++++- .../Views/Journal/JournalView.swift | 4 +++- PortfolioJournalUITests/DuoLayoutUITests.swift | 18 +++++++++++++----- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/PortfolioJournal/Views/Dashboard/DashboardView.swift b/PortfolioJournal/Views/Dashboard/DashboardView.swift index 2d613d4..2a3409a 100644 --- a/PortfolioJournal/Views/Dashboard/DashboardView.swift +++ b/PortfolioJournal/Views/Dashboard/DashboardView.swift @@ -287,7 +287,10 @@ struct DashboardView: View { GeometryReader { geo in // Scale column count with available width so a wide Mac window fills // (3 columns) while an iPad stays at 2. Lead cards span full width. - let columnCount = geo.size.width >= 1250 ? 3 : 2 + // Continuous sizing: 3 columns on a wide Mac window, 2 on an iPad / + // Duo inner screen, 1 when a side panel (Quick Update inspector, + // Split View) leaves too little room for two readable cards. + let columnCount = geo.size.width >= 1250 ? 3 : (geo.size.width >= 600 ? 2 : 1) let columns = iPadContextColumns(count: columnCount) ScrollView { VStack(spacing: 16) { diff --git a/PortfolioJournal/Views/Journal/JournalView.swift b/PortfolioJournal/Views/Journal/JournalView.swift index 4c7f49e..fe0b887 100644 --- a/PortfolioJournal/Views/Journal/JournalView.swift +++ b/PortfolioJournal/Views/Journal/JournalView.swift @@ -78,9 +78,11 @@ struct JournalView: View { } } else { ForEach(filteredMonthlyNotes) { entry in + // ForEach identity (MonthlyNoteItem.id == date) already serves + // ScrollViewReader; an extra .id() would wrap the .tag trait + // and break List selection. monthlyNoteRow(entry) .tag(entry.date) - .id(entry.date) .onAppear { currentVisibleMonth = entry.date } } } diff --git a/PortfolioJournalUITests/DuoLayoutUITests.swift b/PortfolioJournalUITests/DuoLayoutUITests.swift index cf566dc..4b4a5ba 100644 --- a/PortfolioJournalUITests/DuoLayoutUITests.swift +++ b/PortfolioJournalUITests/DuoLayoutUITests.swift @@ -74,12 +74,20 @@ final class DuoLayoutUITests: XCTestCase { openTab(app, "Journal") snap(app, "07_journal") - let journalCells = app.cells - if journalCells.count > 1 { - journalCells.element(boundBy: 1).tap() - Thread.sleep(forTimeInterval: 2.0) - snap(app, "08_journal_detail") + // Seeded data always has last month's check-in: select it by label. + let formatter = DateFormatter() + formatter.locale = Locale(identifier: "en_US") + formatter.dateFormat = "MMM yyyy" + let lastMonth = Calendar.current.date(byAdding: .month, value: -1, to: Date())! + let monthRow = app.staticTexts[formatter.string(from: lastMonth)].firstMatch + if monthRow.waitForExistence(timeout: 3) { + monthRow.tap() + } else if app.cells.count > 1 { + app.cells.element(boundBy: 1).tap() } + Thread.sleep(forTimeInterval: 2.0) + XCTAssertFalse(app.staticTexts["Select a Month"].exists, "Journal month selection did not open the check-in") + snap(app, "08_journal_detail") openTab(app, "Settings") snap(app, "09_settings")