Skip to content

Conversation

@Houwie7000
Copy link
Collaborator

I have a JIRA ticket

  • branch and/or PR name(s) include(s) JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected

Notable changes for users:

  • Option to filter by beam duration has been added to the LHCfills-page filter.

Notable changes for developers:

Changes made to the database:

@Houwie7000 Houwie7000 requested a review from isaachilly December 2, 2025 16:57
@Houwie7000 Houwie7000 self-assigned this Dec 2, 2025
@Houwie7000 Houwie7000 added frontend backend javascript Pull requests that update Javascript code labels Dec 2, 2025
@Houwie7000
Copy link
Collaborator Author

Houwie7000 commented Dec 4, 2025

Git borked, it seems that it included changes from the previous task in this one...
Edit: fixed

@Houwie7000 Houwie7000 force-pushed the feature/O2B-1503/lhcfills-fill-numbers-filter branch from 56e5c6a to 847d092 Compare December 8, 2025 13:10
@Houwie7000 Houwie7000 force-pushed the feature/O2B-1505/lhcfills-beam-duration-filter branch from 23dbb7b to 11c1f9d Compare December 8, 2025 14:15
@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 11.53846% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.35%. Comparing base (4d0e2a0) to head (a047600).

Files with missing lines Patch % Lines
...ilters/common/filters/TextComparisonFilterModel.js 0.00% 19 Missing ⚠️
...c/views/LhcFills/Overview/LhcFillsOverviewModel.js 0.00% 12 Missing ⚠️
lib/utilities/validateTime.js 11.11% 8 Missing ⚠️
...nents/Filters/LhcFillsFilter/beamDurationFilter.js 0.00% 4 Missing ⚠️
lib/public/views/Home/Overview/HomePageModel.js 0.00% 1 Missing ⚠️
...ws/LhcFills/ActiveColumns/lhcFillsActiveColumns.js 0.00% 1 Missing ⚠️
lib/public/views/LhcFills/LhcFills.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2035      +/-   ##
==========================================
- Coverage   45.43%   45.35%   -0.08%     
==========================================
  Files        1028     1031       +3     
  Lines       17136    17181      +45     
  Branches     3120     3127       +7     
==========================================
+ Hits         7785     7792       +7     
- Misses       9351     9389      +38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Houwie7000 Houwie7000 marked this pull request as ready for review December 8, 2025 15:23
@Houwie7000 Houwie7000 requested a review from graduta as a code owner December 8, 2025 15:23
@Houwie7000 Houwie7000 force-pushed the feature/O2B-1503/lhcfills-fill-numbers-filter branch from 847d092 to 3110c29 Compare December 11, 2025 11:12
@Houwie7000 Houwie7000 force-pushed the feature/O2B-1503/lhcfills-fill-numbers-filter branch from 768e86f to 1e3f503 Compare December 15, 2025 15:55
@Houwie7000 Houwie7000 force-pushed the feature/O2B-1505/lhcfills-beam-duration-filter branch from 7f0d22c to 7628bca Compare December 15, 2025 16:25
fillNumbers: Joi.string().trim().custom(validateRange).messages({
'any.invalid': '{{#message}}',
}),
beamDuration: Joi.string().trim().min(8).max(8).custom(validateTime).messages({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could add here a pattern to match the timestamp format to clean up validate function.

*/
export const validateTime = (value, helpers) => {
const timeSectionsString = value.split(':');
let timeSeconds = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the powerValue iterating through is overcomplicating the matter.

I suggest that with the pattern matching previously done and the fact you know where the hours, minutes and seconds will be, just extract them like:

const [hoursStr, minutesStr, secondsStr] = value.split(':');
const hours = Number(hoursStr);

and just hardcode the time multipliers return hours * 3600 + minutes * 60 + seconds.

I think this will simplify the function and make it more readable.

}
}
// Beam duration filter and corresponding operator.
if (beamDuration !== null && beamDuration !== undefined && beamDurationOperator) {
Copy link
Collaborator

@isaachilly isaachilly Dec 16, 2025

Choose a reason for hiding this comment

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

This is quite an overloaded statement. Consider taking out duration.

duration = beamDuration === 0 ? null : beamDuration

isAnyFilterActive() {
return this._filteringModel.isAnyFilterActive();
return this._filteringModel.isAnyFilterActive()
|| this._beamDurationOperator !== defaultBeamDurationOperator;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If operator is changed but the duration doesn’t actually have a value I think it is okay to leave it out of reset filters.
This is same functionality as runs duration filter.

this._beamDurationOperator = defaultBeamDurationOperator;

this._filteringModel.observe(() => this._applyFilters(true));
this._filteringModel.visualChange$.bubbleTo(this);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding debounce here is good practice.

/**
* Beam duration operator setter
*/
setBeamDurationOperator(beamDurationOperator) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be worth viewing how numericalComparisonFilter works and making one for text.

Base automatically changed from feature/O2B-1503/lhcfills-fill-numbers-filter to main December 18, 2025 12:51
@Houwie7000
Copy link
Collaborator Author

Houwie7000 commented Dec 18, 2025

Fixing broken tests WIP.....
Result: it was a fluke...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend frontend javascript Pull requests that update Javascript code

Development

Successfully merging this pull request may close these issues.

4 participants