Skip to content

Ongoing bug fixes alyssa/sp26 #48

Open
Alyssa-Wang12 wants to merge 3 commits intomainfrom
alyssa/sp26
Open

Ongoing bug fixes alyssa/sp26 #48
Alyssa-Wang12 wants to merge 3 commits intomainfrom
alyssa/sp26

Conversation

@Alyssa-Wang12
Copy link

@Alyssa-Wang12 Alyssa-Wang12 commented Mar 25, 2026

See commit messages for specific bug fixes by number; not in github issues but before the “back” and “report” arrows couldn’t be properly seen on white backgrounds so I modified them to be visible.

Summary by CodeRabbit

  • Improvements

    • Profile editing screen is now scrollable for better navigation and accessibility
    • Enhanced keyboard handling when editing profile information to prevent content shifting
    • Improved visual styling of buttons on product detail screens
  • Style Updates

    • Adjusted spacing in user profile bio display
    • Corrected text labels in settings menu

@coderabbitai
Copy link

coderabbitai bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

Five files across models and views receive updates: a JSON key rename in the Post model, layout padding adjustments in ProfileView, visual styling enhancements in ProductDetailsView, a structural refactor from VStack to ScrollView with keyboard handling in EditProfileView, and text label corrections in SettingsView.

Changes

Cohort / File(s) Summary
Data Model
Resell/Models/Post.swift
Changed CodingKeys JSON key mapping for original_price property from "original_price" to "originalPrice".
UI Layout & Visual Updates
Resell/Views/Home/ProfileView.swift, Resell/Views/ProductDetails/ProductDetailsView.swift
Added horizontal padding to bio text in ProfileView; enhanced ProductDetailsView buttons with circular blurred-material backgrounds and offset positioning for improved visual hierarchy.
Screen Structure & Interaction
Resell/Views/Settings/EditProfileView.swift
Refactored main layout container from VStack to ScrollView with ScrollViewReader, implemented programmatic scroll-to-field on tap gesture, and added keyboard-aware safe area handling to prevent keyboard obstruction.
Text & Label Corrections
Resell/Views/Settings/SettingsView.swift
Corrected display labels: removed emoji from "Test Reviews" and fixed typo "Term and Conditions" → "Terms and Conditions".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hops of joy for polish fine—
Scroll and pad and align,
Price keys dance in camelCase delight,
Labels fixed, the app shines bright!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is minimal and lacks most required template sections; it only provides a brief note about button visibility but omits Overview, detailed Changes Made, Test Coverage, and other critical sections. Fill out the template with detailed sections: add an Overview of the changes, break down each fix under Changes Made with specifics, include Test Coverage details, and add related issue numbers (#36, #37, #47) in the Related PRs or Issues section.
Title check ❓ Inconclusive The title is vague and generic, using 'bug fixes' without specifying what was actually fixed or which components were modified. Replace with a more descriptive title that summarizes the main changes, such as 'Fix button visibility and UI layout issues in ProfileView, ProductDetailsView, EditProfileView, and SettingsView'.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch alyssa/sp26

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
Resell/Views/ProductDetails/ProductDetailsView.swift (1)

84-92: Chevron icon may appear off-center within the circular background.

The .offset(x: -10) on line 89 shifts the chevron image visually but doesn't change the 44×44 layout bounds. The .background(.ultraThinMaterial, in: Circle()) on the Button is sized to those bounds, so the icon will render 10 points left of center within the circle.

If this offset compensates for asymmetric padding in the "chevron.left.white" asset, consider adjusting the asset instead for consistent centering. Otherwise, if intentional, this is fine to keep.

💡 Option: Remove offset if asset is symmetric
                     Image("chevron.left.white")
                         .resizable()
                         .frame(width: 36, height: 24)
                         .frame(width: 44, height: 44)
                         .contentShape(Rectangle())
-                        .offset(x: -10)
                 }
                 .background(.ultraThinMaterial, in: Circle())
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Resell/Views/ProductDetails/ProductDetailsView.swift` around lines 84 - 92,
The chevron Image("chevron.left.white") is being visually shifted inside its
circular background by .offset(x: -10), causing it to be off-center; remove the
.offset(x: -10) from the Image (or from the Button content) so the .frame(width:
44, height: 44) and .background(.ultraThinMaterial, in: Circle()) can center the
icon correctly, and if the asset itself is asymmetric, fix the
"chevron.left.white" asset or adjust its internal padding instead of using
.offset.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Resell/Views/Settings/EditProfileView.swift`:
- Around line 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.
- Around line 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.

---

Nitpick comments:
In `@Resell/Views/ProductDetails/ProductDetailsView.swift`:
- Around line 84-92: The chevron Image("chevron.left.white") is being visually
shifted inside its circular background by .offset(x: -10), causing it to be
off-center; remove the .offset(x: -10) from the Image (or from the Button
content) so the .frame(width: 44, height: 44) and
.background(.ultraThinMaterial, in: Circle()) can center the icon correctly, and
if the asset itself is asymmetric, fix the "chevron.left.white" asset or adjust
its internal padding instead of using .offset.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a57c7c21-f120-41a2-b7e2-e36b4f43ae22

📥 Commits

Reviewing files that changed from the base of the PR and between 11e7997 and 1273b6f.

📒 Files selected for processing (5)
  • Resell/Models/Post.swift
  • Resell/Views/Home/ProfileView.swift
  • Resell/Views/ProductDetails/ProductDetailsView.swift
  • Resell/Views/Settings/EditProfileView.swift
  • Resell/Views/Settings/SettingsView.swift

Comment on lines +29 to +44
ScrollViewReader { proxy in
ScrollView {
VStack {
profileImageView
.padding(.bottom, 40)

nameView

editFieldsView

Spacer()
}
.onTapGesture {
proxy.scrollTo("bioField", anchor: .center)
}
}
Copy link

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.

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant