Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Resell/Models/Post.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ struct PostBody: Codable {
case description
case categories
case condition
case original_price = "original_price"
case original_price = "originalPrice"
case imagesBase64
case userId
}
Expand Down
1 change: 1 addition & 0 deletions Resell/Views/Home/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct ProfileView: View {
.font(Constants.Fonts.body2)
.foregroundStyle(Constants.Colors.black)
.padding(.bottom, 28)
.padding(.horizontal, 24)
.lineLimit(3)

profileTabsView
Expand Down
6 changes: 6 additions & 0 deletions Resell/Views/ProductDetails/ProductDetailsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ struct ProductDetailsView: View {
.frame(width: 36, height: 24)
.frame(width: 44, height: 44)
.contentShape(Rectangle())
.offset(x: -10)
}
.background(.ultraThinMaterial, in: Circle())
.padding(.leading, 12)

Spacer()
Expand All @@ -102,8 +104,12 @@ struct ProductDetailsView: View {
.foregroundStyle(Constants.Colors.white)
.frame(width: 44, height: 44)
.contentShape(Rectangle())

}
.background(.ultraThinMaterial, in: Circle())
.padding(.trailing, 12)


}
.padding(.top, topSafeArea * 2 + 4)

Expand Down
26 changes: 17 additions & 9 deletions Resell/Views/Settings/EditProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,22 @@ struct EditProfileView: View {
// MARK: - UI

var body: some View {
VStack {
profileImageView
.padding(.bottom, 40)

nameView

editFieldsView

Spacer()
ScrollViewReader { proxy in
ScrollView {
VStack {
profileImageView
.padding(.bottom, 40)

nameView

editFieldsView

Spacer()
}
.onTapGesture {
proxy.scrollTo("bioField", anchor: .center)
}
Comment on lines +41 to +43
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Missing .id("bioField") causes scroll to fail silently.

The proxy.scrollTo("bioField", anchor: .center) call references an ID that is never assigned to any view. The TextEditor at line 167 needs an .id("bioField") modifier for the scroll to work.

Additionally, placing this tap gesture on the entire VStack creates confusing UX—tapping anywhere (profile image, username field, etc.) will attempt to scroll to the bio field. This is likely not the intended behavior.

🐛 Proposed fix: Add the missing ID to TextEditor

At line 167, add the .id("bioField") modifier:

 TextEditor(text: $editedBio)
     .font(Constants.Fonts.body1)
     .foregroundColor(Constants.Colors.black)
     .padding(.horizontal, 16)
     .padding(.vertical, 8)
     .scrollContentBackground(.hidden)
     .background(Constants.Colors.wash)
     .cornerRadius(10)
     .frame(height: 100)
+    .id("bioField")
     .onChange(of: editedBio) { newText in

Consider also restricting the tap gesture to only the bio section if that's the intended trigger, rather than the entire content area.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.onTapGesture {
proxy.scrollTo("bioField", anchor: .center)
}
TextEditor(text: $editedBio)
.font(Constants.Fonts.body1)
.foregroundColor(Constants.Colors.black)
.padding(.horizontal, 16)
.padding(.vertical, 8)
.scrollContentBackground(.hidden)
.background(Constants.Colors.wash)
.cornerRadius(10)
.frame(height: 100)
.id("bioField")
.onChange(of: editedBio) { newText in
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Resell/Views/Settings/EditProfileView.swift` around lines 41 - 43, The
scrollTo call uses the string ID "bioField" but no view has that ID, causing the
scroll to fail; add .id("bioField") to the TextEditor (the bio field) so
proxy.scrollTo("bioField", anchor: .center) can find it, and move or restrict
the .onTapGesture from the surrounding VStack to only the bio section (or the
specific bio label/row) so taps on the profile image/username don't trigger
scrolling unexpectedly; reference the TextEditor for the .id and the
VStack/.onTapGesture and proxy.scrollTo usages to locate and update the code.

}
Comment on lines +29 to +44
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Potential gesture conflict between tap handlers.

The .onTapGesture at lines 41-43 and .endEditingOnTap() at line 74 both register tap gestures. The EndEditingOnTap modifier (from the relevant code snippet) also uses .onTapGesture to dismiss the keyboard. When both are present, SwiftUI may only execute one of them, leading to either:

  • Keyboard not dismissing when expected, or
  • Scrolling not happening when expected

Consider combining these behaviors into a single tap handler, or use .simultaneousGesture() if both actions should execute on tap.

Also applies to: 74-74

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Resell/Views/Settings/EditProfileView.swift` around lines 29 - 44, The view
registers two tap handlers (the local .onTapGesture that calls
proxy.scrollTo("bioField", anchor: .center) and the EndEditingOnTap modifier
which also uses .onTapGesture), causing one to swallow the other; fix this by
combining them into a single gesture so both actions run: replace the separate
.onTapGesture and EndEditingOnTap usage with a single gesture (e.g., use
.simultaneousGesture(TapGesture().onEnded { ... }) or a combined custom tap
modifier) that calls proxy.scrollTo(...) and also triggers the
end-editing/dismiss-keyboard behavior (the same work EndEditingOnTap performs).
Reference the scroll action proxy.scrollTo("bioField", anchor: .center) and the
EndEditingOnTap modifier when implementing the combined handler.

}
.padding(.top, 40)
.background(Constants.Colors.white)
Expand Down Expand Up @@ -175,6 +182,7 @@ struct EditProfileView: View {
}
.padding(.top, 40)
.padding(.horizontal, Constants.Spacing.horizontalPadding)
.ignoresSafeArea(.keyboard, edges: .bottom)
}

// MARK: - Functions
Expand Down
4 changes: 2 additions & 2 deletions Resell/Views/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ struct SettingsView: View {
router.push(.feedback)
}
case .reviewTesting:
settingsRow(title: "🧪 Test Reviews", icon: "feedback") {
settingsRow(title: "Test Reviews", icon: "feedback") {
router.push(.reviewTesting)
}
case .blockedUsers:
settingsRow(title: "Blocked Users", icon: "slash") {
router.push(.blockedUsers)
}
case .eula:
settingsRow(title: "Term and Conditions", icon: "terms") {
settingsRow(title: "Terms and Conditions", icon: "terms") {
viewModel.didShowWebView = true
}
case .logout:
Expand Down