Skip to content

Fix : Sadang-bound Train Display - #107

Open
kcyoow wants to merge 2 commits into
mainfrom
dev/fix-train-display
Open

Fix : Sadang-bound Train Display#107
kcyoow wants to merge 2 commits into
mainfrom
dev/fix-train-display

Conversation

@kcyoow

@kcyoow kcyoow commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Describe your Pull Request

  • Hide southbound Line 4 trains terminating at Sadang from the subway arrival list.
  • These trains terminate before reaching HYU and Jungang Station, but could appear around midnight.

Additional content

  • Verified with Prettier, ESLint, production build, and browser before/after screenshots.

Summary by CodeRabbit

  • Bug Fixes
    • Updated subway timetable filtering to exclude Line 4 trains bound for 사당 when traveling in direction 2.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kcyoow, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 75e25a89-2eea-4e55-aa80-2df8ddf514de

📥 Commits

Reviewing files that changed from the base of the PR and between 44bac76 and 1a684e4.

📒 Files selected for processing (1)
  • src/app/components/subway/Subway.tsx
📝 Walkthrough

Walkthrough

The subway timetable filter now excludes Line 4 trains traveling in direction 2 with destination 사당. Existing filtering, sorting, slicing, and rendering behavior remains unchanged.

Changes

Subway timetable filtering

Layer / File(s) Summary
Add destination exclusion
src/app/components/subway/Subway.tsx
The timetable filter excludes Line 4 direction 2 trains bound for 사당 while retaining existing direction and non-null destination checks.

Estimated code review effort: 2 (Simple) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing the display of Sadang-bound trains.
Description check ✅ Passed The description includes both required sections and clearly explains the behavior change and verification steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 dev/fix-train-display

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the subway timetable filtering in Subway.tsx to exclude Line 4 southbound trains terminating at Sadang ('사당'). The reviewer suggests a more robust and maintainable solution: instead of blacklisting specific terminating stations, the code should whitelist only the valid southbound destinations ('안산', '오이도', '인천') that actually pass through the target stations, which avoids similar issues with other terminating trains.

Comment on lines +322 to 330
(val) =>
val.direction === direction &&
val.destination !== null &&
!(
val.line === '4' &&
val.direction === 2 &&
val.destination === '사당'
),
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

🔍 Robust Filtering for Southbound Trains

While filtering out Sadang-bound (사당) southbound trains fixes the immediate issue, this approach is incomplete and prone to similar bugs for other terminating stations.

The Issue

The Seoul Metro API returns upstream trains, some of which terminate before reaching the current station (Hanyang Univ. at Ansan or Jungang).

Besides 사당, there are other southbound terminating stations upstream that will exhibit the exact same bug (e.g., showing up on the UI but never arriving):

  • Line 4: Trains terminating at 금정 (Geumjeong) or 산본 (Sanbon).
  • Suin-Bundang Line: Trains terminating at 고색 (Gosaek), 수원 (Suwon), or 죽전 (Jukjeon).

The Solution

Instead of blacklisting specific stations like 사당, we should whitelist the only valid southbound (direction 2) destinations that actually reach or pass through Hanyang Univ. at Ansan and Jungang:

  • 안산 (Ansan)
  • 오이도 (Oido)
  • 인천 (Incheon)

Any other southbound destination is invalid and should be filtered out. This is much more robust, cleaner, and prevents future bugs with other terminating trains.

          (val) =>
            val.direction === direction &&
            val.destination !== null &&
            (direction !== 2 ||
              ['안산', '오이도', '인천'].includes(val.destination)),
        )

@kcyoow
kcyoow marked this pull request as ready for review August 3, 2026 15:16
Copilot AI review requested due to automatic review settings August 3, 2026 15:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 3, 2026 15:39
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploying hybus-genesis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1a684e4
Status: ✅  Deploy successful!
Preview URL: https://b6e06150.hybus-genesis.pages.dev
Branch Preview URL: https://dev-fix-train-display.hybus-genesis.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Check out your Lighthouse Report: https://lighthouse.hybus.app/app/projects/bushanyang-production/dashboard

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