Repository navigation
feat(properties)!: date rows read as relative time, worked out in the reader's browser - #453
Conversation
…wser comark-time exports describeTime() and relativize(), and its default threshold is now 3w with English words unless locale says otherwise. comark-properties writes date and ISO instant rows in comark-time's markup with the date and year as server text, and the script after the box rewrites them against the reader's clock.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Important
Cached refresh discards explicit time settings, and Vue/React property dates stop updating when the box is created or replaced after mount. These should be addressed before merging.
Reviewed changes — Reviewed the shared date-description extraction, browser refresh lifecycle, property-date integration, renderer exports, and accompanying documentation and tests.
- Shared date descriptions: Adds
describeTime()and changes the default threshold to3wand default language to English. - Browser refresh: Adds
relativize()with immediate, visibility-change, and minute updates, plus shared tooltip runtime support. - Property dates: Supports ISO instants, provides absolute server-rendered fallbacks, and integrates relative labels and tooltips across HTML, Vue, React, and Svelte.
- Public contracts and coverage: Updates dependencies, CSP script exports, documentation, skills, and date/browser tests.
Validation: all 67 time/properties unit and framework tests and all 11 related Playwright tests passed. Additional Chromium reproductions confirmed the findings below. The existing CI check failure was also reproduced: time Doctor reports four strict-TypeScript warnings in describe.ts.
gpt-6.1-sol(xhigh) | 𝕏
Latest result PR closed or outside the configured filter. Final answersSession PR closed or outside the configured filter. Session Pushed f05bed2 to fix Doctor’s missing assertion safety explanation. Doctor now reports zero warnings, the focused editor regression passes, and lint passes with four existing warnings. All supplied review findings are resolved; awaiting hosted checks and automated review. Session Pull request evidence changed. Session Pull request evidence changed. Session Pull request evidence changed. Session Pull request evidence changed. Session Pull request evidence changed. Session Pull request evidence changed. |
There was a problem hiding this comment.
Important
The new random tooltip IDs make dated documents open read-only in the editor. Their generation also throws on non-secure HTTP browser origins.
Reviewed changes — Reviewed the fixes since the previous Pullfrog review, focusing on refresh-policy preservation, component lifecycle, and tooltip identity.
- Retained refresh policy: Preserved configured locale and effective threshold through normalization, all four renderers, and browser refresh.
- Rebound component runtimes: Restarted the React and Vue property runtime after updates, with coverage for empty and replacement boxes, minute ticks, styles, and Escape.
- Separated tooltip identities: Rebuilt rows per explicit box and replaced date-derived IDs with UUIDs to distinguish repeated boxes and separate documents.
- Expanded regression coverage: Added browser policy/lifecycle tests, updated renderer assertions and documentation, and addressed the time package's strict diagnostics.
Validation: all 68 focused unit/framework tests and all 16 related Chromium tests passed. The current CI failure in the editor's properties-review and skill report examples matches the P1 finding below; an independent public-API reproduction confirmed it.
gpt-6.1-sol(xhigh) | 𝕏
There was a problem hiding this comment.
✅ No new issues found; no P0 or P1 findings remain.
Reviewed changes — Reviewed the fixes in b84f6cf since the previous Pullfrog review at 8cd6fb0.
- Preserved editor equality: Canonicalized paired property tooltip IDs during semantic comparison while retaining unique IDs in rendered documents.
- Restored HTTP support: Replaced secure-context-only UUID generation with
crypto.getRandomValues()for property date rows. - Added regression coverage: Added dated-document editability and insecure-HTTP browser tests; verified repeated boxes still render unique, correctly referenced tooltips.
Validation: the workspace build, all 248 focused unit/framework/editor tests, and all 17 related Chromium tests passed, including the two previously failing editor examples. The remaining HTTP review thread was verified and resolved.
gpt-6.1-sol(xhigh) | 𝕏
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
…'s thread card, relative times, shared copy buttons, a doc header that copies at once, who dropped it, the folder's drops, and comark's side outline (#228) * chore(deps): run on ViteHub main 69dde88 and comark-ui main af08c87, with the open fixes as patches ViteHub's main renamed the backend keys, so the D1 database and the Cloudflare and memory Realtime use `driver: "cloudflare"` / `"memory"`, and Vercel Blob is `driver: "vercel"`. The fixes still open upstream ride along as patches built from their heads on the pinned main: vite-hub/vitehub#4785 and #4788 in @vite-hub/ui, #4794 in @vite-hub/comments, onmax/comark-ui#453 in comark-time and comark-properties. ViteHub Content now renders with the same comark-ui as Drop, so one copy carries the patches. * fix(viewer): one frame around a new comment, ViteHub's sm thread card, a crisp +, and each person once in the toolbar The new-comment bubble is the box's frame, so the box passes `frame="none"` and the bubble shows the focus: the bordered one takes the accented border, the shadow-ring one a 22% ring (Drop comment #14). The dock's box and thread pass `size="sm"`, which brings the reply field, the 14px rows and the image shape from ViteHub, so the copies of those styles go (Drop comments #2, #7). The + of the pill is an inline SVG snapped to whole pixels while closed (Drop comment #13). The comments toolbar on Drop's own pages leaves out its faces and cursors, since the review dock already shows who's here (Drop comment #11). The frame's pop-out timing comes from ViteHub's `commentLeaveMs`. * feat: times and copy buttons come from ViteHub, and the doc's Updated row reads relative `TimeAgo` goes for ViteHub's `RelativeTime`: relative under 3 weeks, then the date, with the full date in a tooltip, short words in the lists. app.vue gives it Drop's one clock, so the words and Drop's countdowns move together (Drop comment #10). The copy buttons are ViteHub's `CopyButton`, whose icons cross-fade both ways, on Drop's 1.4 s (`DropCopyButton`); Drop's `icon-in` animation goes (Drop comments #6, #12). The Updated row writes the version's full instant in comark-time's markup, and a box that had no date of its own now gets the relative-dates script too. The CSP allows comark-properties' `scripts` as they are, and the markdown cache integrity moves to drop.24. * fix: load the icon swap with every copy button, keep the Updated row's render stable, and follow ViteHub's renamed drivers in tests The parts' stylesheet loads only with the viewer, so DropCopyButton brings @vite-hub/ui/icon-swap.css itself. The Updated row's tooltip id comes from the version's time instead of a random one, so a warm render matches a cold one. The blob and rate limit tests use the `cloudflare` and `memory` drivers, and the area test checks ViteHub's grey saved areas (Drop comment #1). * chore(deps): move to ViteHub main 20ab822, where #4788 and #4794 landed, and comark-ui main a410d81 vite-hub/vitehub#4788 (the 130 ms pop-out and commentLeaveMs) and #4794 (overlay presence: false, one face per person) merged, so their patches go and @vite-hub/comments runs unpatched. The @vite-hub/ui patch now carries #4785 alone, built on 20ab822. comark-properties' patch follows #453's latest head. comark-ui's pin is #456's head, the same tree as its main. * test(viewer): give the guest lookup composer test 30 s, as its siblings have, since it starts two Vite servers and a browser * chore(deps): move to comark-ui 5ed5886, where #453, #456 and #457 landed, and drop the comark-time and comark-properties patches 5ed5886 is #458's head, the newest commit pkg.pr.new published; its packages match main 1ef8c09, since pkg.pr.new skips pushes to main. * fix(viewer): comments reach Comark's zoom, now a modal dialog, and an Escape a popover takes stays in the page comark-ui#457 opens the zoom with showModal(), which made Drop's comment layer inert: no pin could land on a zoomed screenshot. The layer moves into the dialog while it's open, hides the page's own marks there, and returns on close. * feat(doc): Copy writes from the doc's frame, Dropped by shows the person and their agent, and the folder opens a list of its drops The header's Copy is built once and toggles data-copied and data-pending with ViteHub's icon swap, so a press is never lost to a rebuild. Its Markdown loads once per version when the pointer or focus reaches it (doc-intent), and the click writes it in the frame; it says Markdown copied, or Couldn't copy in the frame, and reports a refusal to the client-error log. The shortcut and menus copy the same text, and show on the button too. Dropped by reads [avatar] Max · [logo] Claude Code, with what it came through, the model and the reasoning level on hover (dropDetail now carries owner). Signed-in readers get the folder's newest drops in a popover (GET /api/drops?folder=&limit=). The save menu and the folder list are native popovers placed with anchor positioning. * test(nodes): a folder lists its newest few with limit, and a drop's detail says whose it is * fix(doc): Dropped by's pictures and the folder button keep the facts' row height * chore(doc): keep the folder row's type private, as knip asks * chore(deps): RelativeTime's length prop is format, from vite-hub/vitehub#4785 at 4aab7d9c style would be the native attribute in a template, so style="short" never reached the prop. The patch takes the rename (prop, RelativeTimeFormat) and Drop's lists pass format="short". * ci: install Playwright's Firefox for the Firefox browser tests * test(doc): wait for the popovers' toggle event before reading aria-expanded and focus * fix(ui): textareas grow with field-sizing: content, so the Nuxt UI autoresize patch goes * feat(doc): the outline is comark-outline's side outline, which follows the section being read and reaches the bottom (Drop comment #5) * fix(drops): Yesterday and This week start at midnight on a day with a daylight-saving change * fix(review): review.js writes thread times with Intl.RelativeTimeFormat * docs(agents): the browser support floor and the native-first rule * chore(deps): move to ViteHub main ccf6574, where #4785 landed, and drop the @vite-hub/ui patch * fix: the doc header's folder list follows a moved doc, and Marker ink drawn on a zoom stays visible while the comment is written * fix: Marker ink kept on a zoom shows only on the screenshot it was drawn on * fix: kept Marker ink comes back with its own screenshot in the zoom, keyed by the zoomed element * fix: only signed-in readers see whose doc it is; a public link doesn't name the person who shared it * fix: Copy prompt uses Drop's copy button, so its check animates like every other copy
* chore(deps): run on ViteHub main 69dde88 and comark-ui main af08c87, with the open fixes as patches ViteHub's main renamed the backend keys, so the D1 database and the Cloudflare and memory Realtime use `driver: "cloudflare"` / `"memory"`, and Vercel Blob is `driver: "vercel"`. The fixes still open upstream ride along as patches built from their heads on the pinned main: vite-hub/vitehub#4785 and #4788 in @vite-hub/ui, #4794 in @vite-hub/comments, onmax/comark-ui#453 in comark-time and comark-properties. ViteHub Content now renders with the same comark-ui as Drop, so one copy carries the patches. * fix(viewer): one frame around a new comment, ViteHub's sm thread card, a crisp +, and each person once in the toolbar The new-comment bubble is the box's frame, so the box passes `frame="none"` and the bubble shows the focus: the bordered one takes the accented border, the shadow-ring one a 22% ring (Drop comment #14). The dock's box and thread pass `size="sm"`, which brings the reply field, the 14px rows and the image shape from ViteHub, so the copies of those styles go (Drop comments #2, #7). The + of the pill is an inline SVG snapped to whole pixels while closed (Drop comment #13). The comments toolbar on Drop's own pages leaves out its faces and cursors, since the review dock already shows who's here (Drop comment #11). The frame's pop-out timing comes from ViteHub's `commentLeaveMs`. * feat: times and copy buttons come from ViteHub, and the doc's Updated row reads relative `TimeAgo` goes for ViteHub's `RelativeTime`: relative under 3 weeks, then the date, with the full date in a tooltip, short words in the lists. app.vue gives it Drop's one clock, so the words and Drop's countdowns move together (Drop comment #10). The copy buttons are ViteHub's `CopyButton`, whose icons cross-fade both ways, on Drop's 1.4 s (`DropCopyButton`); Drop's `icon-in` animation goes (Drop comments #6, #12). The Updated row writes the version's full instant in comark-time's markup, and a box that had no date of its own now gets the relative-dates script too. The CSP allows comark-properties' `scripts` as they are, and the markdown cache integrity moves to drop.24. * fix: load the icon swap with every copy button, keep the Updated row's render stable, and follow ViteHub's renamed drivers in tests The parts' stylesheet loads only with the viewer, so DropCopyButton brings @vite-hub/ui/icon-swap.css itself. The Updated row's tooltip id comes from the version's time instead of a random one, so a warm render matches a cold one. The blob and rate limit tests use the `cloudflare` and `memory` drivers, and the area test checks ViteHub's grey saved areas (Drop comment #1). * chore(deps): move to ViteHub main 20ab822, where #4788 and #4794 landed, and comark-ui main a410d81 vite-hub/vitehub#4788 (the 130 ms pop-out and commentLeaveMs) and #4794 (overlay presence: false, one face per person) merged, so their patches go and @vite-hub/comments runs unpatched. The @vite-hub/ui patch now carries #4785 alone, built on 20ab822. comark-properties' patch follows #453's latest head. comark-ui's pin is #456's head, the same tree as its main. * test(viewer): give the guest lookup composer test 30 s, as its siblings have, since it starts two Vite servers and a browser * chore(deps): move to comark-ui 5ed5886, where #453, #456 and #457 landed, and drop the comark-time and comark-properties patches 5ed5886 is #458's head, the newest commit pkg.pr.new published; its packages match main 1ef8c09, since pkg.pr.new skips pushes to main. * fix(viewer): comments reach Comark's zoom, now a modal dialog, and an Escape a popover takes stays in the page comark-ui#457 opens the zoom with showModal(), which made Drop's comment layer inert: no pin could land on a zoomed screenshot. The layer moves into the dialog while it's open, hides the page's own marks there, and returns on close. * feat(doc): Copy writes from the doc's frame, Dropped by shows the person and their agent, and the folder opens a list of its drops The header's Copy is built once and toggles data-copied and data-pending with ViteHub's icon swap, so a press is never lost to a rebuild. Its Markdown loads once per version when the pointer or focus reaches it (doc-intent), and the click writes it in the frame; it says Markdown copied, or Couldn't copy in the frame, and reports a refusal to the client-error log. The shortcut and menus copy the same text, and show on the button too. Dropped by reads [avatar] Max · [logo] Claude Code, with what it came through, the model and the reasoning level on hover (dropDetail now carries owner). Signed-in readers get the folder's newest drops in a popover (GET /api/drops?folder=&limit=). The save menu and the folder list are native popovers placed with anchor positioning. * test(nodes): a folder lists its newest few with limit, and a drop's detail says whose it is * fix(doc): Dropped by's pictures and the folder button keep the facts' row height * chore(doc): keep the folder row's type private, as knip asks * chore(deps): RelativeTime's length prop is format, from vite-hub/vitehub#4785 at 4aab7d9c style would be the native attribute in a template, so style="short" never reached the prop. The patch takes the rename (prop, RelativeTimeFormat) and Drop's lists pass format="short". * ci: install Playwright's Firefox for the Firefox browser tests * test(doc): wait for the popovers' toggle event before reading aria-expanded and focus * fix(ui): textareas grow with field-sizing: content, so the Nuxt UI autoresize patch goes * feat(doc): the outline is comark-outline's side outline, which follows the section being read and reaches the bottom (Drop comment #5) * fix(drops): Yesterday and This week start at midnight on a day with a daylight-saving change * fix(review): review.js writes thread times with Intl.RelativeTimeFormat * docs(agents): the browser support floor and the native-first rule * chore(deps): move to ViteHub main ccf6574, where #4785 landed, and drop the @vite-hub/ui patch * fix: the doc header's folder list follows a moved doc, and Marker ink drawn on a zoom stays visible while the comment is written * fix: Marker ink kept on a zoom shows only on the screenshot it was drawn on * fix: kept Marker ink comes back with its own screenshot in the zoom, keyed by the zoomed element * fix: swap the copy icons without @vite-hub/ui/icon-swap.css vite-hub/vitehub#4917 removes icon-swap.css. DropCopyButton keeps vite-hub/ui's CopyButton, which swaps its icon with SwapIcon, and the doc header frame draws its own cross-fade. Pins every @vite-hub package to that branch's preview. * Fix formatting for the copy icon swap * Load the real copy icon stylesheet in viewer tests --------- Co-authored-by: vite-hub[bot] <320448255+vite-hub[bot]@users.noreply.github.com>

The properties box shows a front matter
dateas "Nov 2, 2026" and never as "2 days ago", and a full ISO instant such as2026-09-04T09:30:00Zisn't read as a date at all:day()buildsnew Date(${text}T00:00:00Z), so the row shows the raw string. comark-time already does relative-then-absolute with a tooltip, but only while parsing, so a host that caches renders (Drop keeps one for 30 days) would freeze the words. That's why Drop turns:timeoff.This PR moves comark-time's date logic into an exported
describeTime(at, { now, threshold, locale, timeZone, style }), which returns{ datetime, mode, label, tip }, and addsrelativize(root)tocomark-time/client. It rewrites everytime[datetime]underrootagainst the reader's clock, once at load, onvisibilitychange, and once a minute while the tab is visible. Both are self-contained, so an HTML renderer can inline them.comark-properties now writes date rows in comark-time's markup (
.ctm, the.ctm-tippill with its delays and reduced-motion path) and accepts dates and instants. The server text is the date with its year in UTC ("Nov 2, 2026", full date in the tooltip). It reads right in any cached copy, and a page without JavaScript still makes sense. The inlined script right after the box swaps in "2 days ago" before the page paints, so there's no flash of stale words. The Vue, React and Svelte boxes do the same once mounted.What changes for users:
4wto3w: relative while within 3 weeks (20 days is "2 weeks ago", 21 days is "Oct 14").localestill picks another language. Before, comark-time used the runtime's locale and the properties box was rewritten in the reader's.scriptsnow lists two scripts: the relativize one, and comark-time's Escape one.localizeDatesis gone fromcomark-properties/client.start(box)andrelativizereplace it.Tests cover
describeTimeacross the switch (20, 21 and 22 days, another year), instant vs date-only input, the zone of the tooltip, and the properties box markup. Playwright covers a cached render read later (Chromium, fake clock), the minute tick andvisibilitychange, the no-JS text, and the Svelte box.vp testfor time, properties, ui and lint passes.pnpm checklint andtsrspass.Before/after (Chromium and Firefox, tooltip open): https://drop.vitehub.dev/d/kweg66hq94ph/comark-properties-relative-dates
For Drop comment #10. Drop picks this up in its own bump. Its
RENDERER_SCRIPTSgrabs the first<script>of a properties render, which now has two, so it should usescriptsfromcomark-properties/htmlinstead.