Skip to content

feat: Milestone 2 — Smart Navigation & Productivity Features#16

Merged
dormonbear merged 20 commits into
mainfrom
develop
Apr 6, 2026
Merged

feat: Milestone 2 — Smart Navigation & Productivity Features#16
dormonbear merged 20 commits into
mainfrom
develop

Conversation

@dormonbear

Copy link
Copy Markdown
Owner

Summary

Milestone 2: Feature Expansion -- Smart Navigation & Productivity

Evolves UltraForce from a metadata search tool into a Salesforce productivity launcher with 4 new features.

Features

1. Recent History + Frecency

  • Track visited records and setup pages across sessions
  • Frecency ranking (frequency + recency) for smart ordering
  • Remove individual items from history
  • Persisted to chrome.storage via Zustand store

2. Setup Page Favorites

  • Pin frequently-used items to modal home screen
  • Star icon toggle on search results and home screen
  • Favorites section always visible at top of modal
  • Max 20 favorites, persisted across sessions

3. Smart ID Navigator

  • Detect Salesforce IDs (15/18-char) from pasted text, URLs, mixed content
  • Multi-ID support: paste multiple IDs, see preview list for all
  • Record preview via REST API (object type + record name)
  • 5-min cache with LRU eviction, graceful 404/403 handling

4. Contextual Suggestions

  • Record page actions: Clone, Object Setup (URL-derived, no API calls)
  • Setup page suggestions: related pages in same category
  • Modal home screen replaces empty state with favorites + recent

Key Files

New stores:

  • src/stores/history-store.ts — Frecency-scored history with chrome.storage persistence
  • src/stores/favorites-store.ts — Pinned items with toggle/reorder

New components:

  • src/components/search/HomeScreen.tsx — Modal home screen (favorites + recent)
  • src/components/search/IdPreview.tsx — Record preview card for ID detection

New lib:

  • src/lib/id-utils.ts — ID detection, extraction, multi-ID support
  • src/lib/record-preview.ts — REST API record preview with two-layer cache
  • src/lib/contextual-suggestions.ts — Page-aware action suggestions

Verification

  • 727 unit tests passing (including 92 new tests for M2 features)
  • TypeScript type-check clean
  • UAT: 13 tests, 9 passed initially, 4 issues found and fixed
  • All 4 UAT issues resolved with follow-up commits

Test plan

  • Unit tests for all new stores, components, and lib modules
  • Manual UAT across all 4 features
  • Build verification (plasmo build)
  • No regressions in existing functionality

dormonbear and others added 20 commits April 5, 2026 23:35
- Apply backdrop-filter as inline React style to bypass Parcel CSS
  minifier that was stripping spaces between filter functions
- Add Zustand persist hydration guard to prevent search before
  settings are loaded from chrome.storage
- Add selectedTypes fallback to defaults when stored value is empty
- Show error message when sfHost is missing during search

Fixes: frosted glass background missing, search not triggering on input
Phase 1 deliverables were already implemented:
- history-store.ts with frecency scoring (19 tests passing)
- favorites-store.ts with pin/unpin (19 tests passing)
- Navigation tracking in window-manager.ts
- Storage keys registered in storage-service.ts

Advancing to Phase 2: Modal Home Screen.

Co-authored-by: Copilot <[email protected]>
Auto-discussed gray areas with recommended defaults:
- HomeScreen replaces EmptyState type=start only
- Star icon on hover for pin/unpin in ResultItem
- Mouse-only navigation for HomeScreen items
- Memoized store reads (already implemented)

Co-authored-by: Copilot <[email protected]>
Plan 02-01: Wire HomeScreen + Pin Affordance (5 tasks, 1 wave)
- Task 1: Replace EmptyState type=start with HomeScreen
- Task 2: Add onNavigate prop to WindowManager
- Task 3: Add pin/star icon to ResultItem
- Task 4: Wire pin through SearchModal -> SearchResults -> ResultItem
- Task 5: Unit tests for HomeScreen and ResultItem

