Skip to content

Add crop-and-search workflow for region-scoped reverse image lookup - #6

Merged
potemkin666 merged 5 commits into
mainfrom
copilot/make-search-obvious-and-main
May 5, 2026
Merged

Add crop-and-search workflow for region-scoped reverse image lookup#6
potemkin666 merged 5 commits into
mainfrom
copilot/make-search-obvious-and-main

Conversation

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor

This adds a region-scoped search workflow to BlueLens: the user can draw a box over the loaded image and run reverse-search against only that selected area. It also keeps the main search surface visible and obvious, instead of burying the launch flow behind advanced UI.

  • Search-first UI

    • keeps the reverse-search launchpad on the main Search surface
    • preserves the large primary SEARCH CTA and demotes secondary actions
    • updates CTA copy to reflect the actual enabled-state workflow
  • Crop-and-search interaction

    • adds draggable crop selection on the Preview panel
    • introduces explicit Search Crop and Clear Crop controls
    • locks crop bounds in image-space so the selected region survives responsive preview sizing
    • invalidates stale public handoff URLs whenever the crop changes
  • Search artifact routing

    • extends upload/search selection logic to support three artifacts:
      • original
      • clean
      • crop
    • generates a cropped JPEG from the selected bounds and routes launchpad uploads through it when crop mode is active
    • keeps existing full-image and clean-copy behavior unchanged when no crop is selected
  • Report/export metadata

    • adds crop_selection to exported report payloads
    • includes crop dimensions and origin in the markdown report so reviewers can see what region was searched
    • preserves existing upload artifact reporting, now including crop when applicable
  • Regression coverage

    • adds UI assertions for the preview crop surface, crop controls, and crop-specific artifact selection
    • tightens coverage around the promoted search panel structure
function getSearchArtifactWanted() {
  if (isCropActive()) return "crop";
  if (state.shareSafe) return "clean";
  return "original";
}

Copilot AI and others added 5 commits May 5, 2026 18:46
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/23ee7cf7-dc82-4ba0-97ac-824c35f9448f

Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/623a3033-aca9-4573-bf0e-1cf5dbf470c1

Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/623a3033-aca9-4573-bf0e-1cf5dbf470c1

Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/623a3033-aca9-4573-bf0e-1cf5dbf470c1

Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/623a3033-aca9-4573-bf0e-1cf5dbf470c1

Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
@potemkin666
potemkin666 marked this pull request as ready for review May 5, 2026 19:15
Copilot AI review requested due to automatic review settings May 5, 2026 19:15
@potemkin666
potemkin666 merged commit bb954b0 into main May 5, 2026
0 of 2 checks passed
@potemkin666
potemkin666 deleted the copilot/make-search-obvious-and-main branch May 5, 2026 19:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a crop-and-search workflow so reverse-image lookup can be scoped to a user-selected region while keeping the primary “SEARCH” launchpad CTA prominent on the main Search surface.

Changes:

  • Promotes a large primary SEARCH CTA and restructures the search console panel to stay visible (no longer hidden behind a <details> drawer).
  • Adds a preview crop-selection tool plus Search Crop / Clear Crop controls, and routes uploads through a derived cropped JPEG when a crop is selected.
  • Extends exported report metadata to include crop_selection, and adds UI regression assertions for the new structure and crop workflow.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
test/ui-regressions.test.js Updates regression assertions for the promoted SEARCH CTA, advanced panel structure, and new crop controls/artifact logic.
styles.css Adds crop overlay styling, new primary SEARCH CTA styling, and updated background layering.
index.html Restructures quick actions to feature a primary SEARCH CTA; exposes preview crop surface and crop action buttons; replaces advanced drawer with a visible panel section.
app.js Implements crop selection state/mouse interactions, crop-derived JPEG generation, crop-aware upload artifact selection, and report export inclusion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app.js
Comment on lines +4087 to +4094
function updateCropButtons() {
const hasCrop = isCropActive();
if (elements.btnSearchCrop) elements.btnSearchCrop.disabled = state.uiBusy ? true : !hasCrop;
if (elements.btnClearCrop) elements.btnClearCrop.disabled = state.uiBusy ? true : !hasCrop;
}

function getSearchArtifactWanted() {
if (isCropActive()) return "crop";
Comment thread app.js
Comment on lines +4072 to +4085
function renderCropSelection() {
const box = elements.previewCropBox;
const stage = elements.previewStage;
const rect = state.crop?.rect || null;
if (!box || !stage) return;
const active = Boolean(rect);
box.hidden = !active;
stage.classList.toggle("crop-ready", Boolean(state.file));
if (!active) return;
box.style.left = `${rect.left}px`;
box.style.top = `${rect.top}px`;
box.style.width = `${rect.width}px`;
box.style.height = `${rect.height}px`;
}
Comment thread app.js
const metrics = getPreviewImageMetrics();
const rect = state.crop.rect;
if (!metrics || rect.width < MIN_CROP_SIZE_PX || rect.height < MIN_CROP_SIZE_PX) {
clearCropSelection({ quiet: true });
Comment thread styles.css
radial-gradient(960px 680px at 82% 12%, rgba(125, 205, 255, 0.18), transparent 60%),
radial-gradient(920px 760px at 50% 100%, rgba(92, 173, 255, 0.18), transparent 60%),
linear-gradient(180deg, rgba(3, 13, 30, 0.18), rgba(3, 13, 30, 0.58)),
url("https://github.com/user-attachments/assets/e061975f-68eb-4d6f-b6a9-bff2785854ed") center / cover no-repeat fixed,
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.

3 participants