Day 16: Improved Page Switching Mechanism

I reworked the navigation logic for switching between pages. Previously, the system used a hide/show mechanism for different page containers, which resulted in multiple JavaScript functions being loaded and triggered simultaneously.

This method created conflicts, especially in modules that relied on dynamic rendering, like time tracking and logs. The problem compounded as more features were added to the system.

To address this, I implemented a proper page redirection approach using actual window.location.href calls or link-based routing. This way, only the relevant script and page content would load at a time.

This change significantly reduced memory usage and minimized the number of functions that ran unnecessarily in the background. It also ensured that each page ran its own initialization scripts in isolation.

After implementing the redirection logic, I reviewed how user sessions and states were handled during navigation. I adjusted session storage and page load listeners accordingly to maintain a smooth and secure user experience.

Overall, this transition made navigation smoother and reduced JavaScript conflicts, especially on lower-end devices. It also aligned the project more closely with scalable, modular design principles.