Add changes for Estimated Time to complete#38
Open
becdavid wants to merge 9 commits into
Open
Conversation
- Updated normalizeOutlineBlocks to extract effort_time and estimated_time (HH:MM:SS) from course blocks. - Added hydrateMissingOutlineEffort to calculate effort by summing the effort times of child units when missing. - Integrated showEstimatedTime course-level flag into the normalized course model. - Added time-string parsing to convert HH:MM:SS into raw seconds for consistent frontend calculations.
- Added estimated-time display logic to section and sequence outline rows, using effortTime when available and falling back to unit-level estimated time data when needed. - Passed the showEstimatedTime flag through the outline component tree so course-level settings can suppress estimated time rendering. - Updated SectionTitle and SequenceTitle to render compact minute labels next to titles. - Reused the same estimated-time formatting pattern across Section.tsx, SectionTitle.tsx, SequenceLink.tsx, and SequenceTitle.tsx for consistent outline presentation.
- Calculated total estimated course time from section and sequence effort data. - Rendered a course-level estimated time label next to the outline title when enabled. - Passed the showEstimatedTime flag through to the section outline slot so downstream rows can respect the course setting.
- Added strings for estimated time labels in the course outline header, sections, and sequences. - Introduced minute/hour formatting for outline time estimates.
- Added estimated-time labels to sidebar section, sequence, and unit rows. - Resolved effort time from outline data and fell back to unit-level estimated time where needed. - Passed the showEstimatedTime flag through the sidebar outline tree so course-level settings can hide the estimates. - Kept the new labels consistent with the existing sidebar outline layout.
- Added inline commenting to SidebarSection.jsx, SidebarSequence.jsx, and SidebarUnit.jsx.
…ydration - Updated CourseOutlineTray.jsx to pass showOutlineEstimatedTime through section and sequence sidebar components. - Enhanced hooks.jsx to expose showOutlineEstimatedTime, surface model fallback data, and trigger one-time effort hydration after outline load. - Added compact estimated-time localization in messages.ts for consistent sidebar time labels.
- Updated normalizeLearningSequencesData, normalizeSequenceMetadata, and normalizeOutlineBlocks to persist effort metadata. - Added fallback conversion from estimated_time_minutes to seconds when effort_time is missing for consistent unit calculations. - Extended models to include course-level showEstimatedTime and course block structure for downstream rendering. - Added hydrateOutlineEffortData thunk to fetch sequence metadata and backfill missing unit and sequence effort values.
- Updated CourseHomeSectionOutlineSlot to propagate showOutlineEstimatedTime into section rendering. - Enhanced UnitTitleSlot to show an "Estimated Time to Complete" label under the unit title, with proper hour/minute formatting. - Expanded UnitTitleSlot unit prop typing to include estimatedTimeMinutes and showOutlineEstimatedTime for downstream consumption.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.