Skip to content

Add page feedback collection - #3705

Merged
reakaleek merged 13 commits into
mainfrom
helix-chiller
Sep 7, 2026
Merged

reakaleek merged 13 commits into
mainfrom
helix-chiller

Conversation

@reakaleek

@reakaleek reakaleek commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

Readers can leave thumbs and short comments on docs and API pages without leaving the page. Teams get page-level signals in Elasticsearch instead of scattered GitHub issues.

Affects: docs site (Markdown + API reference), docs API

Prompt summary: Finish the page-feedback PR and use it for API feedback instead of wiring a GitHub api-feedback issue template (https://github.com/elastic/docs-eng-team/issues/819).

Why

API and Markdown pages lack a shared on-page way to capture whether content helped. The old Bump Feedback path opened a GitHub form; Search/Ask AI used the wrong template. Teams need structured reactions they can query without sending readers off-site.

Closes elastic/docs-eng-team#819

What

Page feedback control

Assembler and Codex pages render a page-feedback web component under the article. Users pick thumbs up or down, optional reasons, and a comment. They can revise or revoke within the session. The control stays off when air-gapped or when PAGE_FEEDBACK is disabled.

API and storage

New PUT/DELETE /page-feedback/{id} endpoints upsert and delete documents through Elastic Ingest (DirectWriteAsync). Mapping bootstrap is version-aware. Staging, preview, and dev enable the flag in assembler.yml.

API reference pages

API layouts include the same _PageFeedback partial as Markdown, so API chrome collects real feedback rather than linking to a GitHub issue template.

image

Verify

dotnet test tests/Elastic.Documentation.Api.Tests/
cd src/Elastic.Documentation.Site && npm run test -- --testPathPattern=PageFeedback

Enable PAGE_FEEDBACK locally or use staging/preview with API explorer. Confirm an API page shows the feedback control and a successful reaction does not open GitHub.

Out of scope: App-level rate limiting and Cloudflare Turnstile. Staging relies on existing WAF limits; revisit before production rollout.

Risk: Writes feedback documents into an environment-specific Elasticsearch index. A code revert does not delete already-written documents.

@reakaleek
reakaleek requested review from a team as code owners July 23, 2026 09:18
@reakaleek
reakaleek requested a review from theletterf July 23, 2026 09:18
@reakaleek
reakaleek marked this pull request as draft July 23, 2026 09:37
@theletterf

Copy link
Copy Markdown
Member

+CC @technige A good candidate for the "Other" slide :)

@reakaleek
reakaleek marked this pull request as ready for review July 23, 2026 13:00
@reakaleek
reakaleek marked this pull request as draft July 23, 2026 13:01

@Mpdreamz Mpdreamz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good first pass — the feature shape is right. Four concrete follow-ups below.

Pre-existing note (ElasticsearchAskAiMessageFeedbackGateway.cs:71): record.Reaction.ToString().ToLowerInvariant() bypasses whatever [JsonStringEnumMemberName] attributes the reaction enum declares. Worth fixing alongside the PageFeedbackDocument change.

Comment thread src/Elastic.ApiExplorer/_Layout.cshtml Resolved
@shainaraskas

Copy link
Copy Markdown
Member

does this feedback get exposed to writers?

@reakaleek

Copy link
Copy Markdown
Member Author

does this feedback get exposed to writers?

That's the goal

@reakaleek
reakaleek marked this pull request as ready for review July 23, 2026 20:00
@reakaleek
reakaleek requested review from Mpdreamz and itsalexcm July 23, 2026 20:00
@reakaleek reakaleek self-assigned this Jul 23, 2026

@Mpdreamz Mpdreamz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reakaleek

Copy link
Copy Markdown
Member Author

Should we introduce rate limiting to the API at this point?

https://learn.microsoft.com/en-us/aspnet/core/performance/rate-limit?view=aspnetcore-10.0

Should we add cloudflare turnstile?

We have a general rate limit in WAF. But it's definitely worth double-checking in docs-infra.

@theletterf

Copy link
Copy Markdown
Member

Before rolling this out in Prod, we should follow-up with a task to define the feedback options as a team.

@reakaleek

Copy link
Copy Markdown
Member Author

Before rolling this out in Prod, we should follow-up with a task to define the feedback options as a team.

SGTM. But I definitely want to get this into staging to verify it functionally.

