Skip to content

Conversation

@ricardoantoniocm
Copy link
Contributor

@ricardoantoniocm ricardoantoniocm commented Dec 11, 2025

This pull request introduces a "recently visited projects" feature to the Home page, improving the user experience by displaying projects in the order they were last accessed. It leverages Jotai atoms for state management and localStorage for persistence. The Home page now sorts and displays projects based on visit history, and records visits automatically when a project is accessed.

Recording

https://www.loom.com/share/c2134c86f53b48d78eb7470361229e6b

Key changes include:

Recently Visited Projects Feature:

  • Added new utility functions getVisitedProjectIds and addVisitedProject in visitedProjects.ts to manage a per-user list of recently visited project IDs, stored in localStorage and capped at 10 entries.
  • Exported the new visited projects utilities from the core library for use throughout the app.

Home Page State Management and Sorting:

  • Refactored HomePage.tsx to use Jotai atoms for dialog state, project data, and sorting logic. Introduced atoms for modal state, project data, and a derived atom that sorts projects by visit history, showing recently visited projects first. [1] [2] [3] [4] [5] [6]
  • The Home page now displays projects in the order of most recently visited, falling back to the default order for projects not yet visited. [1] [2]

Project Visit Tracking:

  • Updated ProjectProvider.tsx to call addVisitedProject whenever a project is loaded, ensuring visits are recorded for the current user. [1] [2]

These changes collectively enhance the Home page by making it more responsive to user activity and improving discoverability of recently accessed projects.

@ricardoantoniocm ricardoantoniocm self-assigned this Dec 11, 2025
@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit beda391
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/693c5d2f9019590008480dc9

@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit beda391
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/693c5d2f9176660007817ac5
😎 Deploy Preview https://deploy-preview-8993--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit beda391
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/693c5d2fda99ee0008973d0f

@github-actions github-actions bot added the fix label Dec 11, 2025
@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit beda391
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/693c5d2f2d78450008360ca2
😎 Deploy Preview https://deploy-preview-8993--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 10.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.88%. Comparing base (3dbc16d) to head (beda391).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
web/libs/core/src/lib/utils/visitedProjects.ts 10.00% 18 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (3dbc16d) and HEAD (beda391). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (3dbc16d) HEAD (beda391)
pytests 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8993      +/-   ##
===========================================
- Coverage    66.70%   57.88%   -8.82%     
===========================================
  Files          828      562     -266     
  Lines        64762    40576   -24186     
  Branches     10986    10990       +4     
===========================================
- Hits         43198    23488   -19710     
+ Misses       21560    17084    -4476     
  Partials         4        4              
Flag Coverage Δ
lsf-e2e 52.54% <10.00%> (-0.02%) ⬇️
lsf-integration 48.50% <10.00%> (-0.02%) ⬇️
lsf-unit 8.81% <ø> (ø)
pytests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Dec 11, 2025

/git merge

Workflow run
Successfully merged: create mode 100644 web/libs/ui/src/assets/icons/state-needs-review.svg

@ricardoantoniocm ricardoantoniocm marked this pull request as ready for review December 11, 2025 20:05
@ricardoantoniocm ricardoantoniocm requested a review from a team December 11, 2025 20:25
Comment on lines +83 to +97
// Fetch visited projects specifically by their IDs
const { data: visitedProjectsData } = useQuery({
queryKey: ["visited-projects", { ids: visitedIds }],
async queryFn() {
if (visitedIds.length === 0) return { results: [], count: 0 };

return api.callApi<{ results: APIProject[]; count: number }>("projects", {
params: {
ids: visitedIds.join(","),
page_size: visitedIds.length,
},
});
},
enabled: visitedIds.length > 0,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

this may fit better in the ProjectProvider then you can use it here.
moving it to ProjectProvider will help keep the Project query code together and reuse it here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I just realised we have another hook above that should be moved over - maybe we can circle back and clean this up later.

Copy link
Contributor

@yyassi-heartex yyassi-heartex left a comment

Choose a reason for hiding this comment

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

looks good to me - just make sure all checks pass and run selenium - changing the order of the home projects may impact selenium tests so updates may be required

@robot-ci-heartex robot-ci-heartex merged commit f07f417 into develop Dec 12, 2025
62 of 66 checks passed
@robot-ci-heartex robot-ci-heartex deleted the fb-bros-340 branch December 12, 2025 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants