Skip to content

Ongoing bug fixes (kaylee)#49

Open
ukaylee wants to merge 6 commits intomainfrom
kaylee
Open

Ongoing bug fixes (kaylee)#49
ukaylee wants to merge 6 commits intomainfrom
kaylee

Conversation

@ukaylee
Copy link
Copy Markdown

@ukaylee ukaylee commented Apr 4, 2026

See commit messages. Fixed issues #46, #45, #44, #32 and other problems that had no issue (couldn’t create new listing, and inconsistent gray overlays throughout the app).

Summary by CodeRabbit

  • Bug Fixes

    • Fixed price field encoding and decoding from API responses.
  • Visual & UI Improvements

    • Removed dimming overlays from expandable buttons and option menus for cleaner interactions.
    • Streamlined loading view with simplified visual feedback.
    • Added loading indicator and improved layout spacing in wishlist view.
    • Added modal presentation for product deletion functionality.
    • Enhanced sign-in button responsiveness.

ukaylee added 5 commits March 11, 2026 18:02
…ly caused error where we couldn't create new listings)
… click out of the menu. additionally fixed user's ability to delete posts by displaying confirmation when they select delete posts
… no items archived), removed inconsistent gray overlay while loading, applied the loading animation to the requests tab.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c61c4a2a-f3a3-492c-81fd-30de0e74d461

📥 Commits

Reviewing files that changed from the base of the PR and between 220fae5 and 1fe6580.

📒 Files selected for processing (2)
  • Resell/Views/ProductDetails/ProductDetailsView.swift
  • Resell/Views/ViewModifiers/LoadingView.swift
💤 Files with no reviewable changes (1)
  • Resell/Views/ViewModifiers/LoadingView.swift
🚧 Files skipped from review as they are similar to previous changes (1)
  • Resell/Views/ProductDetails/ProductDetailsView.swift

📝 Walkthrough

Walkthrough

Multiple UI overlay refinements, reactive state property updates, and API encoding adjustments across views and models. Changes include removing visual dimming overlays, adding modal presentation coordination, introducing published state properties, and adjusting JSON key mappings.

Changes

Cohort / File(s) Summary
Data Model & Serialization
Resell/Models/Post.swift, Resell/Models/Listing.swift
Post's CodingKeys mapping for original_price changed from "original_price" to "originalPrice" to match API payload. Listing.swift has trailing whitespace adjustment.
Overlay & Hit-Testing Updates
Resell/Views/Components/ExpandableAddButton.swift, Resell/Views/Components/OptionsMenuView.swift, Resell/Views/ViewModifiers/LoadingView.swift
Menu/expand overlays changed from semi-transparent black (Color.black.opacity(0.3)) to fully transparent (Color.clear) with explicit contentShape(Rectangle()) for hit-testing. LoadingView removes dimming overlay entirely, keeping only progress indicator.
Reactive State & Modal Coordination
Resell/ViewModels/MainViewModel.swift, Resell/Views/ProductDetails/ProductDetailsView.swift, Resell/Views/Home/ProfileView.swift
MainViewModel's hidesSignInButton becomes @Published property with animation in logout flow. ProductDetailsView adds sheet presentation for delete view with onChange handler forcing menu dismissal. ProfileView applies consistent padding and loading view modifiers to wishlist tab.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A rabbit hops through overlay dreams,
Where dimmed views now glow crystal clean,
State flows reactive, modals aligned,
Fresh API keys leave old names behind,
The UI springs forward, smooth and serene!

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks detailed structure and does not follow the repository template; it is incomplete with only high-level issue references and no organized breakdown of changes, test coverage, or proper section headers. Restructure the description to match the template: add Overview, list each Change Made with details, describe Test Coverage, and remove reliance on external commit messages for clarity.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive terms like 'Ongoing bug fixes' that don't convey specific information about what was actually changed. Replace with a more specific title that describes the primary change, such as 'Fix overlay transparency and JSON key mapping for PostBody' or 'Remove dimming overlays and publish hidesSignInButton state.'

✏️ 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 kaylee

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@ukaylee ukaylee requested review from MrPeterss and Xhether and removed request for Xhether April 4, 2026 20:34
Copy link
Copy Markdown

@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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Resell/Views/ViewModifiers/LoadingView.swift (1)

20-27: ⚠️ Potential issue | 🟠 Major

Loading state no longer blocks user interactions.
The overlay that previously absorbed taps when isLoading == true has been commented out (lines 20–23). With only CustomProgressView remaining (which has allowsHitTesting(false)), taps pass through to the underlying content, risking accidental interactions during active requests.

Recommend adding a clear tap-blocking overlay:

Color.clear
    .contentShape(Rectangle())
    .ignoresSafeArea()
    .opacity(isLoading ? 1 : 0)
    .allowsHitTesting(isLoading)

This preserves the visual intent (no dimming) while properly blocking taps across the app's 13+ screens that use loadingView.

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

In `@Resell/Views/ViewModifiers/LoadingView.swift` around lines 20 - 27, The
loading overlay no longer blocks touches because the previous Color overlay was
removed and CustomProgressView uses allowsHitTesting(false); restore a
hit-blocking transparent overlay when isLoading is true by inserting a
full-screen clear background with a Rectangle content shape, ignoring safe area,
whose opacity is tied to isLoading and whose allowsHitTesting is set to
isLoading so taps are absorbed while loading; update the view that composes
CustomProgressView (the loadingView modifier or parent) to include this overlay
alongside CustomProgressView so visual appearance is unchanged but interactions
are blocked.
🧹 Nitpick comments (2)
Resell/Views/Settings/SettingsView.swift (1)

137-138: Remove commented-out routing code from logout action.
Lines 137–138 leave dead/commented navigation in a critical flow. Prefer removing it or tracking it as an explicit TODO in an issue.

