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

Feature/needs page #79

Merged
merged 62 commits into from
Dec 13, 2024
Merged

Feature/needs page #79

merged 62 commits into from
Dec 13, 2024

Conversation

maxitect
Copy link
Collaborator

@maxitect maxitect commented Dec 13, 2024

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Styling
  • Build
  • Chore

Description

Summary

This pull request introduces a fully function needs tab with all database connections! And a working next actions page with no interaction (but filtered next actions).

Updates

  • Generic Components Refactoring:

    • Converted NeedsSection.tsx and NeedsDisplay.tsx into generic Section.tsx and Display.tsx components for reusability.
    • Updated the generic Display.tsx component to support extensions, enabling modular functionality for needs and next actions pages.
  • Needs and Next Actions Enhancements:

    • Adapted needs and next actions pages to utilize the generic Display.tsx component.
    • Introduced highlighting and filtering for needs and next actions based on expiry dates and moods.
    • Implemented navigation fixes for /next-actions route in NeedsDisplay.tsx.
  • Database Integration:

    • Updated DatabaseManager.ts with generic types and improved methods for handling nested objects and JSON access.
    • Optimized priority keys in the needs schema as objects with order and name attributes and aligned seed data.
    • Added updates to database logic for dynamically managing moods, expiry dates, and selected timestamps when interacting with needs.
  • State Management and Performance:

    • Refactored state handling in Display.tsx to optimize performance and simplify interactions.
    • Enhanced button state management and conditional rendering for dynamic user interactions.
  • Accessibility and Styling:

    • Added custom Tailwind classes for glow shadows and mood-specific colors.
    • Applied conditional color highlighting for needs items based on mood in Section.tsx.
    • Updated NeedsModal.tsx with aria-labels on buttons for improved accessibility.
    • Added a disabled state to Button.tsx for better user feedback.
  • Code Cleanup and Testing:

    • Removed unused and superseded files, including obsolete generic display components.
    • Added comprehensive test files for:
      • NeedsDisplay.tsx
      • NeedsModal.tsx
      • Section.tsx
    • Resolved ESLint errors across updated components for better code quality.
  • Merges:

Key Features

  • Combined needs display functionality with database updates for mood, expiry, and highlighting.
  • Extended support for aria-compliant modals and buttons to meet accessibility standards.
  • Streamlined navigation and filtering for next actions, improving user flow.

These updates deliver a scalable, maintainable, and user-friendly application architecture while enhancing performance, usability, and accessibility.

Screenshots

Screen Shot 2024-12-13 at 18 43 05

Screen Shot 2024-12-13 at 18 43 10

Screen Shot 2024-12-13 at 18 43 13

Screen Shot 2024-12-13 at 18 43 16

Screen Shot 2024-12-13 at 18 43 38

Screen Shot 2024-12-13 at 18 43 47

Screen Shot 2024-12-13 at 19 04 39

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Semantic HTML implemented?
  • Checked with axe DevTools and addressed Critical and Serious issues?
  • Color contrast tested?

Added/updated tests?

Please aim to keep the code coverage percentage at 80% and above.

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

Delete branch after merge?

  • Yes
  • No

What gif best describes this PR or how it makes you feel?

beermebra

Copy link

netlify bot commented Dec 13, 2024

Deploy Preview for thingswedo ready!

Name Link
🔨 Latest commit 9c0d3a5
🔍 Latest deploy log https://app.netlify.com/sites/thingswedo/deploys/675cb5f93fb23e0008cffd89
😎 Deploy Preview https://deploy-preview-79--thingswedo.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 site configuration.

className={clsx(
"fixed right-4 bottom-24 text-white rounded",
hasHighlightedNeeds
? "bg-twd-primary-purple shadow-twd-primary-purple shadow-glow"
Copy link
Collaborator

Choose a reason for hiding this comment

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

pls remove the glow, apart from the toolkit navbar button, no buttons in the app should have the glow

className={clsx(
"fixed right-4 bottom-24 text-white rounded",
hasHighlightedNeeds
? "bg-twd-primary-purple shadow-twd-primary-purple shadow-glow"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
? "bg-twd-primary-purple shadow-twd-primary-purple shadow-glow"
? "bg-twd-primary-purple shadow-twd-primary-purple"

@jackcasstlesjones jackcasstlesjones merged commit e1418d8 into main Dec 13, 2024
5 checks passed
@jackcasstlesjones jackcasstlesjones deleted the feature/needs-page branch December 13, 2024 22:35
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