Co-authored-by: Copilot <[email protected]>
- Replace EmptyState type=start with HomeScreen component
- Add onNavigate prop to SearchModal and WindowManager
- Add pin/star icon to ResultItem (visible on hover)
- Wire pin/unpin through SearchResults to ResultItem
- Add HomeScreen callbacks (navigate, toggle favorite, remove history)
- Add pin icon styles with gold highlight on hover
- Include pre-existing stores (history, favorites) and HomeScreen component
- Add 19 new unit tests (HomeScreen: 8, ResultItem: 11)

All 662 tests pass. Build succeeds.

Co-authored-by: Copilot <[email protected]>
Updated roadmap and state:
- Phase 2 marked complete (1/1 plans done)
- Milestone progress: 50% (2/4 phases)
- Next: Phase 3 Smart ID Navigator

Co-authored-by: Copilot <[email protected]>
Auto-discussed gray areas with recommended defaults:
- Extract IDs from plain text, URLs, and mixed content
- REST API with dual in-memory cache (prefix + record)
- Inline preview replacing EmptyState id-navigation
- AbortController for responsive cancellation

Co-authored-by: Copilot <[email protected]>
7 tasks: id-utils, record-preview, IdPreview component, integration, tests

Co-authored-by: Copilot <[email protected]>
New modules:
- src/lib/id-utils.ts: ID extraction from plain text, URLs, mixed content
- src/lib/record-preview.ts: REST API preview with dual cache (prefix + record)
- src/components/search/IdPreview.tsx: Preview UI with loading/resolved/error states

Integration:
- SearchModal uses extractSalesforceId() for URL + mixed text ID detection
- IdPreview replaces EmptyState id-navigation with rich preview
- WindowManager enriches history entries with resolved record names
- sfRest() now supports AbortSignal for cancellation
- SfRestError interface added for typed error status codes

Tests: 42 new tests (704 total), type-check clean, build green

Co-authored-by: Copilot <[email protected]>
3/4 phases done, 75% milestone progress
Next: Phase 4 Contextual Suggestions

Co-authored-by: Copilot <[email protected]>
…up suggestions

New modules:
- src/lib/contextual-suggestions.ts: Pure function suggestion engine
  - getRecordSuggestions: 5 new actions (Sharing, History, Related Lists, Clone, Object Setup)
  - getSetupSuggestions: Related setup pages from same category
  - isSetupPage: URL-based setup page detection

Integration:
- SearchModal recordActions expanded from 3 to 8 on record pages
- Extracted renderActionIcon helper with SVG icons for all action types
- Setup suggestions section shown below HomeScreen when on a setup page
- Each action description now shown from action metadata (not hardcoded)

Tests: 17 new tests (721 total), type-check clean, build green

Co-authored-by: Copilot <[email protected]>
All phases delivered:
  Phase 1: Data Infrastructure (pre-existing, documented)
  Phase 2: Modal Home Screen (HomeScreen + pin affordance)
  Phase 3: Smart ID Navigator (detection, preview, UI)
  Phase 4: Contextual Suggestions (expanded actions + setup suggestions)

Tests: 721 total (up from 643 at milestone start)
Ready for Milestone 3.

Co-authored-by: Copilot <[email protected]>
- Fix record actions: replace broken History/Related Lists URLs with
  Approvals and Feed Tracking; fix Object Setup to route to Details
  for all objects; init selectedRecordActionIndex to -1 (no default
  highlight)
- Multi-ID support: add extractAllSalesforceIds() for batch ID paste;
  render ID preview list instead of single card
- Favorite icon visibility: always show filled star for pinned items
  in both search results and HomeScreen Recent section
- Unify star icon size (14x14) across HomeScreen and ResultItem
- Remove always-visible star CSS from search results (keep hover-only
  like other action buttons)
- Fix isFavoriteCheck: subscribe to favoriteItems array so React
  re-renders when favorites change, making star toggle to filled state
Wrap favorite button in .favorite-action container with same
opacity:0 / hover:opacity:1 behavior as .object-actions.
Keep only Clone and Object Setup as contextual suggestions.
Per user feedback, the other actions are not useful enough.
9 passed, 4 issues found and fixed in follow-up commits.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
ultraforce-doc 5a83d0a Apr 06 2026, 09:37 AM

@dormonbear dormonbear merged commit 88e2b7c into main Apr 6, 2026
5 of 6 checks passed
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.

1 participant