Skip to content

Conversation

@oriNuguri25
Copy link
Collaborator

@oriNuguri25 oriNuguri25 commented Sep 2, 2025

작업 내용

문제점 및 어려움

해결 방안

공유 사항

Summary by CodeRabbit

  • New Features
    • Deep linking: Open specific order details via URL (order and status). Detail auto-opens on load when provided.
    • URL sync: Changing tabs and opening/closing details updates or respects URL parameters; closing detail clears the order parameter.
    • New order toasts: Remembers dismissed toasts per user across sessions and shows up to three active toasts.
    • Toast improvements: Tapping a toast navigates directly to that order’s detail, and toasts now include the order’s status.

@coderabbitai
Copy link

coderabbitai bot commented Sep 2, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds persistent dismissal for new-order toasts, includes order status in toast payloads, changes toast navigation to include order query param, removes in-memory toast cap while limiting rendered toasts to three, and synchronizes AdminOrders detail view and tabs with URL query parameters, including auto-opening details from URL.

Changes

Cohort / File(s) Summary
Toast UI and behavior
apps/nowait-admin/src/components/NewOrderToast.tsx
Reads dismissed toast IDs from localStorage into a Set; computes up to 3 visible toasts excluding dismissed; updates onTap navigation to include order query; continues dismiss behavior; handles JSON parse errors gracefully.
New order detection and toast payload
apps/nowait-admin/src/hooks/useDetectNewOrders.tsx
Adds status to pushToast payload when detecting new orders; removes comments without logic change.
Toast store and types
apps/nowait-admin/src/hooks/useNewOrderToastStore.tsx
Introduces OrderStatus type; extends Toast with status; changes pushToast to append without a length cap, maintaining duplicate/dismiss checks.
Admin Orders URL-sync and detail handling
apps/nowait-admin/src/pages/AdminOrders/AdminOrders.tsx
Parses order and status from URL; syncs tabs with status; auto-opens detail when order matches; preserves detail on tab change if order exists; closing detail removes order from URL; minor DOM wrapper removal.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Detector as useDetectNewOrders
  participant Store as useNewOrderToastStore
  participant UI as NewOrderToast
  participant Router as Router
  participant Admin as AdminOrders

  Detector->>Store: pushToast({ id, orderId, status, ... })
  Note right of Store: Toast stored (appended).<br/>Dismissed IDs honored downstream.
  UI->>UI: Load dismissed IDs from localStorage
  UI->>UI: visibles = toasts \\ dismissed (limit 3)
  User->>UI: Tap toast
  UI->>Router: navigate(/admin/orders/{storeId}?order={orderId})
  Router-->>Admin: Render with query (order[, status])
  Admin->>Admin: If order in list, open detail<br/>Sync tabs from status
Loading
sequenceDiagram
  autonumber
  participant Router as Router
  participant Admin as AdminOrders
  participant URL as URLSearchParams

  Router-->>Admin: Initial render with ?order, ?status
  Admin->>URL: Read order/status
  alt order matches existing order
    Admin->>Admin: openDetail(order)<br/>- remember scroll<br/>- set selected payment<br/>- navigate replace with order/status
  end
  Admin->>Admin: Sync tabs from status (desktop/mobile)
  Admin-->>Router: On close detail -> remove order (replace)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Develop #399 — Also edits NewOrderToast.tsx (audio path change) affecting the same component modified here.
  • Develop 변경사항 반영 #258 — Touches AdminOrders.tsx (removal/disable) overlapping the file updated for URL-sync and detail handling in this PR.

Suggested reviewers

  • hwangdae
  • dgKim1

Poem

A chime, a toast, a hop of delight,
I stash dismissed IDs out of sight.
With status in paw and URLs bright,
I leap to orders by query at night.
Three carrots—I mean toasts—on display,
Then burrow to details without delay. 🥕🐇


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 33db7a8 and dc66f31.

⛔ Files ignored due to path filters (8)
  • apps/nowait-admin/dist/assets/bg_festival-CTt6Su2V.svg is excluded by !**/dist/**, !**/*.svg
  • apps/nowait-admin/dist/assets/bg_order-Co40Uzux.svg is excluded by !**/dist/**, !**/*.svg
  • apps/nowait-admin/dist/assets/bg_status-CIRyoveo.svg is excluded by !**/dist/**, !**/*.svg
  • apps/nowait-admin/dist/assets/bg_waiting-CooukfHn.svg is excluded by !**/dist/**, !**/*.svg
  • apps/nowait-admin/dist/assets/index-CceQ--ur.css is excluded by !**/dist/**
  • apps/nowait-admin/dist/assets/index-DkSeSUtN.js is excluded by !**/dist/**
  • apps/nowait-admin/dist/assets/sound/newOrder.mp3 is excluded by !**/dist/**, !**/*.mp3
  • apps/nowait-admin/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (4)
  • apps/nowait-admin/src/components/NewOrderToast.tsx (3 hunks)
  • apps/nowait-admin/src/hooks/useDetectNewOrders.tsx (2 hunks)
  • apps/nowait-admin/src/hooks/useNewOrderToastStore.tsx (2 hunks)
  • apps/nowait-admin/src/pages/AdminOrders/AdminOrders.tsx (4 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@oriNuguri25 oriNuguri25 merged commit 507498c into main Sep 2, 2025
2 of 3 checks passed
@github-actions github-actions bot requested a review from hwangdae September 2, 2025 06:25
This was referenced Sep 3, 2025
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.

3 participants