Skip to content

[update] code cleanup and modified refresh rates#12

Merged
ClarkLiam merged 8 commits intomainfrom
data
Jan 12, 2026
Merged

[update] code cleanup and modified refresh rates#12
ClarkLiam merged 8 commits intomainfrom
data

Conversation

@ClarkLiam
Copy link
Owner

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:

Terminology and logging consistency:

  • Standardized terminology in comments and logging output, such as capitalizing "Dienstplan" and "Einsatz" in log messages and comments for clarity and consistency. [1] [2] [3] [4] [5] [6]

Behavioral and functional tweaks:

  • Increased the Einsätze update interval from 20 seconds to 15 seconds and increased the number of displayed Einsätze from 3 to 4 for better real-time visibility. [1] [2]
  • Changed the Dienstplan "current event" marker refresh interval from every 30 seconds to every 60 seconds to reduce unnecessary DOM updates.

Minor HTML cleanup:

  • Removed an unnecessary blank line at the end of monitor.html.

Copilot AI review requested due to automatic review settings January 12, 2026 12:14
@ClarkLiam ClarkLiam added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 12, 2026
@ClarkLiam ClarkLiam merged commit 72281f8 into main Jan 12, 2026
9 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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, and vehicles.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
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
function filterAndLimitEvents(events, maxEvents = 8) { // limit to 8 events + check if relevant
// limit to 8 events + check if relevant
function filterAndLimitEvents(events, maxEvents = 8) {

Copilot uses AI. Check for mistakes.
}

// Event is today - check if end time has passed
// event today -> check timeing
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The comment should be "timing" instead of "timeing".

Suggested change
// event today -> check timeing
// event today -> check timing

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
// hide elements that are older then today
// hide elements that are older than today

Copilot uses AI. Check for mistakes.
}

// If event is on a future day, don't hide it
// dont hide future events after today
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
// dont hide future events after today
// don't hide future events after today

Copilot uses AI. Check for mistakes.
}

function checkTime(i) {
function checkTime(i) { // formating
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The inline comment "// formating" has a spelling error. It should be "formatting" with double 't'.

Suggested change
function checkTime(i) { // formating
function checkTime(i) { // formatting

Copilot uses AI. Check for mistakes.

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
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant