Conversation
There was a problem hiding this comment.
Pull request overview
This pull request focuses on code cleanup and maintainability improvements across JavaScript modules handling event schedules (Dienstplan) and personnel data. The changes primarily involve adding clarifying comments, standardizing terminology in log messages, and adjusting refresh intervals for better performance.
Changes:
- Added inline documentation comments to clarify function purposes in
clock.js,dienstplan.js,personal.js, andvehicles.js - Standardized terminology in console logs (capitalizing "Dienstplan" consistently)
- Adjusted refresh intervals: Personal data (60s → 120s), Dienstplan current event markers (30s → 60s)
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/js/vehicles.js | Removed redundant explanatory comments from CSV parsing logic |
| src/js/personal.js | Cleaned up comments and increased update interval to 120 seconds |
| src/js/dienstplan.js | Updated comments, standardized terminology, and changed marker refresh to 60 seconds |
| src/js/clock.js | Added inline comments to document time-related functions |
| monitor.html | Removed trailing blank line for cleaner formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| function filterAndLimitEvents(events, maxEvents = 8) { | ||
| // Filter out passed events | ||
| function filterAndLimitEvents(events, maxEvents = 8) { // limit to 8 events + check if relevant |
There was a problem hiding this comment.
The inline comment structure is inconsistent with the rest of the codebase. The trailing inline comment format (e.g., "function filterAndLimitEvents(events, maxEvents = 8) { // limit to 8 events + check if relevant") uses excessive spacing before the comment. For consistency and readability, consider using a single space after the opening brace or placing the comment on a separate line above the function.
| function filterAndLimitEvents(events, maxEvents = 8) { // limit to 8 events + check if relevant | |
| // limit to 8 events + check if relevant | |
| function filterAndLimitEvents(events, maxEvents = 8) { |
| } | ||
|
|
||
| // Event is today - check if end time has passed | ||
| // event today -> check timeing |
There was a problem hiding this comment.
The comment should be "timing" instead of "timeing".
| // event today -> check timeing | |
| // event today -> check timing |
| const todayDate = new Date(now.getFullYear(), now.getMonth(), now.getDate()); | ||
|
|
||
| // If event is on a past day, hide it | ||
| // hide elements that are older then today |
There was a problem hiding this comment.
The comment should read "hide elements that are older than today" instead of "hide elements that are older then today". The word "then" should be "than" for proper comparison.
| // hide elements that are older then today | |
| // hide elements that are older than today |
| } | ||
|
|
||
| // If event is on a future day, don't hide it | ||
| // dont hide future events after today |
There was a problem hiding this comment.
The comment should read "don't hide future events after today" instead of "dont hide future events after today". The contraction "don't" should include an apostrophe.
| // dont hide future events after today | |
| // don't hide future events after today |
| } | ||
|
|
||
| function checkTime(i) { | ||
| function checkTime(i) { // formating |
There was a problem hiding this comment.
The inline comment "// formating" has a spelling error. It should be "formatting" with double 't'.
| function checkTime(i) { // formating | |
| function checkTime(i) { // formatting |
|
|
||
| function eventStartDateObj(event) { | ||
| // Build a Date from event.date (DD.MM.YY) and event.startTime (HH:MM) | ||
| function eventStartDateObj(event) { // build date from date & time functions |
There was a problem hiding this comment.
The inline comment structure is inconsistent with the rest of the codebase. The trailing inline comment format used here (e.g., "function eventStartDateObj(event) { // build date from date & time functions") is different from the previous inline comments in the file. For consistency and readability, consider placing this comment on a separate line above the function or adjusting the spacing to be consistent with other inline comments in the codebase.
This pull request primarily improves code readability and maintainability in the JavaScript modules for handling Dienstplan (event schedule) and Einsätze (emergency calls) by adding clarifying comments, standardizing terminology, and making minor behavioral adjustments. The changes also include tweaks to update intervals and the number of displayed items for Einsätze, as well as some small adjustments to the Dienstplan refresh logic.
Code readability and documentation improvements:
src/js/clock.js,src/js/dienstplan.js, andsrc/js/einsätze.jsto clarify the purpose of functions, variables, and code blocks, making the code easier to understand for future maintainers. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]Terminology and logging consistency:
Behavioral and functional tweaks:
Minor HTML cleanup:
monitor.html.