Skip to content

feat(bing): v2 panels — striking distance, queries/pages tables, tiles, get_bing_queries - #3

Merged
mlava merged 1 commit into
mainfrom
feat/bing-v2-panels
Jul 25, 2026
Merged

feat(bing): v2 panels — striking distance, queries/pages tables, tiles, get_bing_queries#3
mlava merged 1 commit into
mainfrom
feat/bing-v2-panels

Conversation

@mlava

@mlava mlava commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Builds the "Future directions" section of specs/0009-bing-webmaster-integration.md on the fork while the upstream proposal (every-app#150) awaits a maintainer response. Fork-only; the clean v1 upstream branch is untouched and unaffected.

What's included

  • Striking distance panel (default tab): aggregated queries at average position 5–20 sorted by impressions, with row selection + Copy / Save-as-keywords, mirroring the Search Console panel minus the page column (Bing's GetQueryStats has no page dimension).
  • Queries and Pages tables: sortable, client-paginated, whole-window clicks / impressions / CTR / position.
  • New tiles: CTR and impression-weighted average position join Clicks/Impressions. Clicks/Impressions/CTR get a "vs prior period" delta computed client-side by half-splitting the dense daily series (Bing controls the window; the tooltip states the exact ranges compared). Avg position deliberately has no delta — it comes from sampled data with no reliable sub-windows.
  • MCP tool get_bing_queries: dimension (query|page), strikingDistanceOnly, limit 1–500. Unmetered read, registered next to get_bing_performance.

Data-honesty constraints (from the spec)

  • GetQueryStats/GetPageStats rows are SAMPLED (~16 dates over ~5 months) — everything is aggregated over the whole window; no date picker, no trend charts, no device/country filters. The tables carry a caption saying so.
  • Position is the impression-weighted mean of AvgImpressionPosition; AvgClickPosition (−1 when unclicked) is ignored. Rows with non-positive positions still contribute traffic but not position weight.
  • Both endpoint shapes were probed live on 2026-07-25 (recorded in the spec's Consequences) — no new probing needed.

Not included

No DB/schema changes, no edits to GSC files (only imports of already-exported helpers: formatCtr/formatPosition/formatCount, TabButton, table components).

Verification

  • 842 tests pass (pnpm test), including new suites for bingClient stats methods, aggregation math (boundary cases 4.9/5/20/20.1), the half-split comparison, BingService.getQueryReport, and the MCP tool.
  • pnpm ci:check and vite build clean.
  • ⚠️ Not yet clicked in a running app against a live Bing connection — local dev cannot complete Bing OAuth (localhost redirect refused). Verify on the deployment after merge: tiles show CTR/position with deltas, all three tabs populate, save-keywords works, and get_bing_queries returns rows over MCP.

🤖 Generated with Claude Code

…position tiles, get_bing_queries MCP tool

Builds the spec's Future directions (specs/0009) on the sampled
GetQueryStats/GetPageStats endpoints probed live on 2026-07-25:

- bingClient: getQueryStats/getPageStats sharing one probed row schema
- bingQueryReport: whole-window aggregation (impression-weighted position,
  AvgClickPosition ignored) and the 5-20 striking-distance band
- BingService.getQueryReport + getBingQueryReport server fn
- UI: CTR and avg-position tiles, half-split period deltas from the dense
  daily series, tabs for striking distance / queries / pages / daily,
  copy/save-as-keywords on the striking table
- MCP: get_bing_queries (dimension, strikingDistanceOnly, limit)

No date picker or device/country filters — Bing's API has none, and the
query/page rows are sampled (~16 dates over ~5 months), so only
whole-window aggregates are honest. No DB changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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