Add crop-and-search workflow for region-scoped reverse image lookup - #6
Merged
Merged
Conversation
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>
Copilot created this pull request from a session on behalf of
potemkin666
May 5, 2026 19:15
View session
potemkin666
marked this pull request as ready for review
May 5, 2026 19:15
There was a problem hiding this comment.
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
SEARCHCTA 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 Cropcontrols, 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 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 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`; | ||
| } |
| 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 }); |
| 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
SEARCHCTA and demotes secondary actionsCrop-and-search interaction
Search CropandClear CropcontrolsSearch artifact routing
originalcleancropReport/export metadata
crop_selectionto exported report payloadscropwhen applicableRegression coverage