Proposed cleanup
-                //route to the log in page here?
-//                router.push(.login)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Resell/Views/Settings/SettingsView.swift` around lines 137 - 138, Remove the
dead commented routing call inside the logout flow in SettingsView (the
commented router.push(.login) lines within the logout action); either delete
those commented lines entirely or replace them with a single short TODO
referencing an issue ID if navigation still needs to be tracked, and ensure the
logout action (in SettingsView / the logout handler) contains only active,
purposeful code.
Resell/ViewModels/ProductDetailsViewModel.swift (1)

162-169: Remove temporary debug prints from delete flow.
Lines 162, 165, 167, and 169 add console prints in a production code path. Please remove them (or gate under DEBUG) and rely on NetworkManager.shared.logger for structured logs.

Proposed cleanup
     func deletePost() {
-        print("deletepost was called in productdetailsview")
         Task {
             do {
-                print("went into the task")
                 if let id = item?.id {
-                    print("trying to delete")
                     try await NetworkManager.shared.deletePost(id: id)
-                    print("got back")
                 }

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

In `@Resell/ViewModels/ProductDetailsViewModel.swift` around lines 162 - 169,
Remove the temporary debug prints in the delete flow inside
ProductDetailsViewModel (the Task block that checks item?.id and calls
NetworkManager.shared.deletePost); either delete the print(...) lines or wrap
them with a DEBUG-only compiler flag, and replace ad-hoc prints with structured
logging via NetworkManager.shared.logger (include contextual info like the post
id and success/failure). Ensure references: ProductDetailsViewModel's Task that
uses item?.id and NetworkManager.shared.deletePost and use
NetworkManager.shared.logger for any necessary runtime info.
🤖 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/ProductDetails/ProductDetailsView.swift`:
- Around line 120-122: The delete sheet presentation doesn't close the options
menu if the user dismisses the sheet by swiping; add an onChange observer on the
binding used for the sheet (viewModel.didShowDeleteView) in ProductDetailsView
so that when it becomes true or when it changes to false you explicitly set
viewModel.didShowOptionsMenu = false (synchronizing state regardless of whether
actions in deletePostView were tapped); update the sheet declaration that shows
deletePostView to include this onChange handler to ensure didShowOptionsMenu is
cleared whenever the delete sheet is presented or dismissed.

---

Outside diff comments:
In `@Resell/Views/ViewModifiers/LoadingView.swift`:
- Around line 20-27: The loading overlay no longer blocks touches because the
previous Color overlay was removed and CustomProgressView uses
allowsHitTesting(false); restore a hit-blocking transparent overlay when
isLoading is true by inserting a full-screen clear background with a Rectangle
content shape, ignoring safe area, whose opacity is tied to isLoading and whose
allowsHitTesting is set to isLoading so taps are absorbed while loading; update
the view that composes CustomProgressView (the loadingView modifier or parent)
to include this overlay alongside CustomProgressView so visual appearance is
unchanged but interactions are blocked.

---

Nitpick comments:
In `@Resell/ViewModels/ProductDetailsViewModel.swift`:
- Around line 162-169: Remove the temporary debug prints in the delete flow
inside ProductDetailsViewModel (the Task block that checks item?.id and calls
NetworkManager.shared.deletePost); either delete the print(...) lines or wrap
them with a DEBUG-only compiler flag, and replace ad-hoc prints with structured
logging via NetworkManager.shared.logger (include contextual info like the post
id and success/failure). Ensure references: ProductDetailsViewModel's Task that
uses item?.id and NetworkManager.shared.deletePost and use
NetworkManager.shared.logger for any necessary runtime info.

In `@Resell/Views/Settings/SettingsView.swift`:
- Around line 137-138: Remove the dead commented routing call inside the logout
flow in SettingsView (the commented router.push(.login) lines within the logout
action); either delete those commented lines entirely or replace them with a
single short TODO referencing an issue ID if navigation still needs to be
tracked, and ensure the logout action (in SettingsView / the logout handler)
contains only active, purposeful code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 91a6d821-9bb5-453a-a841-b5bb7a094357

📥 Commits

Reviewing files that changed from the base of the PR and between 11e7997 and 220fae5.

📒 Files selected for processing (10)
  • Resell/Models/Listing.swift
  • Resell/Models/Post.swift
  • Resell/ViewModels/MainViewModel.swift
  • Resell/ViewModels/ProductDetailsViewModel.swift
  • Resell/Views/Components/ExpandableAddButton.swift
  • Resell/Views/Components/OptionsMenuView.swift
  • Resell/Views/Home/ProfileView.swift
  • Resell/Views/ProductDetails/ProductDetailsView.swift
  • Resell/Views/Settings/SettingsView.swift
  • Resell/Views/ViewModifiers/LoadingView.swift

Comment thread Resell/Views/ProductDetails/ProductDetailsView.swift
Copy link
Copy Markdown
Contributor

@Xhether Xhether left a comment

Choose a reason for hiding this comment

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

Good work thank you for fixing so many issues, just added a few comments I'd like you to address and I'll approve quickly after :)

Comment thread Resell/ViewModels/ProductDetailsViewModel.swift Outdated
Comment thread Resell/Views/ProductDetails/ProductDetailsView.swift
Comment thread Resell/Views/Settings/SettingsView.swift
… statements and comments. also applied a suggested fix by coderabbit to turn didShowOptionsMenu to false when deletePostView comes up
@ukaylee ukaylee requested a review from Xhether April 9, 2026 19:24
Copy link
Copy Markdown
Contributor

@Xhether Xhether left a comment

Choose a reason for hiding this comment

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

lgtm 🥳

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.

2 participants