Skip to content

Conversation

@rostislavnagimov
Copy link
Contributor

@rostislavnagimov rostislavnagimov commented Jun 18, 2025

The issue: filters in a tracker were set globally, so if you have two same tabs you cannot set two different set of filters (and some people in a product_feedback were asking to have this feature).

@huly-github-staging
Copy link

Connected to Huly®: UBERF-11658

let resultQuery: DocumentQuery<Issue> = { ...searchQuery }
function saveTrackerIssueState (): void {
console.log('[DEBUG_STATE_ISSUES] Save State: Starting for tab', currentTabId)
Copy link
Member

Choose a reason for hiding this comment

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

extra logs, please remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned up

import { Viewlet } from '@hcengineering/view'
import ViewletSelector from './ViewletSelector.svelte'
import FilterButton from './filter/FilterButton.svelte'
import { WorkbenchTab } from '../../../workbench/types'
Copy link
Member

Choose a reason for hiding this comment

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

No. You can't use workbench types in view, because workbench depends on view... You should extract it to the view package, or use Ref instead

Copy link
Member

Choose a reason for hiding this comment

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

This actually indicates the problem with the approach - the header and button components know on which tab rendered, which is not correct per my point of view.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved the logic to the Workbench layer, keeping all the View components pure

@rostislavnagimov rostislavnagimov force-pushed the tracker_filters branch 2 times, most recently from 99a8066 to 1dc152c Compare June 27, 2025 04:28
@aonnikov
Copy link
Member

Can you explain the idea, how this works?

@rostislavnagimov
Copy link
Contributor Author

Can you explain the idea, how this works?

We save the filter state in a store with a tabId relation and restore the state when user gets back on a tab. That is the basic idea.

Signed-off-by: Rostislav Nagimov <[email protected]>
@rostislavnagimov rostislavnagimov force-pushed the tracker_filters branch 2 times, most recently from 82dff5d to b40ddc1 Compare June 30, 2025 05:32
Signed-off-by: Rostislav Nagimov <[email protected]>
@aonnikov aonnikov closed this Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants