Skip to content

Address post-merge review feedback from PR #74#77

Merged
felipefdl merged 3 commits into
mainfrom
fix/74-post-merge-review
May 19, 2026
Merged

Address post-merge review feedback from PR #74#77
felipefdl merged 3 commits into
mainfrom
fix/74-post-merge-review

Conversation

@Freddyminu
Copy link
Copy Markdown
Collaborator

@Freddyminu Freddyminu commented May 19, 2026

Summary

  • Fix TypeScript error: `React.SyntheticEvent` had no `React` namespace in scope; replaced with `SyntheticEvent` from named import
  • Delete ~74 lines of dead DocSearch CSS accidentally introduced by PR Doc gap feedback form in every page footer #74 (Algolia is being replaced on a parallel branch)
  • Remove early return guard so the feedback FAB renders on every doc page, not only pages with tags or edit metadata
  • Replace manual `EditMetaRow` markup with `@theme/EditMetaRow`, eliminating duplicated layout and the leftover inline `style={{ textAlign: "right" }}`
  • Fix FAB/drawer accessibility: add `aria-expanded`, `aria-controls`, `tabIndex`, `aria-hidden` to the FAB; remove the unsupported `aria-modal` from the non-modal drawer; return focus to the FAB on close and Escape
  • Convert both `DocItemFooter` and `FeedbackForm` to arrow functions per AGENTS.md convention
  • Add `console.error` in the fetch catch block so HubSpot submission failures are visible in production logs
  • Reset form state (`feedback`, `email`, `status`) via `useEffect` keyed on the `open` prop instead of relying on a remount key
  • Add `AbortSignal.timeout(10000)` to the HubSpot fetch so the form cannot get stuck in "Sending..." indefinitely
  • Replace `--ifm-color-danger` and `--ifm-color-white` for the required marker and submit button (previously hardcoded `#e53e3e` / `#fff`)
  • Move HubSpot IDs from `secrets` to `vars` in both deploy workflows — these are public client-side values, not credentials
  • Separate the IntersectionObserver sentinel (`
    `) from the `` element so the footer only renders when it has content (tags or edit metadata)

Feedback FAB placement

The feedback UI is a fixed-position FAB in the bottom-right corner, not a button inline with "Edit this page". The FAB appears the first time the bottom of the doc page scrolls into the viewport and remains visible for the rest of the session — it does not re-trigger the entrance animation on every page navigation.

Closes #74

- Replace deprecated React.SyntheticEvent with SyntheticEvent named import
- Delete dead DocSearch CSS block (~74 lines) introduced in PR #74
- Remove early return guard so feedback FAB renders on all doc pages
- Replace manual EditMetaRow markup with @theme/EditMetaRow component
- Fix FAB/drawer accessibility: add aria-expanded, aria-controls, tabIndex,
  aria-hidden, and focus restoration on close; remove spurious aria-modal
- Convert DocItemFooter and FeedbackForm to arrow functions per AGENTS.md
- Remove inline style by delegating alignment to EditMetaRow CSS module
@Freddyminu
Copy link
Copy Markdown
Collaborator Author

This PR responds to the comments from @felipefdl in this PR: #74

Working on the last comment from that page.

@Freddyminu
Copy link
Copy Markdown
Collaborator Author

Freddyminu commented May 19, 2026

Github Vars added, need to remove unused secrets once deployed.

Copy link
Copy Markdown
Member

@felipefdl felipefdl left a comment

Choose a reason for hiding this comment

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

