Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

Addresses performance, testing, and accessibility issues in the fixture sync feature identified in code review.

Performance optimizations

  • In-memory fixture lookup: Replace O(n) database queries in loop with O(1) Map lookup
  • Batch database operations: Execute fixture updates, availability clears, and reinitialization atomically via D1 batch() API
// Before: 4+ sequential DB calls per changed fixture
await db.updateFixtureDate(id, date, time);
await db.clearAvailabilityForFixture(id);
await db.clearFinalSelections(id);
for (const player of players) {
  await db.createAvailability(id, player.id, false);
}

// After: Single batch operation
await db.batchUpdateFixture(id, date, time, playerIds);

Test improvements

  • Replace arbitrary waitForTimeout() calls with semantic Playwright state checks (locator.waitFor())
  • Remove unused syncingButton variable

Accessibility fixes

  • Dialog backdrop: remove role="button" + tabindex="0", add role="presentation"
  • Dialog keydown: allow Escape propagation for proper keyboard navigation
<!-- Before -->
<div role="button" tabindex="0" onkeydown={(e) => e.stopPropagation()}>

<!-- After -->
<div role="presentation" onkeydown={(e) => { if (e.key !== 'Escape') e.stopPropagation(); }}>

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Replace unused existingFixtures variable with in-memory Map lookup
- Add batch database operations (batchUpdateFixture, batchCreateFixtureWithAvailability)
- Use batch operations instead of multiple sequential DB calls for better performance
- Remove role="button" from dialog backdrop (accessibility fix)
- Fix dialog keydown handler to allow Escape key propagation
- Replace arbitrary timeouts with proper Playwright waiting mechanisms in tests
- Remove unused syncingButton variable in tests
- Update test expectations to verify batch operations

Co-authored-by: chamika <754909+chamika@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 5, 2026

Deploying tabletennis with  Cloudflare Pages  Cloudflare Pages

Latest commit: ede658a
Status: ✅  Deploy successful!
Preview URL: https://fb49f3ec.tabletennis.pages.dev
Branch Preview URL: https://copilot-sub-pr-8.tabletennis.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 5, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tabletennis ede658a Commit Preview URL

Branch Preview URL
Jan 05 2026, 08:23 PM

Copilot AI and others added 3 commits January 5, 2026 20:21
Co-authored-by: chamika <754909+chamika@users.noreply.github.com>
Co-authored-by: chamika <754909+chamika@users.noreply.github.com>
Co-authored-by: chamika <754909+chamika@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 5, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • developers.cloudflare.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add fixture synchronization feature from ELTTL Optimize sync endpoint with batch operations and fix accessibility issues Jan 5, 2026
Copilot AI requested a review from chamika January 5, 2026 20:24
@chamika chamika marked this pull request as ready for review January 5, 2026 20:28
@chamika chamika merged commit 842499a into add-sync Jan 5, 2026
2 checks passed
@chamika chamika deleted the copilot/sub-pr-8 branch January 5, 2026 20:28
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.

2 participants