Repository navigation
feat: catch up on the Following log after time away - #1043
Open
ashkesarmaa wants to merge 1 commit into
Open
ashkesarmaa wants to merge 1 commit into
ashkesarmaa wants to merge 1 commit into
Conversation
Opening Following after at least two days away now starts with the most starred commits that people you follow made since the newest one you saw, with how many came in from how many people. It stays until you're caught up, then folds into a line you can bring back or hide for that visit.
|
@ashkesarmaa This needs a rebase first: show.tsx, ShowLogRequest, bootstrap/app.php, LogControllerTest and KNOWLEDGE_BASE no longer apply after #1099 removed newCommitsCount and #1103/#1108 reworked the reading-position code. Two things on the design: the following_seen_at cookie is a second "newest seen" marker next to useLastVisit's localStorage one, and they advance on different rules, with the cookie per browser rather than per user, so the "where you left off" line and the catch-up can disagree. Could they share one write? And if the reader never presses "I'm caught up", the cookie never moves and the catch-up returns on every Following visit for a week; if that's intended, worth saying in the knowledge base, since it will feel sticky. |
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.
Summary
After a few days away, the Following log greets you with everything newest first. The commits people actually cared about while you were gone are buried somewhere in there, so you either scroll through all of it or miss them.
Now, when you open Following after at least two days away, the log starts with a catch-up:
$ git log --since="Tue, Oct 20", then While you were away, 9 commits came in from 7 people you follow. The most starred:caught up · 9 commits since Tue, Oct 20, with Show again and an × to hide the line too.Changes
CatchUpQueryreusesFollowingLogQuery's builder, so visibility, blocks, mutes, pending commits and star counts all come from the same place as the log. It ranks by stars, then recency.LogControlleradds a lazycatchUpprop for the Following log only. Polls and infinite scroll use partial reloads, so they never compute it.following_seen_atcookie, and only moves it forward while there's nothing to catch up on, or once you're caught up. It's a cookie rather than thelocalStorageentry behind the last-visit marker because the server needs it on the very first load: the catch-up is rendered with the page, so there's no extra request and no layout shift. Likewho_to_followandreplies_per_page, it's a plain cookie the page writes, so it's excluded from encryption.ShowLogRequest::followingSeenAt()only accepts the exact timestamp format the page writes.CatchUpcomponent reuses the search dialog'sCommitResultrow (now exported), the stagedRailSegment(with its own view-transition name),Button,ActionTooltip, and the number and day-label helpers.CommitFeedgets a smallleadslot that renders above the first commit, on the rail that hangs from the composer.Validation
vendor/bin/pest --parallel --ci --coverage --exactly=100.0: 4,046 passed.CatchUpQuery,ShowLogRequestandLogControllerare at 100%. Locally the overall gate came in under 100% only for files this PR doesn't touch, because this machine runs PHP withzend.assertions=-1, which compilesassert()lines away; with assertions on, as in CI, those files read 100%.vendor/bin/pest --type-coverage --min=100: 100%.bun run test:unit: 128 passed.tests/Feature/Controllers/LogControllerTest.php: 75 passed, including 12 new catch-up tests: ranking and counts, own commits, replies and older commits left out, the two-day gate (exactly two days, one day, never seen, relative or unreadable cookie), the one-week limit, no more than three commits, up to six listed, mutes, blocks and pending commits, other logs and guests, and polls leaving it out.bun run test:lintandbun run test:types: pass.vendor/bin/pint --test: pass. Rector on the changed files: pass.EmbedKnowledgeBaseCommand.php,StressSeeder.php).Visual evidence
Local data: fictional followed accounts without avatars (so initials show), with seeded commits and stars. "Before" is the same Following log with nothing to catch up on, which is what production shows today.
Before
After: catch-up at the top of Following
Show 3 more
I'm caught up
Layout shift on load: 0 at 390×844 and 820×1180. At 1440×900 it's 0.0035 both with and without the catch-up, so it comes from something already on the page.
Device verification
Chromium emulation at 390×844, 820×1180 and 1440×900 in light and dark, plus desktop Chromium on Ubuntu. Not tested on mobile hardware. The catch-up has no inputs, so the on-screen keyboard doesn't apply. On phones the folded line drops the date to fit, and the full text is in its title.
Independent review
Separate read-only review of base
f64c78fagainst this branch, repeated after its findings were addressed: CODE: PASS, VISUAL: PASS. It led to stricter cookie parsing with tests for relative and unreadable values, the two-day boundary and poll tests, the staged-rail view-transition name, and a comment tying the preview count to the query's gate. The points under Limitations were accepted as intended behavior.Limitations