Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tag on scene #1900

Merged
merged 34 commits into from
Nov 20, 2023
Merged

Conversation

callemand
Copy link
Contributor

@callemand callemand commented Sep 26, 2023

Pull Request check-list

To ensure your Pull Request can be accepted as fast as possible, make sure to review and check all of these items:

  • If your changes affects code, did your write the tests?
  • Are tests passing? (npm test on both front/server)
  • Is the linter passing? (npm run eslint on both front/server)
  • Did you run prettier? (npm run prettier on both front/server)
  • If you are adding a new features/services, did you run integration comparator? (npm run compare-translations on front)
  • Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community (french forum/english forum) for testing before merging.

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Description of change

Screenshot 2023-09-26 at 08 32 48 Screenshot 2023-09-25 at 11 38 03

@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (30ce850) 98.17% compared to head (bb6be08) 98.17%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1900   +/-   ##
=======================================
  Coverage   98.17%   98.17%           
=======================================
  Files         773      776    +3     
  Lines       12133    12167   +34     
=======================================
+ Hits        11911    11945   +34     
  Misses        222      222           

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

@callemand callemand marked this pull request as ready for review September 27, 2023 08:58
@relativeci
Copy link

relativeci bot commented Sep 27, 2023

Job #2043: Bundle Size — 9.01MiB (+0.24%).

bb6be08(current) vs 30ce850 master#2032(baseline)

Warning

Bundle contains 3 duplicate packages – View duplicate packages

Bundle metrics  Change 5 changes Regression 3 regressions
                 Current
Job #2043
     Baseline
Job #2032
Regression  Initial JS 4.86MiB(+0.29%) 4.85MiB
Regression  Initial CSS 302.38KiB(+0.18%) 301.85KiB
Change  Cache Invalidation 57.2% 53.75%
No change  Chunks 51 51
No change  Assets 157 157
Change  Modules 1400(+0.29%) 1396
No change  Duplicate Modules 20 20
Regression  Duplicate Code 0.83%(+1.22%) 0.82%
No change  Packages 124 124
No change  Duplicate Packages 3 3
Bundle size by type  Change 2 changes Regression 2 regressions
                 Current
Job #2043
     Baseline
Job #2032
Regression  JS 6.52MiB (+0.32%) 6.5MiB
Not changed  IMG 2.06MiB 2.06MiB
Regression  CSS 318.76KiB (+0.21%) 318.08KiB
Not changed  Fonts 93.55KiB 93.55KiB
Not changed  Other 16.06KiB 16.06KiB
Not changed  HTML 13.58KiB 13.58KiB

View job #2043 reportView callemand:AddTagOnScene branch activity

Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

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

Thanks for the PR ! It works great 👏

I have a few feedbacks, the major one is on the DB side.

I really think we should stay relational in Gladys and store this as a relation table :

t_tag_scene:
- scene_id uuid
- name text

It'll let you find existing tags pretty easily so you can display the existing tags in scene (otherwise, right now, the user can easily create duplicate tags)

On the UX, we should have a way to filter easily on the list of scene by tags (here again, you'll need a query to get all tags -> only possible in an efficient way with a relation table)

The general new UX of scene is really great and IMO users will love it !

Thanks for looking into this 😄

front/package.json Outdated Show resolved Hide resolved
front/src/routes/scene/edit-scene/Settings.jsx Outdated Show resolved Hide resolved
front/src/routes/scene/edit-scene/Settings.jsx Outdated Show resolved Hide resolved
front/src/routes/scene/edit-scene/Settings.jsx Outdated Show resolved Hide resolved
server/migrations/20230627154012-add-tag-scene.js Outdated Show resolved Hide resolved
@callemand
Copy link
Contributor Author

Thanks for the PR ! It works great 👏

I have a few feedbacks, the major one is on the DB side.

I really think we should stay relational in Gladys and store this as a relation table :

t_tag_scene:
- scene_id uuid
- name text

It'll let you find existing tags pretty easily so you can display the existing tags in scene (otherwise, right now, the user can easily create duplicate tags)

On the UX, we should have a way to filter easily on the list of scene by tags (here again, you'll need a query to get all tags -> only possible in an efficient way with a relation table)

The general new UX of scene is really great and IMO users will love it !

Thanks for looking into this 😄

I've try to implements the 't_tag_scene'. it's working but. Do I need to create a new api controller to get the tags ?
I need to get all the tags to display into the "react-select".

@Pierre-Gilles
Copy link
Contributor

Do I need to create a new api controller to get the tags ?

@callemand You can do it in the "scene" controller :)

Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

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

Thanks for this PR ! The UI is really great like that 👏

A few feedbacks on the UI side:

  • When I click outside of the tag select dropdown, it could be great to close the dropdown
  • The current behavior when I select multiple tags is to do a "AND", and when comparing with other software, I have the feeling that usually it's more a "OR" done on that. What do you think of switching to OR ?
Kapture.2023-11-06.at.10.05.22.mp4

I was able to create a super long tag and then it break the UI :D

Could we limit the tag length ?

Screenshot 2023-11-06 at 10 24 09

I have a few comments on the backend side (see comments in code)

Thanks for this PR 🙌

server/lib/scene/scene.get.js Outdated Show resolved Hide resolved
server/lib/scene/scene.get.js Outdated Show resolved Hide resolved
server/lib/scene/scene.get.js Outdated Show resolved Hide resolved
server/lib/scene/scene.update.js Outdated Show resolved Hide resolved
server/api/controllers/scene.controller.js Outdated Show resolved Hide resolved
Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, it's way better! 👏

A few feedbacks:

When I click on a tag, it's a bit weird I can only click on the "title" but on the full width so when titles are a bit longer it's weird to have to change where to click:

Kapture.2023-11-10.at.14.13.28.mp4

It seems were are looking "scene density" on the scene list.

Before:

Screenshot 2023-11-10 at 14 20 35

After:

Screenshot 2023-11-10 at 14 14 22

What about going back to 4 per width?

server/package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes!

For the click on the tags, it seems it's the same as before?

Kapture.2023-11-13.at.10.58.08.mp4

For the responsive, maybe on mobile we should hide the "Nouveau" text and just keep the "+" (like we do on some pages) ?

Screenshot 2023-11-13 at 10 56 54

And I'm wondering if we don't need a button "unselect all" at the top ?

Screenshot 2023-11-13 at 11 01 28

Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

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

All good for me! I just have one question on the cypress tests :)

And Eslint is not passing but it's just one line

After that I'm good to merge!

Edit: Little regression on the "new scene" view:

Before:

Screenshot 2023-11-16 at 10 10 55

After:

Screenshot 2023-11-16 at 10 10 49

front/cypress/e2e/routes/scene/Scene.cy.js Outdated Show resolved Hide resolved
front/cypress/e2e/routes/scene/Scene.cy.js Outdated Show resolved Hide resolved
Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

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

Good for me now! 👏

@Pierre-Gilles Pierre-Gilles merged commit 7c2854c into GladysAssistant:master Nov 20, 2023
9 checks passed
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