mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 19:09:07 +00:00
727b5f3475
The jsGantt-improved library that renders Bonsai's Gantt chart already ships full support for an "Hour" granularity (column width, header labels in every bundled language, hour-aware rendering math). Bonsai's config only exposed Day/Week/Month/Quarter, with a comment claiming Hour caused browser issues even with vUseSingleCell enabled. Headless Chrome testing against the same library version shows that claim no longer holds once vUseSingleCell is active (as Bonsai already configures it at 10000): Hour-format charts render without errors from typical schedules up through fairly extreme ones (5000 tasks across a 3 year span rendered in about 2.4s). The failure mode the old comment described only reproduces with vUseSingleCell disabled, which is not how Bonsai runs it. Task start/finish times already flow through to the chart unmodified as raw ISO datetimes (tool/sequence.py create_new_task_json), so any schedule authored with real hour-level timestamps, for example an imported MS Project/P6/Excel schedule or one written directly through ifcopenshell-python, can now be viewed at hour granularity. Verified live with a night shift schedule crossing midnight, rendered correctly with no console errors. Note: Bonsai's own "Edit Task Time" UI currently always snaps ScheduleStart/ScheduleFinish to 09:00/17:00 regardless of the hour entered (ifcopenshell/api/sequence/edit_task_time.py), and work calendars only encode working days, not working hours. So authoring a genuine hour-precision schedule through that UI is still not possible; this change only unlocks viewing hour-level data that already exists in the model. Fixing the editor and calendar model is a separate, larger design decision for a maintainer. Addresses #2772. Generated with the assistance of an AI coding tool.