Thanks for the follow-up. PR 77 closes the worst landmine (DocSearch CSS conflict with #218) plus a TS error and accessibility gaps, but most of the post-merge review on #74 is still open. Requesting changes so the rest gets addressed before merge.

Fixed in this PR

  • #1 DocSearch CSS scope creep (Critical). 74 lines deleted.
  • #10 Feature gated on hasTags || hasEditMeta (Suggestion). Early return removed, FAB now renders on every doc page.
  • #8 (partial) Hardcoded DocSearch hex colors. Gone with the DocSearch block.

Improvements added beyond my review (nice)

  • TypeScript fix: React.SyntheticEvent to named SyntheticEvent import.
  • Replaced manual edit-meta markup with @theme/EditMetaRow. Kills the inline style={{ textAlign: "right" }}.
  • Arrow-function conversion per AGENTS.md.
  • Real a11y upgrades: aria-expanded, aria-controls, tabIndex, aria-hidden on the FAB. Removed the bogus aria-modal from the non-modal drawer. Focus returned to FAB on close and Escape.

Still open (requesting changes)

Critical

  • #2 Silent failure in catch block. Footer/index.tsx:188-190 still has catch { setStatus("error"); } with no logging. Add console.error(err) at minimum so production failures are debuggable.
  • #3 FAB vs inline-button spec mismatch. PR #74 description said "next to Edit this page" but the implementation is a fixed-position FAB. Either update the spec or move the button inline.

Important

  • #4 formKey remount trick still in place. Reset state explicitly in FeedbackForm via useEffect keyed on a prop, or lift state to the parent.
  • #5 as string double casts. Type guard is not expressed in the type system. Narrow once with an early return.
  • #6 No fetch timeout. If HubSpot hangs, the form stays in "Sending..." forever. Use AbortSignal.timeout(10000).
  • #7 z-index magic numbers (199 / 200) collide with the Docusaurus navbar layer. Use a defined scale or document the reason.
  • #8 (remaining) #e53e3e (required marker) and #fff still hardcoded. Replace with --ifm-color-danger and --ifm-color-white (or equivalent).
  • #9 Public values treated as repo secrets. HUBSPOT_PORTAL_ID / HUBSPOT_DOC_GAP_FORM_ID get bundled in client JS and sent in the URL to a public HubSpot endpoint. Move to repo variables (vars.HUBSPOT_PORTAL_ID) instead of secrets in both workflows.

Suggestions

  • #11 No tests for a 239-line interactive component (form, observer, escape handler, success timeout, HubSpot submission).
  • #12 "Bounces once when the footer first scrolls into view" still resets visible on every permalink change, so it bounces on every navigation. Either match the description or update the description.

One new nit introduced by this PR

Footer/index.tsx:75-81 always renders the <footer> (needed for the IntersectionObserver ref) but conditionally applies its classes via clsx. When !hasTags && !hasEditMeta, the DOM ends up with an empty unstyled <footer> element. Functionally fine, semantically odd. Splitting the observer target from the footer element would be cleaner. Not a blocker.

Summary

The PR body says "Closes #74" but it closes roughly 3 of 12 issues from the post-merge review. Happy to approve once the Critical items (#2, #3) and the Important items above are addressed. Tests (#11) can land in a follow-up if scope is a concern.

@Freddyminu
Copy link
Copy Markdown
Collaborator Author

Yes, I'm currently working on the other commit.

- Separate IntersectionObserver sentinel from <footer>: use a <div
  ref={sentinelRef} /> always rendered, render <footer> only when it
  has content (tags or edit metadata) — fixes the empty unstyled
  <footer> element on pages with neither
- Remove setVisible(false) from permalink effect so the FAB stays
  visible across navigation instead of re-triggering the bounce on
  every page change
- Replace as-string casts with a proper type guard (feedbackConfig
  object, only set when both IDs are strings)
- Remove formKey remount trick; reset form state via useEffect keyed
  on the open prop
- Add AbortSignal.timeout(10000) to HubSpot fetch
- Log fetch errors with console.error before setting error status
- Move z-index values to --z-doc-gap-fab / --z-doc-gap-drawer custom
  properties with a comment documenting the Docusaurus navbar layer (200)
- Replace hardcoded #fff and #e53e3e with var(--ifm-color-white) and
  var(--ifm-color-danger)
- Switch HubSpot IDs from secrets to vars in both deploy workflows:
  these are public client-side values, not credentials
@felipefdl
Copy link
Copy Markdown
Member

Great turnaround on the fixes. 8 of 10 open items closed cleanly.

Now fixed

Still open before approval

Keeping the changes-requested status until #3 has a decision.

@felipefdl felipefdl merged commit 037fa60 into main May 19, 2026
1 check passed
@felipefdl felipefdl deleted the fix/74-post-merge-review branch May 19, 2026 22:22
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