Skip to content

BugFix: Fixing Issue #10 - #11

Open
KritMukul wants to merge 2 commits into
MicrosoftStudentChapter:mainfrom
KritMukul:main
Open

BugFix: Fixing Issue #10#11
KritMukul wants to merge 2 commits into
MicrosoftStudentChapter:mainfrom
KritMukul:main

Conversation

@KritMukul

Copy link
Copy Markdown

This change fixes the Issue #10 by temporarily hiding the reset button when exporting the timetable so that it doesn't appear in the export.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Issue #10 by preventing the floating Reset/Save/Peek fixed-position FAB controls from appearing in exported timetable images/PDFs on mobile during the html-to-image capture step.

Changes:

  • Adds an export-mode CSS rule intended to hide the floating FAB group during export.
  • Toggles the tt-exporting class on document.body during capture to enable global export-only styling.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/pages/TimetablePage.css Adds an export-mode rule to hide the floating FAB group during capture.
src/lib/export_timetable.js Adds/removes tt-exporting on document.body during capture.
Comments suppressed due to low confidence (1)

src/lib/export_timetable.js:171

  • Same as above: removing the body-level class toggle avoids global state changes during export. If you keep the body class approach, it should be reference-counted to behave correctly when the PNG and PDF exports are triggered concurrently (each dropdown has its own busy state).
    activeCols.forEach((el) => el.classList.add('tt-col-active'))
    node.classList.remove(EXPORTING_CLASS)
    document.body.classList.remove(EXPORTING_CLASS)
    node.removeAttribute('data-theme')

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1230 to +1235
/* Hide the fixed-position Reset/Save/Peek FAB group while capturing.
These buttons use position:fixed so they sit outside .tt-export-target
yet still appear in the rasterised snapshot on mobile. The body-level
tt-exporting class (set by export_timetable.js) lets us target them
globally without touching the component. */
body.tt-exporting .tt-save-fab-group { display: none !important; }
Comment on lines 121 to 124
}
node.classList.add(EXPORTING_CLASS)
document.body.classList.add(EXPORTING_CLASS)

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.

2 participants