Conversation
… accumulation Introduce getTaskLabels(filtered) on ContestTableProviderBase to support display-only positional labels (e.g. "A. Problem Title"). The previous approach of mutating title inside generateTable caused prefix accumulation on optimistic-update re-runs because transformed objects were written back to the source $state array. AojIcpcPrelimProvider now overrides getTaskLabels instead of generateTable, and TaskTableBodyCell derives displayTitle via $derived to apply the label. Also add svelte-runes rule documenting the $derived accumulation trap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…f/else Two-level nested ternary is hard to read. $derived.by with early returns makes the three cases (taskLabel / isShownTaskIndex / default) explicit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughICPC のタスク位置ラベル生成を、データ配列を mutate してタイトルを直接変更する方式から、provider.getTaskLabels が返すラベルマップとビュー側の派生(formatAojIcpcTitle)で表示整形する方式へ移行し、派生内ミューテーションによる「蓄積トラップ」を回避します。 ChangesICPC Task Label Architecture Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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. Comment |
…tation complete Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@src/features/tasks/types/contest-table/contest_table_provider.ts`:
- Around line 70-74: Update the TSDoc for the getTaskLabels(filteredTaskResults:
TaskResults) method to explicitly describe the return structure: a nested record
where the top-level keys are contestId (string), each maps to a second-level
record keyed by task_table_index (string) whose values are the display label
string (e.g., "A", "B" or empty). Mention that entries may be missing for
providers that render indexes in column headers and clarify any invariants
(e.g., no nulls, empty string when absent). Reference getTaskLabels in the
comment so implementers can find and understand expected shapes.
In `@src/features/tasks/utils/contest-table/aoj_icpc_providers.test.ts`:
- Around line 397-426: Add a test that verifies getTaskLabels respects the
ICPC_PRELIM_LABEL_OVERRIDES by setting a mock override map and asserting
provider2023.getTaskLabels(tasks2023) returns the custom labels (e.g. 'X','Y')
for the affected numeric task IDs; specifically reference getTaskLabels,
ICPC_PRELIM_LABEL_OVERRIDES and buildAojIcpcLetterMap to locate logic and add a
new describe/it under the existing getTaskLabels tests that injects the override
(or stubs buildAojIcpcLetterMap) and checks the returned labels object contains
the overridden values for the contestId key.
In `@src/features/tasks/utils/contest-table/contest_table_provider_base.test.ts`:
- Around line 27-31: Add a second test that calls ABSProvider.getTaskLabels with
a non-empty array (e.g., one or more task identifiers) and asserts it still
returns an empty object; specifically locate the ABSProvider instantiation (new
ABSProvider(ContestType.ABS)) and add an additional
expect(provider.getTaskLabels([...nonEmpty...])).toEqual({}) test to confirm the
base implementation consistently returns {} for non-empty input as well.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: fcf38611-17b8-45b5-8c3a-fc094693926b
📒 Files selected for processing (12)
.claude/rules/svelte-runes.md.claude/skills/add-contest-table-provider/instructions.mddocs/guides/how-to-add-contest-table-provider.mdsrc/features/tasks/components/contest-table/TaskTable.sveltesrc/features/tasks/components/contest-table/TaskTableBodyCell.sveltesrc/features/tasks/types/contest-table/contest_table_provider.tssrc/features/tasks/utils/contest-table/aoj_icpc_labels.test.tssrc/features/tasks/utils/contest-table/aoj_icpc_labels.tssrc/features/tasks/utils/contest-table/aoj_icpc_providers.test.tssrc/features/tasks/utils/contest-table/aoj_icpc_providers.tssrc/features/tasks/utils/contest-table/contest_table_provider_base.test.tssrc/features/tasks/utils/contest-table/contest_table_provider_base.ts
…paths
ContestTableProviderBase.getTaskLabels was untested (always returns {}).
AojIcpcPrelimProvider override map path was also missing coverage.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t.ts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
close #3636
Summary by CodeRabbit
Documentation
Refactor
Tests