Merge branch 'main' of github.com:akatreyt/Feels
This commit is contained in:
@@ -22,12 +22,12 @@ struct IAPWarningView: View {
|
|||||||
Image(systemName: "clock")
|
Image(systemName: "clock")
|
||||||
.foregroundColor(.orange)
|
.foregroundColor(.orange)
|
||||||
|
|
||||||
if let expirationDate = iapManager.trialExpirationDate, expirationDate > Date() {
|
if iapManager.daysLeftInTrial > 0 {
|
||||||
Text(String(localized: "iap_warning_view_title"))
|
Text(String(localized: "iap_warning_view_title"))
|
||||||
.font(.body)
|
.font(.body)
|
||||||
.foregroundColor(textColor)
|
.foregroundColor(textColor)
|
||||||
|
|
||||||
Text(expirationDate, style: .relative)
|
Text("\(iapManager.daysLeftInTrial) days")
|
||||||
.font(.body)
|
.font(.body)
|
||||||
.bold()
|
.bold()
|
||||||
.foregroundColor(.orange)
|
.foregroundColor(.orange)
|
||||||
|
|||||||
@@ -192,8 +192,8 @@ struct PurchaseButtonView: View {
|
|||||||
Image(systemName: "clock")
|
Image(systemName: "clock")
|
||||||
.foregroundColor(.orange)
|
.foregroundColor(.orange)
|
||||||
|
|
||||||
if let expirationDate = iapManager.trialExpirationDate, expirationDate > Date() {
|
if iapManager.daysLeftInTrial > 0 {
|
||||||
Text("\(Text(String(localized: "purchase_view_trial_expires_in")).foregroundColor(textColor)) \(Text(expirationDate, style: .relative).foregroundColor(.orange).bold())")
|
Text("\(Text(String(localized: "purchase_view_trial_expires_in")).foregroundColor(textColor)) \(Text("\(iapManager.daysLeftInTrial) days").foregroundColor(.orange).bold())")
|
||||||
} else {
|
} else {
|
||||||
Text(String(localized: "purchase_view_trial_expired"))
|
Text(String(localized: "purchase_view_trial_expired"))
|
||||||
.foregroundColor(.orange)
|
.foregroundColor(.orange)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ struct SettingsTabView: View {
|
|||||||
UpgradeBannerView(
|
UpgradeBannerView(
|
||||||
showWhyUpgrade: $showWhyUpgrade,
|
showWhyUpgrade: $showWhyUpgrade,
|
||||||
showSubscriptionStore: $showSubscriptionStore,
|
showSubscriptionStore: $showSubscriptionStore,
|
||||||
trialExpirationDate: iapManager.trialExpirationDate
|
daysRemaining: iapManager.daysLeftInTrial
|
||||||
)
|
)
|
||||||
.padding(.horizontal, 16)
|
.padding(.horizontal, 16)
|
||||||
.padding(.top, 12)
|
.padding(.top, 12)
|
||||||
@@ -86,7 +86,7 @@ struct SettingsTabView: View {
|
|||||||
struct UpgradeBannerView: View {
|
struct UpgradeBannerView: View {
|
||||||
@Binding var showWhyUpgrade: Bool
|
@Binding var showWhyUpgrade: Bool
|
||||||
@Binding var showSubscriptionStore: Bool
|
@Binding var showSubscriptionStore: Bool
|
||||||
let trialExpirationDate: Date?
|
let daysRemaining: Int
|
||||||
|
|
||||||
@Environment(\.colorScheme) private var colorScheme
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||||
@@ -101,8 +101,8 @@ struct UpgradeBannerView: View {
|
|||||||
.font(.subheadline.weight(.medium))
|
.font(.subheadline.weight(.medium))
|
||||||
.foregroundColor(.orange)
|
.foregroundColor(.orange)
|
||||||
|
|
||||||
if let expirationDate = trialExpirationDate, expirationDate > Date() {
|
if daysRemaining > 0 {
|
||||||
Text("\(Text("Trial expires in ").font(.subheadline.weight(.medium)).foregroundColor(textColor.opacity(0.8)))\(Text(expirationDate, style: .relative).font(.subheadline.weight(.bold)).foregroundColor(.orange))")
|
Text("\(Text("Trial expires in ").font(.subheadline.weight(.medium)).foregroundColor(textColor.opacity(0.8)))\(Text("\(daysRemaining) days").font(.subheadline.weight(.bold)).foregroundColor(.orange))")
|
||||||
} else {
|
} else {
|
||||||
Text("Trial expired")
|
Text("Trial expired")
|
||||||
.font(.subheadline.weight(.medium))
|
.font(.subheadline.weight(.medium))
|
||||||
|
|||||||
35
Tests iOS/HierarchyDumpTest.swift
Normal file
35
Tests iOS/HierarchyDumpTest.swift
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import XCTest
|
||||||
|
|
||||||
|
class HierarchyDumpTest: XCTestCase {
|
||||||
|
func testDumpAccessibilityTree() {
|
||||||
|
let app = XCUIApplication()
|
||||||
|
app.launchArguments = ["--ui-testing", "--reset-state", "--disable-animations", "--bypass-subscription", "--skip-onboarding"]
|
||||||
|
app.launch()
|
||||||
|
sleep(3)
|
||||||
|
|
||||||
|
print("\n=== ELEMENT QUERIES ===")
|
||||||
|
print("otherElements[mood_header]: \(app.otherElements[\"mood_header\"].exists)")
|
||||||
|
print("descendants[mood_header]: \(app.descendants(matching: .any)[\"mood_header\"].firstMatch.exists)")
|
||||||
|
print("groups[mood_header]: \(app.groups[\"mood_header\"].exists)")
|
||||||
|
print("scrollViews[mood_header]: \(app.scrollViews[\"mood_header\"].exists)")
|
||||||
|
print("staticTexts[mood_header]: \(app.staticTexts[\"mood_header\"].exists)")
|
||||||
|
print("buttons[mood_button_great]: \(app.buttons[\"mood_button_great\"].exists)")
|
||||||
|
print("tabBars count: \(app.tabBars.count)")
|
||||||
|
if app.tabBars.count > 0 {
|
||||||
|
let tb = app.tabBars.firstMatch
|
||||||
|
for b in tb.buttons.allElementsBoundByIndex {
|
||||||
|
print(" tab button: \(b.identifier) label=\(b.label)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print("otherElements[settings_header]: \(app.otherElements[\"settings_header\"].exists)")
|
||||||
|
|
||||||
|
print("\n=== HIERARCHY (first 200 lines) ===")
|
||||||
|
let desc = app.debugDescription
|
||||||
|
let lines = desc.components(separatedBy: "\n")
|
||||||
|
for (i, line) in lines.prefix(200).enumerated() {
|
||||||
|
print("\(i): \(line)")
|
||||||
|
}
|
||||||
|
|
||||||
|
XCTAssertTrue(true) // always pass
|
||||||
|
}
|
||||||
|
}
|
||||||
1189
hardening-report.md
Normal file
1189
hardening-report.md
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user