@reakaleek

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in bd1c9e5 by merging main into this branch and completing conflict resolution; the branch is now clean with no remaining conflict markers.

@reakaleek

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

Resolved in bd1c9e5 by merging main into this branch and completing conflict resolution; the branch is now clean with no remaining conflict markers.

There is still a conflict

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in bd1c9e5 by merging main into this branch and completing conflict resolution; the branch is now clean with no remain...

Fixed in f9ff34ea by merging the latest main into this branch and resolving the remaining conflicts (docs/development/toc.yml and tests/Navigation.Tests/Isolation/PhysicalDocsetTests.cs).

@theletterf

Copy link
Copy Markdown
Member

What's the status of this one?

@reakaleek

Copy link
Copy Markdown
Member Author

Rebase update

Rebased onto current main (360fc520). Conflicts resolved in assembler.yml, docs/development/toc.yml, API mappings, web host, package props, and transport-factory consolidation (kept main deletions for Labs/SearchBootstrap; shared Elastic.Documentation.Configuration transport for API adapters).

API layouts still render _PageFeedback (gated by PAGE_FEEDBACK). Flag remains on for staging, preview, and local dev.

Review follow-ups

Inline threads from the earlier pass (enums, DirectWriteAsync, shared IngestChannel, MappingVersionFromAssembly) are still in place after the rebase and are marked resolved.

Rate limiting / Turnstile (CHANGES_REQUESTED)

Staging/preview traffic to this API already sits behind Cloudflare WAF with the site's general rate limiting. Adding ASP.NET rate limiting or Turnstile in this PR would duplicate that control plane for a low-volume feedback PUT without changing the abuse story. Prefer keeping abuse controls at the WAF edge for now; happy to revisit app-level limits if we see real abuse once this ships to staging.

Verified locally after rebase: dotnet build, dotnet test tests/Elastic.Documentation.Api.Tests/ (19 passed), Jest PageFeedback (7 passed).

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

reakaleek and others added 12 commits September 7, 2026 12:32
Capture per-page reactions and optional comments so documentation teams can identify content gaps and prioritize improvements.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Co-authored-by: Cursor <[email protected]>
Keep failed comments visible so users can retry from the existing form without a detached recovery action.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Co-authored-by: Cursor <[email protected]>
Remove retry-specific indirection now that failed comments remain in the existing form.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Co-authored-by: Cursor <[email protected]>
Capture reactions promptly while collecting queryable reasons and optional details in a changeable, retry-safe flow.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Co-authored-by: Cursor <[email protected]>
Use direct channel writes and assembly mapping versions so API responses reflect item persistence and rolling deployments cannot downgrade templates.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Co-authored-by: Cursor <[email protected]>
…dreamz)

Consolidate endpoint transport creation in configuration so API feedback adapters reuse one connection pool and tooling no longer maintains duplicate factories.

Co-authored-by: Cursor <[email protected]>
Use the enum wire-name attributes as the single source of truth so stored values cannot drift from the API contract.

Co-authored-by: Cursor <[email protected]>
Keep the feedback prompt visually separated from both page content and navigation.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Co-authored-by: Cursor <[email protected]>
Rebase had deleted essc's ElasticsearchEndpoint/TransportFactory while
pulling Configuration into essc callers. Restore main's essc surface and
apply curb format so CI lint passes.

Co-Authored-By: Composer <[email protected]>
Co-authored-by: Cursor <[email protected]>
…-advanced-security)

Strip CR/LF from user-controlled PageUrl so log entries cannot be forged.

Co-Authored-By: Composer <[email protected]>
Co-authored-by: Cursor <[email protected]>
API and Codex layouts now share the build feature flags so air-gapped
gating works. Submit sends one complete payload instead of a silent
retry plus a flushed debounce write.

Co-Authored-By: Composer <[email protected]>
Co-authored-by: Cursor <[email protected]>
Readers often write a different note for each option. A same-tab refresh should not drop that draft, and API pages need copy that talks about the spec.

Co-Authored-By: Cursor Grok 4.6 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Switching used to wipe every draft. Readers lose typed text if they change their mind.

Co-Authored-By: Cursor Grok 4.6 <[email protected]>
Co-authored-by: Cursor <[email protected]>
@reakaleek
reakaleek merged commit c0cf073 into main Sep 7, 2026
32 checks passed
@reakaleek
reakaleek deleted the helix-chiller branch September 7, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants