Skip to content

feat: UI optimizations - #17

Closed
luorome31 wants to merge 3 commits into
mainfrom
feat/ui-optimizations
Closed

luorome31 wants to merge 3 commits into
mainfrom
feat/ui-optimizations

Conversation

@luorome31

Copy link
Copy Markdown
Owner

Summary

  • Add plugin name "InlineNote" to popup header (top-left)
  • Hide debug overlay unless apiConfig.debug === true
  • Change Alt highlight border from yellow to light blue (rgba(96, 165, 250, 0.6))
  • Make note card width dynamic based on selected text rect (200px-600px range)
  • Remove chrome_url_overrides.newtab (restore default Chrome newtab)
  • Simplify config.ts - remove unused API config variables (baseURL, apiKey, model, etc.)

Test Plan

  • Open popup - confirm "InlineNote" shows in top-left corner
  • Open new tab - confirm default Chrome newtab loads (not plugin page)
  • Use Alt key on a webpage - confirm light blue dashed highlight
  • Alt+Click to create note - confirm card width matches selected text
  • Debug overlay should not appear during normal use

…dynamic card width

- Add plugin name "InlineNote" to popup header
- Hide debug overlay unless apiConfig.debug is true
- Change Alt highlight border from yellow to light blue
- Make note card width dynamic based on selected text rect
- Remove chrome_url_overrides.newtab (restore default newtab)
- Simplify config.ts - remove unused API config variables
Copilot AI review requested due to automatic review settings March 29, 2026 06:28

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

This PR applies a set of UI/UX optimizations across the extension popup and content-script UI, including branding updates, debug-UI gating, highlight styling tweaks, and a new dynamic sizing behavior for the in-page note card. It also removes the extension’s New Tab override and simplifies the shared apiConfig down to a debug flag.

Changes:

  • Add “InlineNote” branding to the popup header and update manifest name/description.
  • Hide the content-script debug overlay unless apiConfig.debug === true, and update Alt-highlight border color.
  • Introduce rect-based dynamic sizing for NoteCard (intended 200–600px), and remove chrome_url_overrides.newtab.

Reviewed changes

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

Show a summary per file
File Description
src/pages/popup/popup.css Popup header layout updated; adds .popup-title styling.
src/pages/popup/Popup.tsx Renders “InlineNote” title in header; minor formatting refactor.
src/pages/content/services/NoteCard.ts Adds rect-based dynamic width logic and updates CSS sizing constraints.
src/pages/content/services/HighlightController.ts Changes highlight border color to light blue.
src/pages/content/index.tsx Passes selection rect width into NoteCard; hides debug overlay when not in debug mode.
src/pages/background/config.ts Simplifies apiConfig to only { debug: false }.
manifest.json Updates extension name/description and removes New Tab override.

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

Comment on lines +49 to +51
const minWidth = Math.max(200, rectWidth || 0);
const maxWidth = Math.min(600, rectWidth || 420);
const cardWidth = rectWidth ? `${Math.min(Math.max(rectWidth, minWidth), maxWidth)}px` : '100%';

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

The width clamping math is incorrect when rectWidth is below 200: maxWidth becomes rectWidth, so cardWidth can end up < 200px (e.g., 100px), violating the intended 200–600px range. Consider simplifying to a single clamp like clamp(rectWidth, 200, 600) and using that value for the width when rectWidth is provided.

Suggested change
const minWidth = Math.max(200, rectWidth || 0);
const maxWidth = Math.min(600, rectWidth || 420);
const cardWidth = rectWidth ? `${Math.min(Math.max(rectWidth, minWidth), maxWidth)}px` : '100%';
const cardWidth = rectWidth
? `${Math.max(200, Math.min(rectWidth, 600))}px`
: '100%';

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +51
// Calculate dynamic width from rect if provided
const rectWidth = this.options.rect?.width;
const minWidth = Math.max(200, rectWidth || 0);
const maxWidth = Math.min(600, rectWidth || 420);
const cardWidth = rectWidth ? `${Math.min(Math.max(rectWidth, minWidth), maxWidth)}px` : '100%';

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

NoteCard now supports rect-based dynamic sizing (200–600px), but there are existing unit tests for NoteCard and none appear to assert the computed width behavior. Adding tests for sizing edge cases (rectWidth < 200, 200–600, > 600) would help prevent regressions.

Suggested change
// Calculate dynamic width from rect if provided
const rectWidth = this.options.rect?.width;
const minWidth = Math.max(200, rectWidth || 0);
const maxWidth = Math.min(600, rectWidth || 420);
const cardWidth = rectWidth ? `${Math.min(Math.max(rectWidth, minWidth), maxWidth)}px` : '100%';
// Calculate dynamic width from rect if provided, clamped between 200px and 600px
const rectWidth = this.options.rect?.width;
const cardWidth = rectWidth
? `${Math.min(Math.max(rectWidth, 200), 600)}px`
: '100%';

Copilot uses AI. Check for mistakes.
@luorome31 luorome31 closed this Mar 29, 2026
@luorome31
luorome31 deleted the feat/ui-optimizations branch March 29, 2026 09:40
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