Skip to content

feat: add QOL features to optimization - #2

Open
Lolmerkat wants to merge 27 commits into
TheoFailenschmid:mainfrom
Lolmerkat:main
Open

feat: add QOL features to optimization#2
Lolmerkat wants to merge 27 commits into
TheoFailenschmid:mainfrom
Lolmerkat:main

Conversation

@Lolmerkat

Copy link
Copy Markdown
Contributor

This pull request introduces significant UI enhancements and new features to the application, focusing on improved file handling, module management, and the addition of an optimizer tool for schedule planning. The most notable changes include a new optimizer modal with interactive priority management, updates to import/export functionality, and various user interface improvements for better usability and flexibility.

New Optimizer Feature:

  • Added an "Optimizer" modal (modalOptimize) allowing users to prioritize preferences via drag-and-drop and calculate optimal schedules, with styled results and actions for applying the optimized result. (index.html [1] global.css [2]

File Import/Export Improvements:

  • Split the previous "Teilen / Laden" (Share/Load) button into separate "Exportieren" and "Laden" buttons, each with distinct icons and actions, improving clarity and usability for exporting and importing schedules. (index.html index.htmlL22-R38)
  • Enhanced the sidebar's dropzone to accept both XHTML and JSON files, supporting more flexible import options, and updated UI text accordingly. (index.html index.htmlL64-R89)

Module Sidebar Enhancements:

  • Added "expand all" and "collapse all" toggle buttons for module sections in the sidebar, making it easier to manage large numbers of modules. (index.html index.htmlR58-R72)
  • Introduced a color mode toggle (by module/type) and repositioned it for better accessibility. (index.html index.htmlR101-R111)

Styling and Layout Adjustments:

  • Updated global.css with new styles for the optimizer feature, priority lists, enhanced dropzone states, sidebar toggle buttons, and various UI elements to improve consistency and interactivity. (global.css global.cssR751-R1069)
  • Refined layout by setting body to height: 100vh and adding overflow: hidden for better viewport handling, and adjusted header flex behavior. (global.css [1] [2]

Split the monolithic 1903-line index.js into 13 focused modules under js/:
- constants.js: color palettes, day names, calendar config
- state.js: global mutable application state
- utils.js: pure utility functions (ID generation, time parsing, type detection)
- persistence.js: localStorage save/load
- conflicts.js: overlap detection and column layout
- calendar.js: weekly grid rendering
- sidebar.js: module list rendering
- actions.js: user interactions (toggle, remove, clear)
- modals.js: modal helpers, add-module/LV forms, keyboard shortcuts
- import.js: XHTML parser, file upload/drag-drop
- share.js: JSON/iCal export and import
- optimizer.js: schedule optimization engine and UI
- app.js: application bootstrap

Also removes duplicate nextId() and nextColor() declarations that existed
at lines 88-93 and 111-116 in the original file.
- Fixed typo where Lehrveranstaltung was abbreviated to 'LV' instead of 'VL' for Vorlesung
- Renamed functions, variables, CSS classes, DOM IDs, and German UI text
- Added migration to load() and import() to ensure existing localStorage payloads with .lvs arrays are properly mapped to .vls
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.

1 participant