Skip to content

feat: sort intent list by submit time and add copy-order-id affordance#56

Merged
reednaa merged 1 commit into
mainfrom
feat/intent-list-submit-time-sort-copy-order-id
Jun 18, 2026
Merged

feat: sort intent list by submit time and add copy-order-id affordance#56
reednaa merged 1 commit into
mainfrom
feat/intent-list-submit-time-sort-copy-order-id

Conversation

@reednaa

@reednaa reednaa commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

Two related intent-list improvements, plus an accessibility fix surfaced in review.

1. Sort the intent list by submit time (newest first)

  • parseOrderStatusPayload now captures meta.submitTime from the order-server envelope onto the OrderContainer, defensively normalizing milliseconds → seconds.
  • intentList.ts adds an optional submitTime to BaseIntentRow (populated in buildBaseIntentRow from submitTime ?? createdAt) and two exported comparators:
    • compareActiveRows — newest submit time first, tiebreak by soonest fillDeadline.
    • compareExpiredRows — newest submit time first, tiebreak by latest fillDeadline (preserves prior expired ordering).
    • Rows with no submit time sort last.
  • state.svelte.ts re-attaches the authoritative createdAt/id/intentType columns after JSON.parse on load, and stamps a local createdAt on save so freshly created/imported intents sort correctly before the next reload.

2. Copy order id to clipboard

  • New clipboard.ts util: async Clipboard API with an execCommand textarea fallback for insecure contexts, SSR-safe guards, returns boolean.
  • The 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)

  • The intent-list card wrappers were native <button> elements containing the now-interactive copy chip — invalid HTML (interactive content nested in <button>). Converted the card wrappers to role="button" <div>s with onclick + 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 and meta.submitTime capture + ms→s normalization).
  • eslint clean on changed files; svelte-check reports 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.submitTime is read off the .intent-unwrapped envelope, so an .intent-wrapped payload carrying submitTime as a sibling would drop it (graceful fallback to createdAt; primary documented response shape works).
  • Hidden fallback <textarea> is not removed if execCommand throws after append (use finally).
  • copyTimer is not cleared on component unmount (harmless).

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@reednaa, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ff032c2e-bd55-44e3-84cf-2992dc2d0e60

📥 Commits

Reviewing files that changed from the base of the PR and between 42f1fa3 and 8857bb8.

📒 Files selected for processing (8)
  • src/lib/components/IntentListDetailRow.svelte
  • src/lib/libraries/intentList.ts
  • src/lib/libraries/orderServer.ts
  • src/lib/screens/IntentList.svelte
  • src/lib/state.svelte.ts
  • src/lib/utils/clipboard.ts
  • tests/unit/intentList.test.ts
  • tests/unit/orderServer.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/intent-list-submit-time-sort-copy-order-id

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

🚀 Preview deployed!

Worker: lintent-pr-56
URL: https://lintent-pr-56.li-fi374.workers.dev

@reednaa reednaa merged commit 6d23e47 into main Jun 18, 2026
7 checks passed
@reednaa reednaa deleted the feat/intent-list-submit-time-sort-copy-order-id branch June 18, 2026 15:16
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.

1 participant