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

LF-4474 [Nice to have] convert create task button to CTA floating button #3540

Open
wants to merge 9 commits into
base: integration
Choose a base branch
from

Conversation

kathyavini
Copy link
Collaborator

@kathyavini kathyavini commented Nov 20, 2024

Description

This PR removes the "+ Create a task" text link on TaskPage and moves that functionality to a FloatingActionButton. There was also a check for locations and a creation location modal tucked into the <TaskCount /> component that were lifted up to the parent <TaskPage />. This was by necessity, but I think it's also more logical; I was personally surprised to find that logic co-located with the count display!

Jira link: https://lite-farm.atlassian.net/browse/LF-4474

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The precommit and linting ran successfully
  • I have added or updated language tags for text that's part of the UI
  • I have added "MISSING" for all new language tags to languages I don't speak
  • I have added the GNU General Public License to all new files

@kathyavini kathyavini added the enhancement New feature or request label Nov 20, 2024
@kathyavini kathyavini self-assigned this Nov 20, 2024
@kathyavini kathyavini requested review from a team as code owners November 20, 2024 01:28
@kathyavini kathyavini requested review from antsgar and Duncan-Brain and removed request for a team November 20, 2024 01:28
antsgar
antsgar previously approved these changes Nov 20, 2024
Copy link
Collaborator

@antsgar antsgar left a comment

Choose a reason for hiding this comment

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

A small change but makes such a difference! Love it ☺️

position: fixed;
bottom: 16px;
right: 16px;
z-index: 100;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we should set a z-index on the floating button component itself since it's supposed to always float over everything else?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That makes sense to me. Do you think the positioning CSS should even be controlled by a prop on the component if we're using it so often in this corner? 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh yes, that's a really good idea!

</Layout>

<div className={styles.buttonWrapper}>
<FloatingActionButton type={'add'} onClick={handleAddTask} />
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you brought this up before, but do we want the button to trigger the action directly, or to open the floating menu like we're doing with Animals? It does make sense to just trigger the action if there's only one option, but we could double check with Loïc (if we haven't) and if this is the way make it consistent in Animals as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for bring it up! As discussed with Loïc today, I'll make them both one-click (no menu).

@Duncan-Brain
Copy link
Collaborator

Looks like the position is maybe different on animals or something? Only other thing is it would be good to keep the "Add a task" translated text for screen readers and hover or something as discussed in design.

Screenshot 2024-11-20 at 11 12 30 AM
Screenshot 2024-11-20 at 11 12 42 AM

@kathyavini
Copy link
Collaborator Author

kathyavini commented Nov 20, 2024

@Duncan-Brain that's a great idea about the screen readers! I kept the string deletion in one commit just in case it had to be reverted 😉

I'm not sure what you're seeing with the positioning though hmm 🤔 For me if I switch between task and inventory the button doesn't move at all (which should be as expected; I took the positioning CSS from FloatingMenuButton). Can you check you're definitely on the base branch, updated version?

Edit: actually could it be a scrollbar situation? Could scrollbars being present shift what is considered the edge of the screen?? I guess both of your screens have scrollbars though. Stumped!

@Duncan-Brain
Copy link
Collaborator

Duncan-Brain commented Nov 20, 2024

@kathyavini I am only seeing the FAB hug the scrollbar on tablet like sizes where the thick scrollbar is present. I also tried choosing tablet devices like ipad Pro and saw they had thick scrollbars vs ipad Mini and cell phones which have thin scrollbars.

Core difference seems to be FAB in inventory is part of table vs app wrapper. It looks like FAB should be moved up one in inventory the hierarchy to match / avoid scrollbar issues.

EDIT: Meant to say it is not a blocker for me for position since task seems correct

@kathyavini
Copy link
Collaborator Author

@Duncan-Brain interesting, I can't even reproduce at tablet widths. I just updated the component in inventory as we are no longer using the menu. Does it make any difference?

Duncan-Brain
Duncan-Brain previously approved these changes Nov 21, 2024
Copy link
Collaborator

@Duncan-Brain Duncan-Brain left a comment

Choose a reason for hiding this comment

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

No.. same issue -- I think it need to be moved up one spot in the html element hierarchy.

Aria label looks good thanks for adding it to inventory too!

@kathyavini kathyavini changed the title LF4474 Nice to have convert create task button to CTA floating button LF-4474 [Nice to have] convert create task button to CTA floating button Nov 25, 2024
@antsgar antsgar self-requested a review November 25, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants