Skip to content

Add an Edit page button and a site problem feedback reason - #4056

Merged
theletterf merged 6 commits into
mainfrom
page-actions-bottom-ctas
Sep 8, 2026
Merged

theletterf merged 6 commits into
mainfrom
page-actions-bottom-ctas

Conversation

@theletterf

@theletterf theletterf commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Every docs page now ends with an "Edit page" button, right aligned on the row with the feedback prompt and styled to match Yes and No. The negative questionnaire gains a "Something is broken" reason for faults in the site rather than the content, "Out of date" folds into "Technically incorrect", and "Learn how to contribute" leaves the right rail.

Affects: Site UI, Docs API, Navigation

Prompt summary: The ask was to put the "Edit this page" and "Report an issue" links at the bottom of the page, on the same row as the feedback buttons and right aligned. The rail copies stay rather than move, so a reader can act from either place. The "Learn how to contribute" link goes. A follow-up ask turned the two links into buttons that match Yes and No, shortened their labels, and put edit first. A third ask dropped the "Report issue" button and asked whether a reader could instead report a site glitch through the feedback options. A fourth removed "Out of date" and folded it into "Technically incorrect".

Why

A reader who reaches the end of a page has already scrolled past the right rail. The rail list carries hidden md:flex, so a phone reader sees no CTA at all, and report-an-issue stays hidden until the lg breakpoint. The moment someone wants to act on a page is the moment they finish reading, and nothing there offers a way to do it.

Reporting a broken link or a dead control was worse. The only route was a GitHub issue form, which asks a lot of a reader who just wants to flag a glitch, and none of the negative reasons fit: inaccurate and codeSampleErrors are both about the words on the page.

At the other end, two reasons asked for a distinction the reader cannot make. Telling a page that was never right from one that stopped being right needs the page's history, so outOfDate and inaccurate collapse into one option.

What

An Edit page button under the article

The bottom of every docs page now carries an "Edit page" button, right aligned on the row with the feedback prompt. .page-actions__action reproduces the box that .page-feedback__choice draws, so the three controls on the row share a border, a radius, padding, and a colour. Hover parts company: this one turns --color-blue-elastic, not the green and red the feedback buttons use. A new _PageActions slice renders it, and its gate matches _TableOfContents.cshtml, so a page that shows the rail copy shows this one too.

Six negative reasons instead of six different ones

siteProblem, labelled "Something is broken", reports a fault in the site: a dead link, a control that does nothing, or a search that returns nothing. outOfDate leaves the questionnaire and "Technically incorrect" absorbs it, now reading "The page is wrong about how the product works, or describes an older version". REASON_SET_VERSION moves to 3 for both changes at once, since version 3 has not shipped. Against version 2 the negative set differs twice, so a query that counts either reason must scope itself to a version.

A retired reason is not a deleted one

outOfDate stays in PageFeedbackReason and on the ThumbsDown allowlist. Historical documents hold the value, and a browser running a cached bundle still submits it, so dropping either would answer a live reader with 400. Put_MultipleReasons_RecordsAllReasons sends it and is the guard.

A new reason has to pass three gates

The endpoint validates each reason against the reaction it arrives with, so siteProblem joins the enum and the ThumbsDown branch of IsReasonValidForReaction. Without both, a submission returns 400. The reasons field is a keyword, so neither the addition nor the retirement needs a mapping change or a reindex.

The feedback row shares its top border

page-feedback.css sets the top border and spacing on the page-feedback element itself, which would stop at the left column once the row holds two children. A .page-outro wrapper takes those over and zeroes them on the element. ApiExplorer and Codex render page-feedback unwrapped, so their spacing is untouched, and :has(*) keeps the border off the wrapper when both partials render nothing.

Out of scope: Codex renders page-feedback unwrapped in _MarkdownLayout.cshtml, so internal docs get no bottom row. The ApiExplorer layouts have no edit URL on their view model, so they are unchanged too. The ?edit reveal in main.ts moved to $$optional so it clears the class on both .edit-this-page copies rather than the first.

Verify

./build.sh unit-test
# PageFeedbackEndpointTests.Put_SiteProblemReason_RecordsSiteProblem — the new reason under thumbsDown
# PageFeedbackEndpointTests.Put_InvalidFeedback_ReturnsBadRequest — siteProblem under thumbsUp returns 400
# PageFeedbackEndpointTests.Put_MultipleReasons_RecordsAllReasons — retired outOfDate still accepted
# PageActionsRenderingTests — the edit button gate and the HideEditThisPage path
cd src/Elastic.Documentation.Site && npm run test && npm run fmt:check

