Skip to content

Add collapsible input section to keep it out of Ctrl+F results#23

Merged
unknowIfGuestInDream merged 3 commits into
masterfrom
copilot/optimize-search-functionality
Jun 5, 2026
Merged

Add collapsible input section to keep it out of Ctrl+F results#23
unknowIfGuestInDream merged 3 commits into
masterfrom
copilot/optimize-search-functionality

Conversation

Copilot AI commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

When reviewing a rendered patch, the large input textarea kept matching during in-page find (Ctrl+F), competing with the Diff Preview and slowing down search.

Changes

  • Collapse toggle (#collapse-btn) added to the input header. Collapsing applies display:none to the textarea, removing it from the DOM render box so Ctrl+F no longer matches its content.
  • Persistence of the collapsed state via localStorage (patchReader_inputCollapsed), restored on load.
  • Accessibility: button exposes aria-expanded / aria-controls; tooltip switches between collapse/expand via data-i18n-title.
  • i18n: added collapseInput / expandInput for en / zh / ja.
  • Version bump to 1.0.4 (package.json, package-lock.json, and the Chrome / Edge manifest.json).

All edits live in src/common/, so both Chrome and Edge builds inherit them.

// Collapsing hides the textarea so its content is excluded from Ctrl+F
function setInputCollapsed(collapsed, persist = true) {
  inputSection.classList.toggle('collapsed', collapsed);
  collapseBtn.setAttribute('aria-expanded', collapsed ? 'false' : 'true');
  // ...persist to localStorage
}
.input-section.collapsed #diff-input { display: none; }

Copilot AI linked an issue Jun 5, 2026 that may be closed by this pull request
@pull-request-size pull-request-size Bot added size/M and removed size/XS labels Jun 5, 2026
Copilot AI changed the title [WIP] Optimize search functionality to exclude input patch/diff content Add collapsible input section to keep it out of Ctrl+F results Jun 5, 2026
@unknowIfGuestInDream unknowIfGuestInDream marked this pull request as ready for review June 5, 2026 22:11
@unknowIfGuestInDream

Copy link
Copy Markdown
Contributor

@copilot
版本到1.0.4

Copilot AI commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot
版本到1.0.4

已将版本更新到 1.0.4(package.json、chrome/edge manifest.json 及 package-lock.json)。

@unknowIfGuestInDream unknowIfGuestInDream merged commit e01ce99 into master Jun 5, 2026
5 checks passed
@unknowIfGuestInDream unknowIfGuestInDream deleted the copilot/optimize-search-functionality branch June 5, 2026 22:14
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.

功能优化

2 participants