feat: sort intent list by submit time and add copy-order-id affordance#56
Conversation
Sort the intent list by order-server submit time (newest first), with fillDeadline as a deterministic tiebreaker. parseOrderStatusPayload now captures meta.submitTime (normalizing ms->s), buildBaseIntentRow falls back to the local created time, and state persists/re-attaches createdAt from the authoritative DB column. Add a copy-to-clipboard affordance on the order-id chip (async Clipboard API with an execCommand fallback for insecure contexts). The intent-list card wrappers are now role="button" divs instead of native <button> elements so the interactive copy chip is valid (non-nested) interactive content; keyboard activation (Enter/Space) is preserved. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 16 minutes and 40 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🚀 Preview deployed! Worker: |
Summary
Two related intent-list improvements, plus an accessibility fix surfaced in review.
1. Sort the intent list by submit time (newest first)
parseOrderStatusPayloadnow capturesmeta.submitTimefrom the order-server envelope onto theOrderContainer, defensively normalizing milliseconds → seconds.intentList.tsadds an optionalsubmitTimetoBaseIntentRow(populated inbuildBaseIntentRowfromsubmitTime ?? createdAt) and two exported comparators:compareActiveRows— newest submit time first, tiebreak by soonestfillDeadline.compareExpiredRows— newest submit time first, tiebreak by latestfillDeadline(preserves prior expired ordering).state.svelte.tsre-attaches the authoritativecreatedAt/id/intentTypecolumns afterJSON.parseon load, and stamps a localcreatedAton save so freshly created/imported intents sort correctly before the next reload.2. Copy order id to clipboard
clipboard.tsutil: async Clipboard API with anexecCommandtextarea fallback for insecure contexts, SSR-safe guards, returnsboolean.Order {short}chip is now an interactive control (click + Enter/Space) that copies the full order id and shows a transient "Copied!" state.3. Accessibility fix (from review)
<button>elements containing the now-interactive copy chip — invalid HTML (interactive content nested in<button>). Converted the card wrappers torole="button"<div>s withonclick+onkeydown(Enter/Space) handlers so the copy affordance is valid, non-nested interactive content. Behavior is identical.Testing
bun test tests/unit/intentList.test.ts tests/unit/orderServer.test.ts— 12 pass (new coverage for both comparators andmeta.submitTimecapture + ms→s normalization).eslintclean on changed files;svelte-checkreports no new issues in changed files.Review notes
This change was cross-reviewed with the Codex CLI. Confirmed-but-deferred lower-severity items (not addressed here):
meta.submitTimeis read off the.intent-unwrapped envelope, so an.intent-wrapped payload carryingsubmitTimeas a sibling would drop it (graceful fallback tocreatedAt; primary documented response shape works).<textarea>is not removed ifexecCommandthrows after append (usefinally).copyTimeris not cleared on component unmount (harmless).🤖 Generated with Claude Code