mirror of
https://codeberg.org/secana/Forji.git
synced 2026-06-16 05:13:55 -07:00
feat: show the overview filter summary only when filters are active (#60)
## What
The Issues and Pull Requests overviews pinned a centered filter-summary caption ("Open") below the title even in the default state, which just duplicated the filter icon. Now the summary appears only when a non-default state or involvement scope is active, so the default view carries no extra chrome and the strip becomes a clear signal that the list is filtered.
Verified in the iPhone 17 Pro simulator: default state shows no strip and no gap, and the filter icon still reflects state. Builds clean on Xcode 26, SwiftLint passes.
---
I grant Stefan Hausotte an irrevocable, worldwide, royalty-free license to use, sublicense, and distribute my contribution, including through Apple's App Store under the project's App Store exception.
Reviewed-on: https://codeberg.org/secana/Forji/pulls/60
This commit is contained in:
parent
ab393d0237
commit
78c91cd2a9
3 changed files with 17 additions and 15 deletions
|
|
@ -144,13 +144,15 @@ struct SearchableOverviewView<Row: View, Detail: View, CreateView: View>: View {
|
||||||
}
|
}
|
||||||
.listStyle(.insetGrouped)
|
.listStyle(.insetGrouped)
|
||||||
.safeAreaInset(edge: .top) {
|
.safeAreaInset(edge: .top) {
|
||||||
Text(filterSummaryText)
|
if hasNonDefaultFilters {
|
||||||
.font(.caption)
|
Text(filterSummaryText)
|
||||||
.foregroundStyle(.secondary)
|
.font(.caption)
|
||||||
.frame(maxWidth: .infinity)
|
.foregroundStyle(.secondary)
|
||||||
.padding(.horizontal)
|
.frame(maxWidth: .infinity)
|
||||||
.padding(.vertical, 6)
|
.padding(.horizontal)
|
||||||
.accessibilityIdentifier("filter-summary")
|
.padding(.vertical, 6)
|
||||||
|
.accessibilityIdentifier("filter-summary")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,17 +37,17 @@ final class IssueUITests: ForgejoReadOnlyUITestBase {
|
||||||
// Wait for list to load
|
// Wait for list to load
|
||||||
XCTAssertTrue(app.cells.firstMatch.waitForExistence(timeout: 10), "Issues should load")
|
XCTAssertTrue(app.cells.firstMatch.waitForExistence(timeout: 10), "Issues should load")
|
||||||
|
|
||||||
// Default filter summary should show "Open" (default scope is All involvement)
|
// In the default state (Open + All involvement) the summary is hidden.
|
||||||
let filterSummary = app.staticTexts["filter-summary"]
|
let filterSummary = app.staticTexts["filter-summary"]
|
||||||
XCTAssertTrue(filterSummary.waitForExistence(timeout: 5))
|
XCTAssertFalse(filterSummary.exists, "Filter summary should be hidden in the default state")
|
||||||
XCTAssertEqual(filterSummary.label, "Open")
|
|
||||||
|
|
||||||
let filterMenuButton = app.buttons["filter-menu-button"]
|
let filterMenuButton = app.buttons["filter-menu-button"]
|
||||||
|
|
||||||
// Tap "Assigned to you" via filter menu
|
// Selecting a non-default scope reveals the summary.
|
||||||
filterMenuButton.tap()
|
filterMenuButton.tap()
|
||||||
app.buttons["Assigned to you"].tap()
|
app.buttons["Assigned to you"].tap()
|
||||||
sleep(2)
|
sleep(2)
|
||||||
|
XCTAssertTrue(filterSummary.waitForExistence(timeout: 5))
|
||||||
XCTAssertTrue(filterSummary.label.contains("Assigned to you"))
|
XCTAssertTrue(filterSummary.label.contains("Assigned to you"))
|
||||||
|
|
||||||
// Tap "Mentioned" via filter menu
|
// Tap "Mentioned" via filter menu
|
||||||
|
|
|
||||||
|
|
@ -111,17 +111,17 @@ final class PullRequestUITests: ForgejoReadOnlyUITestBase {
|
||||||
// Reset filters to defaults (previous test may have changed them)
|
// Reset filters to defaults (previous test may have changed them)
|
||||||
resetOverviewFilters()
|
resetOverviewFilters()
|
||||||
|
|
||||||
// Default filter summary should show "Open" (default scope is All involvement)
|
// In the default state (Open + All involvement) the summary is hidden.
|
||||||
let filterSummary = app.staticTexts["filter-summary"]
|
let filterSummary = app.staticTexts["filter-summary"]
|
||||||
XCTAssertTrue(filterSummary.waitForExistence(timeout: 5))
|
XCTAssertFalse(filterSummary.exists, "Filter summary should be hidden in the default state")
|
||||||
XCTAssertEqual(filterSummary.label, "Open")
|
|
||||||
|
|
||||||
let filterMenuButton = app.buttons["filter-menu-button"]
|
let filterMenuButton = app.buttons["filter-menu-button"]
|
||||||
|
|
||||||
// Tap "Assigned to you" via filter menu
|
// Selecting a non-default scope reveals the summary.
|
||||||
filterMenuButton.tap()
|
filterMenuButton.tap()
|
||||||
app.buttons["Assigned to you"].tap()
|
app.buttons["Assigned to you"].tap()
|
||||||
sleep(2)
|
sleep(2)
|
||||||
|
XCTAssertTrue(filterSummary.waitForExistence(timeout: 5))
|
||||||
XCTAssertTrue(filterSummary.label.contains("Assigned to you"))
|
XCTAssertTrue(filterSummary.label.contains("Assigned to you"))
|
||||||
|
|
||||||
// Tap "Mentioned" via filter menu
|
// Tap "Mentioned" via filter menu
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue