Skip to content

[O2B-1534] Migrate log overview to use filtering model pattern#2083

Open
NarrowsProjects wants to merge 49 commits intomainfrom
improv/O2B-1534/Migrate-Log-Overview-to-use-FilteringModel-pattern
Open

[O2B-1534] Migrate log overview to use filtering model pattern#2083
NarrowsProjects wants to merge 49 commits intomainfrom
improv/O2B-1534/Migrate-Log-Overview-to-use-FilteringModel-pattern

Conversation

@NarrowsProjects
Copy link
Copy Markdown
Collaborator

@NarrowsProjects NarrowsProjects commented Feb 20, 2026

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:

  • Individual from-to selectors on the logs page have been replaced with a single field that will open the standard time range selector
  • All open-input forms apply their filters when focus is lost on them.

Notable changes for developers:

  • All filters have been moved to a filteringModel in logsOverviewModel
  • The filters for runs, lhcfills and environments have been renamed under the hood to match getAllRunsUseCase:
    • runs => runNumbers
    • lhcFills => fillNumbers
    • environments => environmentIds

Changes made to the database:

  • none

@NarrowsProjects NarrowsProjects self-assigned this Feb 20, 2026
@NarrowsProjects NarrowsProjects added frontend javascript Pull requests that update Javascript code labels Feb 20, 2026
@NarrowsProjects NarrowsProjects marked this pull request as draft February 20, 2026 11:53
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 34.78261% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.75%. Comparing base (1333378) to head (3bf7e66).

Files with missing lines Patch % Lines
...ib/public/views/Logs/Overview/LogsOverviewModel.js 0.00% 11 Missing ⚠️
...blic/views/Logs/ActiveColumns/logsActiveColumns.js 0.00% 8 Missing ⚠️
...nts/Filters/LogsFilter/author/AuthorFilterModel.js 0.00% 6 Missing ⚠️
...mponents/Filters/LogsFilter/author/authorFilter.js 0.00% 3 Missing ⚠️
...ic/components/Filters/common/filters/textFilter.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2083      +/-   ##
==========================================
+ Coverage   45.50%   45.75%   +0.24%     
==========================================
  Files        1044     1042       -2     
  Lines       17353    17213     -140     
  Branches     3149     3119      -30     
==========================================
- Hits         7897     7875      -22     
+ Misses       9456     9338     -118     

☔ 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.

@NarrowsProjects NarrowsProjects force-pushed the improv/O2B-1534/Migrate-Log-Overview-to-use-FilteringModel-pattern branch from 07567e2 to 114285d Compare February 20, 2026 12:02
@NarrowsProjects NarrowsProjects force-pushed the improv/O2B-1534/Migrate-Log-Overview-to-use-FilteringModel-pattern branch from a936a03 to 5500b3e Compare February 20, 2026 16:24
@NarrowsProjects NarrowsProjects marked this pull request as ready for review February 21, 2026 18:22
*
* @param {LogModel} logModel the log model object
* @returns {Component} the author filter component
* @param {LogsOverviewModel} logsOverviewModel the log overview model
Copy link
Copy Markdown
Collaborator

@isaachilly isaachilly Apr 13, 2026

Choose a reason for hiding this comment

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

The overviewModel param doesn't exist in the func.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Taken care of

authorFilterTextInput(authorFilter),
resetAuthorFilterButton(authorFilter),
excludeAnonymousLogAuthorToggle(authorFilter),
export const authorFilter = ({ filteringModel }) => h('.flex-row.items-center.g3', [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It would be more consistent with other ActiveColumns Filter setups to get the matching filter's model in ActiveColumns and pass only that to the Filter. And we sent the function only the specific data it needs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Taken care of

const resetAuthorFilterButton = (authorFilterModel) => h(
'.btn.btn-pill.f7',
{ disabled: authorFilterModel.isEmpty, onclick: () => authorFilterModel.clear() },
{ disabled: authorFilterModel.isEmpty, onclick: () => authorFilterModel.reset() },
Copy link
Copy Markdown
Collaborator

@isaachilly isaachilly Apr 13, 2026

Choose a reason for hiding this comment

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

.clear() reloaded the table's items because it notified. This is not the case currently with .reset() of RawTextFilterModel thus, when you click the cross button, the author text is emptied, but the table remains the same, it is not refreshed as it should be.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Taken care off

* @inheritDoc
*/
reset() {
reset(notify = false) {
Copy link
Copy Markdown
Collaborator

@isaachilly isaachilly Apr 13, 2026

Choose a reason for hiding this comment

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

TBD offline with result commented here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Outdated

iconX(),
);
const resetAuthorFilterButton = (authorFilterModel) =>
h('.btn.btn-pill.f7', { disabled: authorFilterModel.isEmpty, onclick: () => authorFilterModel.reset(true) }, iconX());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

True is still being sent to the function here, we are now overwriting it so don't need the param.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the catch

return;
}

reset() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the clear method just needs reinstating because it handled the if empty and the notify. This will create a duplicate fetch because filteringModel will call reset on the model and it'll notify.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Taken care of

),

/**
* Title filter component
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Title, contend and author do not have placeholder text and I think it would be good and consistent for them to have.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Taken care of

@NarrowsProjects NarrowsProjects force-pushed the improv/O2B-1534/Migrate-Log-Overview-to-use-FilteringModel-pattern branch from 3cd62d0 to 370c475 Compare April 13, 2026 13:19
}

if (filter.run?.values?.length > 0) {
if (runNumbers?.length > 0) {
Copy link
Copy Markdown
Collaborator

@isaachilly isaachilly Apr 13, 2026

Choose a reason for hiding this comment

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

Can this just be if runNumbers? Check the other filter ifs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I suppose you are right, I just didn't question the original logic


await pressElement(page, '#reset-filters');
await waitForTableLength(page, 1);
await openFilteringPanel(page);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this line needed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, but the line shouldn't be there, the next text needs the filteringpanel to be open

await pressElement(page, '#reset-filters');
await waitForTableLength(page, 1);
await openFilteringPanel(page);
await resetFilters(page);
Copy link
Copy Markdown
Collaborator

@isaachilly isaachilly Apr 13, 2026

Choose a reason for hiding this comment

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

Could we make use of before/after each functions to handle resetting filters etc?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Taken care of

await pressElement(page, '#openFilterToggle');
await waitForTableTotalRowsCountToEqual(page, 119);

// await new Promise((res, _rej) => setTimeout(() => res(), 2000))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm assuming leftover things here.

await waitForNavigation(page, () => pressElement(page, `${popoverSelector} a`))
expectUrlParams(page, { page: 'run-detail', runNumber: 2 })
});
// it('can filter by creation date', async () => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

An accidental commit of commented out tests.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

lovely

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

Labels

frontend javascript Pull requests that update Javascript code

Development

Successfully merging this pull request may close these issues.

2 participants