Conversation
📝 WalkthroughWalkthroughThe PR systematically updates Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
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)
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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
backend/src/main/kotlin/hu/bme/sch/cmsch/component/task/SubmittedTaskEntity.kt (1)
107-107: Nit: missing space after comma.
OverviewType.NUMBER,columnNameis inconsistent with the other annotation argument separators on the same line (and across the rest of the PR). Pure cosmetic.✏️ Proposed fix
- `@property`:GenerateOverview(renderer = OverviewType.NUMBER,columnName = "Pont", order = 5, centered = true) + `@property`:GenerateOverview(renderer = OverviewType.NUMBER, columnName = "Pont", order = 5, centered = true)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@backend/src/main/kotlin/hu/bme/sch/cmsch/component/task/SubmittedTaskEntity.kt` at line 107, The annotation argument list for the property GenerateOverview is missing a space after the comma between the renderer and columnName arguments; update the annotation on SubmittedTaskEntity (the `@property`:GenerateOverview entry) to use consistent spacing (renderer = OverviewType.NUMBER, columnName = "Pont", order = 5, centered = true) so it matches the project's formatting conventions.backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt (1)
13-14:TIMEandNUMBERare now functionally identical — consider consolidating or differentiating.After this change both entries have
sorter = "number"and the sameformatSettings = arrayOf("vertAlign" to "middle"). Two equivalent enum values invite drift and confuse readers ("why is this field tagged TIME instead of NUMBER?").Two reasonable directions:
- If TIME is meant to be visually distinct (e.g.,
12.345→00:12.345), give it a real formatter viaformatterParamsso it differs fromNUMBER.- Otherwise, drop
TIMEand switch the racetimefields (RaceRecordEntity,FreestyleRaceRecordEntity,RaceEntryDto) toOverviewType.NUMBER.Not blocking for this PR, but worth a follow-up so the enum stays meaningful.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt` around lines 13 - 14, The enum entries TIME and NUMBER in OverviewType are currently identical (both use sorter="number" and formatSettings arrayOf("vertAlign" to "middle")), so either consolidate or differentiate: either remove TIME and update callers (fields in RaceRecordEntity, FreestyleRaceRecordEntity, RaceEntryDto that reference OverviewType.TIME) to use OverviewType.NUMBER, or keep TIME and give it a distinct formatter by adding appropriate formatterParams/formatSettings to OverviewType.TIME to render numeric seconds as a clock string (e.g., minutes:seconds.millis) so it differs from NUMBER; locate the enum entries TIME and NUMBER and then update the enum or the three referencing types (RaceRecordEntity, FreestyleRaceRecordEntity, RaceEntryDto) accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt`:
- Line 9: The DATE column currently uses sorter="number" but formatValue passes
the raw Long (value ?: 0) which may be in milliseconds while the frontend
timestampFormatter (luxon.DateTime.fromSeconds) expects seconds; update the
backend to ensure DATE field values are seconds—either by converting
milliseconds to seconds (divide by 1000) inside the formatValue path for the
DATE enum entry or ensure the source that populates DATE already emits seconds;
locate the DATE enum entry and the formatValue handling around it in
GenerateOverview.kt and add the conversion/validation so the frontend receives
seconds-consistent timestamps.
In `@backend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/ProductEntity.kt`:
- Line 48: The GenerateOverview annotation on the price property now correctly
sets renderer = OverviewType.NUMBER but there is an order collision: both the
price property and the name property use order = 1; update one of the
annotations (the `@property`:GenerateOverview on either the price or name property
in ProductEntity) to a unique order value to ensure deterministic column
ordering in the overview, e.g., increment one of the order values so each column
has a distinct order.
In `@backend/src/main/kotlin/hu/bme/sch/cmsch/component/race/RaceRecordEntity.kt`:
- Line 68: The OverviewType.TIME entry is missing a formatter so elapsed seconds
show raw floats; fix by adding a formatter (e.g., add `"formatter" to
"duration"`) to the TIME enum entry in the OverviewType declaration (so TIME
becomes something like TIME("time", "number", arrayOf("vertAlign" to "middle",
"formatter" to "duration"))), or alternatively change the `@GenerateOverview` use
on the RaceRecordEntity property to a different OverviewType that matches your
intended display (e.g., OverviewType.NUMBER) if a duration formatter isn't
supported.
---
Nitpick comments:
In `@backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt`:
- Around line 13-14: The enum entries TIME and NUMBER in OverviewType are
currently identical (both use sorter="number" and formatSettings
arrayOf("vertAlign" to "middle")), so either consolidate or differentiate:
either remove TIME and update callers (fields in RaceRecordEntity,
FreestyleRaceRecordEntity, RaceEntryDto that reference OverviewType.TIME) to use
OverviewType.NUMBER, or keep TIME and give it a distinct formatter by adding
appropriate formatterParams/formatSettings to OverviewType.TIME to render
numeric seconds as a clock string (e.g., minutes:seconds.millis) so it differs
from NUMBER; locate the enum entries TIME and NUMBER and then update the enum or
the three referencing types (RaceRecordEntity, FreestyleRaceRecordEntity,
RaceEntryDto) accordingly.
In
`@backend/src/main/kotlin/hu/bme/sch/cmsch/component/task/SubmittedTaskEntity.kt`:
- Line 107: The annotation argument list for the property GenerateOverview is
missing a space after the comma between the renderer and columnName arguments;
update the annotation on SubmittedTaskEntity (the `@property`:GenerateOverview
entry) to use consistent spacing (renderer = OverviewType.NUMBER, columnName =
"Pont", order = 5, centered = true) so it matches the project's formatting
conventions.
🪄 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: fc2428bf-431f-494c-93d7-ca7a7f10d73d
📒 Files selected for processing (24)
backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/challenge/ChallengeSubmissionEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/communities/TinderCommunityVirtualEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/DebtsByGroupVirtualEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/DebtsByUserVirtualEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/ProductEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/SoldProductEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/form/FormVirtualEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/leaderboard/LeaderBoardAsGroupEntryDto.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/leaderboard/LeaderBoardAsUserEntryDto.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/location/LocationEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/location/WaypointEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/race/FreestyleRaceRecordEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/race/RaceRecordEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/riddle/RiddleCategoryEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/riddle/RiddleMappingVirtualEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/riddle/RiddleStatsVirtualEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/task/SubmittedTaskEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/task/TaskCategoryEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/task/TaskEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenListByGroupVirtualEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenListByUserVirtualEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenStatVirtualEntity.ktbackend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenVirtualEntity.kt
| ID("id", "number", arrayOf("width" to 100, "vertAlign" to "middle", "visible" to false)), | ||
| TEXT("text", "string", arrayOf("vertAlign" to "middle")), | ||
| DATE("date", "datetime", arrayOf("vertAlign" to "middle", "formatter" to "datetime")), | ||
| DATE("date", "number", arrayOf("vertAlign" to "middle", "formatter" to "datetime")), |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Look at how DATE/datetime columns are wired on the frontend side and whether
# any formatterParams / inputFormat is supplied for Tabulator.
fd -t f -e ts -e tsx -e js -e jsx | xargs rg -nP -C3 '\b(Tabulator|formatter\s*[:=]\s*["'\'']datetime|inputFormat)\b' 2>/dev/nullRepository: kir-dev/cmsch
Length of output: 50370
🌐 Web query:
Tabulator datetime formatter unix timestamp inputFormat formatterParams
💡 Result:
The Tabulator "datetime" formatter does not natively support Unix timestamps via inputFormat. Official docs for versions up to 6.4 show inputFormat expects Luxon format strings (e.g., "yyyy-MM-dd HH:mm") or "iso", but no "unix" option. In older versions using Moment.js (pre-5.0), "unix" worked unofficially due to Moment's flexible parsing of the 'x' token, but Luxon requires DateTime.fromMillis(value) for milliseconds since Unix epoch. Use a custom formatter function for Unix timestamps (assumed milliseconds; multiply by 1000 if seconds): { title: "Time", field: "timestamp", formatter: function(cell, formatterParams) { const value = cell.getValue; const dt = luxon.DateTime.fromMillis(value); return dt.isValid ? dt.toFormat(formatterParams.outputFormat || "yyyy-MM-dd HH:mm") : (formatterParams.invalidPlaceholder || "(invalid date)"); }, formatterParams: { outputFormat: "DD/MM/YY HH:mm", invalidPlaceholder: "(invalid date)" } } Include luxon.js before Tabulator. Ensure luxon.DateTime is globally available (e.g., window.DateTime = luxon.DateTime if using modules). This approach is confirmed in Stack Overflow discussions and GitHub issues for Tabulator 5.x+; no built-in Unix support in recent docs (6.4).
Citations:
- 1: https://stackoverflow.com/questions/72899053/tabulator-js-5-2-datetime-formatter-with-luxon-js-how-to-configure-inputformat
- 2: https://tabulator.info/docs/6.4/format
- 3: http://tabulator.info/docs/5.2/format
- 4: https://github.com/olifolkerd/tabulator/releases
- 5: https://tabulator.info/docs/4.7/release
🏁 Script executed:
# Find frontend files that might configure Tabulator columns
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) -path "*/frontend/*" -o -path "*/src/main/resources/static/*" | head -20Repository: kir-dev/cmsch
Length of output: 1159
🏁 Script executed:
# Search for column configurations that reference "DATE" or Tabulator column definitions
rg -i "column.*datetime|formatter.*datetime|DATE.*column" --type ts --type tsx --type js --type jsx -A 5 2>/dev/null | head -100Repository: kir-dev/cmsch
Length of output: 39
🏁 Script executed:
# Look for where the column definitions from the backend are used in the frontend
rg -i "formatvalue|sorter|formatter" --type ts --type tsx --type js --type jsx -B 2 -A 2 2>/dev/null | head -150Repository: kir-dev/cmsch
Length of output: 39
🏁 Script executed:
# Check if admin-script-4.js exists and read it
wc -l backend/src/main/resources/static/js/admin-script-4.jsRepository: kir-dev/cmsch
Length of output: 116
🏁 Script executed:
# Search for column configuration or formatter references in static JS files
rg "formatter|inputFormat|formatValue|datetime" backend/src/main/resources/static/js/ -A 3 -B 1 2>/dev/null | head -200Repository: kir-dev/cmsch
Length of output: 50370
🏁 Script executed:
# Look for how the column array from backend is used in the frontend
rg -i "columns\s*[:=]|addColumn|setColumns" backend/src/main/resources/static/js/ 2>/dev/null | head -50Repository: kir-dev/cmsch
Length of output: 50370
🏁 Script executed:
cat -n backend/src/main/resources/static/js/admin-script-4.jsRepository: kir-dev/cmsch
Length of output: 10877
🏁 Script executed:
find backend/src/main/resources -name "*.html" -o -name "*.ftl" | head -20Repository: kir-dev/cmsch
Length of output: 1485
🏁 Script executed:
# Search for where Tabulator is used with columns
rg -i "new Tabulator|setColumns|tabulator" backend/src/main/resources/ -l 2>/dev/null | head -10Repository: kir-dev/cmsch
Length of output: 313
🏁 Script executed:
# Search specifically in template files for column or formatter references
rg -i "formatter.*datetime|columns.*date" backend/src/main/resources/ -B 2 -A 2 2>/dev/null | head -100Repository: kir-dev/cmsch
Length of output: 50370
🏁 Script executed:
grep -n "timestampFormatter\|function timestampFormatter" backend/src/main/resources/templates/overview4.html -A 15 | head -60Repository: kir-dev/cmsch
Length of output: 1518
🏁 Script executed:
# Check if there's any documentation or comments about the timestamp format
grep -n "Long\|timestamp\|millisecond\|second" backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt | head -20Repository: kir-dev/cmsch
Length of output: 39
🏁 Script executed:
# Look for how dates are stored/formatted elsewhere in the codebase
rg "DateTime\.|System.currentTimeMillis\|Instant\." backend/src/main/kotlin/hu/bme/sch/cmsch/ --type kotlin -B 2 -A 2 | head -80Repository: kir-dev/cmsch
Length of output: 2961
🏁 Script executed:
# Search for how DATE fields are populated in the data
rg "formatValue.*DATE\|case DATE\|\"date\"" backend/src/main/kotlin/hu/bme/sch/cmsch/admin/ -B 3 -A 3 | head -60Repository: kir-dev/cmsch
Length of output: 39
🏁 Script executed:
# Check the OverviewField and how values are formatted
rg "enum class OverviewField\|formatValue" backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt -B 2 -A 5 | head -80Repository: kir-dev/cmsch
Length of output: 39
🏁 Script executed:
# Let me read the GenerateOverview.kt file directly to see formatValue and DATE handling
sed -n '1,100p' backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.ktRepository: kir-dev/cmsch
Length of output: 1905
🏁 Script executed:
# Check the entire file for the formatValue and DATE sections
grep -n "formatValue\|enum class\|DATE\(" backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt | head -30Repository: kir-dev/cmsch
Length of output: 81
Sorting is fixed, but verify the timestamp units match between backend and frontend formatter.
The change to sorter="number" correctly fixes sorting for the DATE column. However, formatValue passes raw Long values unchanged (value ?: 0), and the frontend uses a custom timestampFormatter that expects values in seconds (luxon.DateTime.fromSeconds(value)). If the backend sends timestamps in milliseconds instead, dates will render incorrectly despite sorting working. Confirm that all DATE field values are populated in seconds, not milliseconds, to avoid display issues.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt` at line
9, The DATE column currently uses sorter="number" but formatValue passes the raw
Long (value ?: 0) which may be in milliseconds while the frontend
timestampFormatter (luxon.DateTime.fromSeconds) expects seconds; update the
backend to ensure DATE field values are seconds—either by converting
milliseconds to seconds (divide by 1000) inside the formatValue path for the
DATE enum entry or ensure the source that populates DATE already emits seconds;
locate the DATE enum entry and the formatValue handling around it in
GenerateOverview.kt and add the conversion/validation so the frontend receives
seconds-consistent timestamps.
| @field:JsonView(value = [ Edit::class, Preview::class, FullDetails::class ]) | ||
| @property:GenerateInput(type = InputType.NUMBER, order = 2, label = "Ár", min = 1, defaultValue = "100", note = "JMF-ben természetesen") | ||
| @property:GenerateOverview(columnName = "Ár", order = 1, centered = true) | ||
| @property:GenerateOverview(renderer = OverviewType.NUMBER, columnName = "Ár", order = 1, centered = true) |
There was a problem hiding this comment.
LGTM on the renderer change; unrelated pre-existing order collision worth noting.
The added renderer = OverviewType.NUMBER is correct. Unrelated to this diff: price (line 48) and name (line 41) both use order = 1, which can cause non-deterministic column ordering in the overview. Pre-existing — feel free to address separately if intentional ordering is desired.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@backend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/ProductEntity.kt` at
line 48, The GenerateOverview annotation on the price property now correctly
sets renderer = OverviewType.NUMBER but there is an order collision: both the
price property and the name property use order = 1; update one of the
annotations (the `@property`:GenerateOverview on either the price or name property
in ProductEntity) to a unique order value to ensure deterministic column
ordering in the overview, e.g., increment one of the order values so each column
has a distinct order.
| @property:GenerateInput(type = InputType.FLOAT3, order = 4, label = "Mért idő", defaultValue = "0.0", | ||
| note = "Másodpercben kell megadni, és ponttal (.) van elválasztva, nem vesszővel! 3 tizedes pontig lehet megadni pontosságot.") | ||
| @property:GenerateOverview(columnName = "Idő", order = 4, centered = true) | ||
| @property:GenerateOverview(renderer = OverviewType.TIME, columnName = "Idő", order = 4, centered = true) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Inspect the OverviewType.TIME enum entry to see its formatter/sorter config
fd -t f 'GenerateOverview.kt' | xargs -I {} sh -c 'echo "=== {} ==="; cat "{}"'Repository: kir-dev/cmsch
Length of output: 1980
OverviewType.TIME has no formatter configured—raw float seconds will display as raw numbers.
The OverviewType.TIME enum entry defines TIME("time", "number", arrayOf("vertAlign" to "middle")) with no formatter parameter, unlike DATE which explicitly includes "formatter" to "datetime". This means the raw float value (e.g., 83.456 for 1 minute 23.456 seconds) will display as-is in the admin interface rather than formatted as human-readable time. The sorter="number" change ensures correct sorting, but without a formatter, the display will not render the elapsed seconds in the intended format. Either configure a formatter for TIME or choose a different OverviewType that doesn't imply formatting not actually applied.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@backend/src/main/kotlin/hu/bme/sch/cmsch/component/race/RaceRecordEntity.kt`
at line 68, The OverviewType.TIME entry is missing a formatter so elapsed
seconds show raw floats; fix by adding a formatter (e.g., add `"formatter" to
"duration"`) to the TIME enum entry in the OverviewType declaration (so TIME
becomes something like TIME("time", "number", arrayOf("vertAlign" to "middle",
"formatter" to "duration"))), or alternatively change the `@GenerateOverview` use
on the RaceRecordEntity property to a different OverviewType that matches your
intended display (e.g., OverviewType.NUMBER) if a duration formatter isn't
supported.
I also changed every renderer of Int and Long properties to number
Summary by CodeRabbit