Skip to content

fix: fixed the post upload redirect on mobile in pictuqe and prevente…#1038

Merged
coodos merged 3 commits into
mainfrom
fix/pictiquePostResponse
Jun 15, 2026
Merged

fix: fixed the post upload redirect on mobile in pictuqe and prevente…#1038
coodos merged 3 commits into
mainfrom
fix/pictiquePostResponse

Conversation

@Sahil2004

@Sahil2004 Sahil2004 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

…d the double clicking of button on post in mobile.

Description of change

fixed the post upload redirect on mobile in pictuqe and prevented the double clicking of button on post in mobile.

Issue Number

Closes #1032

Type of change

  • Fix (a change which fixes an issue)

How the change has been tested

Manually.

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

  • Bug Fixes

    • Button no longer triggers submission or callbacks when clicked while disabled or in a loading/submitting state.
    • Temporary uploaded image data is now properly cleared when navigating away from the post creation page.
  • New Features

    • Successful post submissions now redirect users to the home feed automatically.

…d the double clicking of button on post in mobile.
@Sahil2004 Sahil2004 requested a review from coodos as a code owner June 15, 2026 05:56
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Sahil2004, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 46 minutes and 26 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de440bcd-9811-4559-8101-92447ef739a4

📥 Commits

Reviewing files that changed from the base of the PR and between 68c305f and a22b108.

📒 Files selected for processing (1)
  • platforms/pictique/client/src/routes/(protected)/post/+page.svelte
📝 Walkthrough

Walkthrough

Button.svelte gains an early-return guard in handleClick that prevents click logic from executing when disabled is true. The post creation page imports beforeNavigate to revoke uploaded image URLs and clear uploadedImages when navigating away from /post, and the submission handler now navigates to /home after createPost succeeds.

Changes

Post Submission Fixes

Layer / File(s) Summary
Button disabled guard
platforms/pictique/client/src/lib/ui/Button/Button.svelte
handleClick short-circuits immediately when disabled is true, blocking blockingClick submission logic and any callbacks from running.
Post page navigation cleanup and redirect
platforms/pictique/client/src/routes/(protected)/post/+page.svelte
Imports beforeNavigate and registers a guard that revokes uploaded image object URLs and nulls uploadedImages.value when navigating away from /post; postSubmissionHandler now calls goto('/home') after createPost completes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • sosweetham
  • coodos

Poem

🐇 Hop hop, the button won't fire twice,
When disabled, it's cold as ice!
The images cleaned on navigate away,
And /home ends the posting day.
No more phantom posts, hooray—
The rabbit fixed the feedback UI! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is incomplete and appears truncated (ends with 'prevente…'), making it vague and unclear what the actual changes are. Complete the title to clearly describe the fix, e.g., 'fix: prevent double-clicking button on post upload and redirect to home on success'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the main points with issue number, change type, and testing method, though some sections lack detail and clarity.
Linked Issues check ✅ Passed The changes address both requirements from issue #1032: redirecting to /home after post creation and preventing double submission via disabled button handling.
Out of Scope Changes check ✅ Passed All changes directly support the objectives of fixing the post upload redirect and preventing double-clicking; no unrelated modifications detected.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pictiquePostResponse

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@platforms/pictique/client/src/routes/`(protected)/post/+page.svelte:
- Around line 61-65: The onDestroy hook unconditionally clears
uploadedImages.value and calls revokeImageUrls whenever the component is
destroyed, but this also fires when navigating to sub-routes like /post/audience
where the parent component is destroyed while the user is still within the
/post* route tree. Add a condition to the onDestroy hook to only perform the
cleanup (calling revokeImageUrls and setting uploadedImages.value to null) when
actually exiting the /post* route family entirely, not when navigating within
it. Check the current route to determine whether cleanup should proceed.
🪄 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: 62ca2ccf-4cf3-4df7-8521-c8d7486e3414

📥 Commits

Reviewing files that changed from the base of the PR and between 5f08b54 and 653e65f.

📒 Files selected for processing (2)
  • platforms/pictique/client/src/lib/ui/Button/Button.svelte
  • platforms/pictique/client/src/routes/(protected)/post/+page.svelte

Comment thread platforms/pictique/client/src/routes/(protected)/post/+page.svelte Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@platforms/pictique/client/src/routes/`(protected)/post/+page.svelte:
- Around line 60-65: The issue is that setting uploadedImages.value to null
inside the beforeNavigate hook triggers a $effect (at line 16) that calls
window.history.back(), which races with the intended navigation (like
goto('/home')). To fix this, either add a flag or guard to prevent the $effect
from calling window.history.back() when the route is intentionally being exited,
or defer the cleanup of uploadedImages.value until after the component unmounts
rather than doing it inside beforeNavigate. The goal is to ensure the
back-navigation effect only runs when appropriate (e.g., unsaved changes with a
user-triggered back), not as a side effect of the cleanup logic during
intentional route transitions.
🪄 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: 2ee967e7-4ef9-4017-aad5-a4953fa25aa9

📥 Commits

Reviewing files that changed from the base of the PR and between 653e65f and 68c305f.

📒 Files selected for processing (1)
  • platforms/pictique/client/src/routes/(protected)/post/+page.svelte

Comment thread platforms/pictique/client/src/routes/(protected)/post/+page.svelte
@coodos coodos merged commit 7e0fa43 into main Jun 15, 2026
4 checks passed
@coodos coodos deleted the fix/pictiquePostResponse branch June 15, 2026 10:03
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.

Pictique: No success message shown after uploading a post — screen stays unchanged

2 participants