Repository navigation
Calendar fixes: slow regexes, an event that won't open, and a resize error - #2089
Merged
Merged
Conversation
… long runs of "<"
…em reports no error The course home's week calendar redrew its table inside its ResizeObserver callback when its width crossed 640px, and the Coming up ticker started or stopped moving inside its own callback. Both changed the size of the element being watched while the observer was still reporting. When nothing else the page watches changed size in that frame, the browser fired "ResizeObserver loop completed with undelivered notifications": WebKit (Safari's engine) reports it as an uncaught error, and Chrome fires it at the page without logging it. A page that hides the week view and shows it again got the same error. WidthWatcher (js/announcement-calendar/width-watcher.js) keeps the width check in the callback and runs the redraw on the next animation frame, once. mountWeekView and CalendarTicker use it, and both cancel a redraw that hasn't run when they're unmounted.
… fast on text full of "<" Branch fix/calendar-tag-link-regex, head a22e0d5.
…from stopping its event from opening Branch fix/calendar-slack-placeholders, head 0fa22e1.
…bar from firing a ResizeObserver error Branch fix/week-view-resize-frame, head 07d5610.
This was referenced Nov 26, 2026
Closed
Closed
Contributor
Contributor
|
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.



This puts my three calendar PRs, #2079, #2083 and #2087, into one, since I had a lot of PRs open. They all change the calendar code, and #2083 was already stacked on #2079. I merged each branch in with
git merge --no-ffinstead of squashing, so the commits are the same ones those PRs had and each PR has its own merge commit. It doesn't need any other PR or a Spring change.From #2079: the ticker and the calendar page stay fast on text full of
<TAGincalendar-ticker.js.slackToHtmlon the calendar page (_projects/systems/calendar/index.md) turns<url|text>in a description into links.>. With no>after it, they read to the end again from every such place: every<forTAG, and every<http:for the link regex. Now a match also stops at the next<.x < y <b>bold</b>shows asx < y boldin the ticker (main showedx bold), and<https://a.b|x < y>isn't made a link. Slack writes that<as<, so links from Slack don't change.varchar(255), SQLite doesn't enforce that, and Spring's README says production is on SQLite right now.<http:alinks that never close took 5.4 s on main and 0.2 s on this branch, in one run today. In Chrome it took 2.0 s and 0.1 s.From #2083: a description that says
%%LK0%%doesn't stop its event from openingslackToHtmlformats a description, it replaces code and links with numbered placeholders (%%CB0%%,%%IC0%%,%%LK0%%), then puts them back. Any signed-in account can write a description, so it can have that text in it too.%%LK0%%with no link madeslackToHtmlthrow, so the event's window never opened, and Edit and Delete are only in that window.%%CB0%%or%%IC0%%turned into empty code. So didIC1between two links, like<https://a.b|x>IC1<https://c.d|y>, because the links' placeholders put%%on both sides of it, and then neither link showed.From #2087: resizing the week calendar or the Coming up bar doesn't fire a ResizeObserver error
WidthWatcher(width-watcher.js) redraws on the next animation frame instead, so the old layout shows for one frame (about 16 ms on a 60 Hz screen).Other notes:
%%LK0%%event didn't open and resizing fired the error. Here the event opened and resizing fired none. The screenshots are from that run.How to try it:
fix/calendar-fixesfromsvaka2000/Pages-JJ.node --test tests/calendar_ticker.test.mjs tests/calendar_slack_text.test.mjs tests/calendar_doc_links.test.mjs tests/calendar_safe_html.test.mjs tests/width_watcher.test.mjs tests/week_row_tools.test.mjs. It passes in under a second.