To see both changes, build the assets and serve with the flags on:

cd src/Elastic.Documentation.Site && npm run build && cd -
FEATURE_PAGE_FEEDBACK=true FEATURE_PRIMARY_NAV=true dotnet run --project src/tooling/docs-builder serve

Open http://localhost:3000/syntax/admonitions and scroll to the end of the article. "Edit page" should match the height and centre line of Yes and No. Click No: six options, no "Out of date", and "Something is broken" fifth above "Another reason". Submitting locally returns 503 because there is no Elasticsearch, so the endpoint tests are the proof for the payload.

🤖 Generated with Claude Code

https://claude.ai/code/session_013qFe4JZUeEXN58iihNVsRf

Related to #4342

A reader who finishes a page does not look back at the right rail, and
the rail hides both links below the `lg` breakpoint. The bottom row puts
them where the reader already is, beside the feedback buttons. The
right-rail copies stay, so either one works.

The "Learn how to contribute" link leaves the rail. It points at general
guidance rather than at this page, so it does not earn a slot next to
three page-specific actions.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013qFe4JZUeEXN58iihNVsRf
@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

The row holds four controls that do the same kind of thing, so they now
share one appearance. `.page-actions__action` copies the box that
`.page-feedback__choice` draws, and hover turns the border and text
`--color-blue-elastic` instead of the green and red the feedback buttons
use.

Short labels follow from the button shape. "Report a docs issue" and
"Edit this page" read as prose next to two one-word buttons, so the pair
becomes "Edit page" and "Report issue". The rail keeps the long labels,
where the extra words still help. Edit comes first because a reader who
wants to act on a page usually edits it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013qFe4JZUeEXN58iihNVsRf
@theletterf theletterf changed the title Repeat the report and edit CTAs at the bottom of the page Add Edit page and Report issue buttons to the feedback row Sep 8, 2026
A button that opens a GitHub issue form asks a lot of a reader who just
wants to say that something is broken. The negative questionnaire already
collects that kind of report, so the sixth negative reason is now
`siteProblem`, labelled "Something is broken". It covers a dead link, a
control that does nothing, or a search that returns nothing, which
`inaccurate` and `codeSampleErrors` never described.

The bottom row keeps "Edit page" alone. The rail still carries "Report a
docs issue" for a reader who does want to file one.

`REASON_SET_VERSION` moves to 3 because the negative set changed. A query
that counts site faults must not read a version 2 document as an absence
of them. The endpoint validates reasons per reaction, so the new value
also joins `PageFeedbackReason` and the `ThumbsDown` list; without both a
submission would fail with `400`. The `reasons` field is a keyword, so no
mapping change and no reindex.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013qFe4JZUeEXN58iihNVsRf
@theletterf theletterf changed the title Add Edit page and Report issue buttons to the feedback row Add an Edit page button and a site problem feedback reason Sep 8, 2026
theletterf and others added 2 commits September 8, 2026 13:32
A reader cannot tell a page that was never right from a page that stopped
being right, and should not have to. "Technically incorrect" now reads
"The page is wrong about how the product works, or describes an older
version", and the negative questionnaire drops to six options.

`outOfDate` stays in `PageFeedbackReason` and on the `ThumbsDown` list.
Historical documents hold the value, and a browser running a cached
bundle still submits it, so removing either one would answer a live
reader with `400`. Only the browser's reason set loses it.

`REASON_SET_VERSION` stays at 3. Version 3 has not shipped, so this joins
it rather than inventing a version 4 that no browser ever presented.
Against version 2 the negative set now differs twice: version 2 offered
`outOfDate` and lacked `siteProblem`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013qFe4JZUeEXN58iihNVsRf
"The page is wrong about how the product works, or describes an older
version" spent six words restating the label. It now reads "The page is
wrong or describes an older version."

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013qFe4JZUeEXN58iihNVsRf
@theletterf
theletterf marked this pull request as ready for review September 8, 2026 11:39
@theletterf
theletterf requested a review from a team as a code owner September 8, 2026 11:39
@theletterf
theletterf requested a review from reakaleek September 8, 2026 11:39
@theletterf

Copy link
Copy Markdown
Member Author

@reakaleek Ready for review

@theletterf
theletterf merged commit 64e2692 into main Sep 8, 2026
32 checks passed
@theletterf
theletterf deleted the page-actions-bottom-ctas branch September 8, 2026 16:28
reakaleek added a commit that referenced this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants