dreammall-earth / dreammall.earth

Dreammall.earth website & product page
https://dreammall-earth.github.io/dreammall.earth/
Apache License 2.0
7 stars 2 forks source link

refactor(frontend): always Open Tab Menu #2537

Closed ogerly closed 1 month ago

ogerly commented 1 month ago

🍰 Pullrequest

This PR modifies the TabControl component to keep the menu always open, addressing the issue of users not finding the cockpit option. The changes remove the auto-closing functionality while preserving the sliding animation between menu items.

Changes

TabControl.vue

  1. Removed isOpen ref and related logic
  2. Removed open() and closeWithDelay() functions
  3. Removed timer and related onUnmounted hook
  4. Modified setItem() function to handle only the sliding animation
  5. Simplified CSS by removing logic related to opening and closing
  6. Kept isSliding state to manage the sliding animation
  7. Removed click handler that was opening the menu
  8. Adjusted CSS to always show all items and keep the menu in its open state

TabControl.test.ts

  1. Removed vi.useFakeTimers() and vi.runAllTimers() calls
  2. Removed "click tab control button" describe block and nested tests
  3. Removed "set item with menu closed" test
  4. Removed "unmount" test checking for cleared timeouts
  5. Added new test "always shows all items" to ensure all menu items are visible
  6. Kept existing tests for setting active items based on routes and changing active item on click

Impact

Testing

https://github.com/user-attachments/assets/7cd7db3f-00b5-4ef9-848d-519ea0fb041c

Issues


This PR description was generated with the assistance of an AI language model.

ogerly commented 1 month ago

c, [02.10.24 11:21] Jo sauber für iPhone 15 und 16 muss die Leiste Ca. 25 px tiefer da oben im Telefon noch eine Leiste ist

c, [02.10.24 11:22] [ Photo ]

A, [02.10.24 11:22] Ok

c , [02.10.24 11:23] Insgesamt kann es für mobil auch ca. 25% kleiner

Bildschirmfoto vom 2024-10-02 11-41-37

sebastian2357 commented 1 month ago

In general I didn't check it in deep yet, but would it be possible to avoid the JS timers completely and only use CSS transitions? These are much easier to maintain.

ogerly commented 1 month ago

https://github.com/user-attachments/assets/9e7c2188-25ae-4b53-9cf4-83bdfc7fc2f6