Skip to content

Smart folders simple UI#1459

Open
Dima-1 wants to merge 12 commits intomainfrom
smart-folders
Open

Smart folders simple UI#1459
Dima-1 wants to merge 12 commits intomainfrom
smart-folders

Conversation

@Dima-1
Copy link
Contributor

@Dima-1 Dima-1 commented Feb 19, 2026

@Dima-1 Dima-1 marked this pull request as ready for review February 27, 2026 08:10
ctx.setTracksGroups([...trackGroups, ...smartFolders]);
} else {
ctx.setTracksGroups([]);
const smartFolders = ctx.tracksGroups?.filter((g) => g.type === SMART_TYPE) || [];
Copy link
Contributor

Choose a reason for hiding this comment

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

There are empty groups here where smartFolders come from.

});

setTracksGroups((prev) => {
const withoutSmartFolders = prev.filter((g) => g.type !== SMART_TYPE);
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplication of logic

@Dima-1 Dima-1 requested a review from alisa911 March 3, 2026 08:06
Copy link
Contributor

@alisa911 alisa911 left a comment

Choose a reason for hiding this comment

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

Check all comments, close the ones that are no longer relevant or fix them.

let minMs = Infinity;
let minDate = null;

(smartFolder.userFilePaths ?? []).forEach((path) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not sort the files on the backend?

async function getSmartFolders() {
const res = await apiGet(`${process.env.REACT_APP_USER_API_SITE}/mapapi/create-smart-folders`, {});
if (res.ok) {
return res.json();
Copy link
Contributor

Choose a reason for hiding this comment

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

Take the date right away

} else {
setPopulatedGroup(group);
}
}, [openActions, group, ctx.listFiles?.uniqueFiles]);
Copy link
Contributor

Choose a reason for hiding this comment

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

The list of files for filters should only be fetched when a specific folder is opened. The cache should be stored after the first read, and cleared only when either listFiles changes or the context is updated.

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.

2 participants