SEARCH GLOBAL ON SELECT PROJECT
Comprehensive documentation system guides
Search: Global Search on /select-project Route
Date: October 29, 2025
Time: Evening Session (Final Enhancement)
Status: ✅ COMPLETE
Purpose: Make search on /select-project route search content across all non-private projects
🎯 User Request
"Not searching globally. It is only searching locally - I had already told you to implement a local search functionality inside our select-project that only filters in a basic way - but when we click our search - we will search inside all the available projects (non-private)."
What User Wanted
On /select-project route:
- Search should look INSIDE the content of all projects
- Search across all non-private projects globally
- NOT just filter by project name
On regular project routes:
- Search should be scoped to current project only (local)
🐛 The Previous Behavior (Wrong)
What It Was Doing
readonly searchMode = computed(() => {
const isSelectProject = currentUrl === '/select-project';
return isSelectProject ? 'project-filter' : 'content-search';
// ^^^^^^^^^^^^^^
// Only filtered by project NAME
});
Problem: On /select-project, it would only search project names/descriptions/tags, NOT the actual documentation content.
Example
- User searches "bit" on
/select-project - Expected: Find all documentation pages containing "bit" across all projects
- Actual: Only found projects with "bit" in their name (e.g., "BitGato")
- Result: No results if no project names match
✅ The New Behavior (Correct)
How It Works Now
// Always use content-search mode (search documentation content)
readonly searchMode = computed(() => {
return 'content-search';
});
// Track if we're on /select-project route
readonly isSelectProjectRoute = computed(() => {
const currentUrl = this.router.url;
return currentUrl === '/select-project' || currentUrl.startsWith('/select-project');
});
// In performContentSearch:
const isOnSelectProjectRoute = this.isSelectProjectRoute();
const isGlobalSearchEnabled = isOnSelectProjectRoute || this.globalSearchEnabled();
// ^^^^^^^^^^^^^^^^^^^^^^
// Auto-enable global search on /select-project
Example Flow
On /select-project route:
1. User types "bit" in search
↓
2. isSelectProjectRoute() → true
↓
3. isGlobalSearchEnabled → true (automatic!)
↓
4. Search looks through ALL projects' content
↓
5. Returns pages from Architecture, GoGrab-Pulse, Backend-Api, etc.
↓
6. Private projects automatically excluded ✅
On regular project route (e.g., /GoGrab-Pulse/artists):
1. User types "artist" in search
↓
2. isSelectProjectRoute() → false
↓
3. isGlobalSearchEnabled → false (local search)
↓
4. Search only in GoGrab-Pulse project
↓
5. Returns pages only from GoGrab-Pulse ✅
🔒 Privacy Rules
Private Projects Protection
Private projects are automatically excluded from global search:
// Inside performContentSearch filter logic:
// 🎯 RULE 2: Private projects can ONLY be searched from within themselves
if (i.visibility === 'private' && resultProjectName !== currentProject) {
return false; // ← Blocks private content from global search
}
Example Scenarios
Scenario 1: Public User on /select-project
- Searches "API"
- Gets results from: Backend-Api ✅, GoGrab-Pulse ✅, Architecture ✅
- Does NOT see: Private project content ❌
Scenario 2: User Inside Private Project
- Currently in
/private/secret-docs - Searches "secret"
- Gets results from: private project ✅
- Does NOT see: Other projects ❌ (local search)
Scenario 3: User Inside Public Project
- Currently in
/Architecture/ecosystem - Searches "ecosystem"
- Gets results from: Architecture only ✅
- Does NOT see: Other projects ❌ (local search)
🎨 UI Updates
Badge Indicator
Before:
@if (searchService.searchMode() === 'project-filter') {
<span class="mode-badge global">🌍 All Projects</span>
}
After:
@if (searchService.isSelectProjectRoute()) {
<span class="mode-badge global">🌍 All Projects</span>
}
Result: Badge correctly shows "🌍 All Projects" on /select-project route
Placeholder Text
Before:
/select-project: "Filter projects..."- Regular routes: "Search documentation..."
After:
/select-project: "Search across all projects..." ✅- Regular routes: "Search documentation..." ✅
Search Tips
On /select-project route:
Global Search
Searching across all available non-private projects.
• Find content in any project: "components", "API", "guide"
• Results show which project they're from
• Private projects excluded from results
• Use keyboard shortcuts: ⌘K or Ctrl+K
On regular routes:
Search Tips
• Search for specific features: "components", "services", "widgets"
• Find guides: "getting started", "build guide", "architecture"
• Look for libraries: "core-models", "theme", "ux-menu"
• Use keyboard shortcuts: ⌘K or Ctrl+K to search
📊 Behavior Matrix
| Route | Badge | Placeholder | Searches | Includes Private? |
|---|---|---|---|---|
/select-project |
🌍 All Projects | "Search across all projects..." | All non-private projects | ❌ No |
/Architecture/... |
📁 Architecture | "Search documentation..." | Architecture only | Only if you're in it |
/GoGrab-Pulse/... |
📁 GoGrab Pulse | "Search documentation..." | GoGrab-Pulse only | Only if you're in it |
/private/... |
📁 Private | "Search documentation..." | Private project only | ✅ Yes (you're in it) |
🔄 Search Flow Comparison
Before (Project Filter Mode)
User on /select-project searches "bit"
↓
performProjectFilter() called
↓
Searches project.name, project.displayName, project.description
↓
Returns: Projects with "bit" in metadata
↓
Problem: Doesn't search documentation content!
After (Content Search with Global Enable)
User on /select-project searches "bit"
↓
performContentSearch() called
↓
isSelectProjectRoute() → true → Global search enabled
↓
Searches documentation content across all projects
↓
Filters out private projects (if not in them)
↓
Returns: All pages containing "bit" from all public projects ✅
📁 Files Modified
Service
apps/docs-angular/src/app/services/search.service.ts- Changed
searchModeto always return'content-search' - Added
isSelectProjectRoutecomputed signal - Updated
performContentSearchto auto-enable global search on/select-project - Lines changed: ~15
- Changed
Component
apps/docs-angular/src/app/shared/global-search/global-search.component.ts- Updated badge to use
isSelectProjectRoute()instead ofsearchMode - Changed placeholder text for
/select-projectroute - Updated search tips for global search mode
- Lines changed: ~20
- Updated badge to use
🧪 Testing Scenarios
Test 1: Global Search on /select-project
1. Navigate to /select-project
2. Open search (Cmd/Ctrl + K)
3. Badge shows: "🌍 All Projects" ✅
4. Placeholder: "Search across all projects..." ✅
5. Type "api"
6. See results from multiple projects ✅
7. Each result shows project badge ✅
Test 2: Local Search on Project Route
1. Navigate to /GoGrab-Pulse/artists
2. Open search (Cmd/Ctrl + K)
3. Badge shows: "📁 GoGrab Pulse" ✅
4. Placeholder: "Search documentation..." ✅
5. Type "artist"
6. See results ONLY from GoGrab-Pulse ✅
Test 3: Private Project Exclusion
1. Navigate to /select-project
2. Open search
3. Type term that exists in private project
4. Results do NOT include private content ✅
5. Navigate to /private-project
6. Search same term
7. NOW private content appears ✅
Test 4: Badge Updates Correctly
1. Start on /GoGrab-Pulse (badge: "📁 GoGrab Pulse")
2. Navigate to /select-project
3. Badge automatically updates to "🌍 All Projects" ✅
4. Navigate back to /GoGrab-Pulse
5. Badge updates back to "📁 GoGrab Pulse" ✅
✅ Verification Checklist
- Global search works on
/select-project - Local search works on project routes
- Badge shows correct mode
- Placeholder text correct
- Search tips accurate
- Private projects excluded from global search
- Private projects searchable when inside them
- Results show project badges
- No linter errors
- Performance is good
🎉 Status
COMPLETE - Search now correctly performs global content search when on /select-project route, searching across all non-private projects. On regular project routes, it remains scoped to the current project. Privacy rules are enforced automatically.
Key Improvements
✅ Global Search Works: Searches content across all projects on /select-project
✅ Privacy Protected: Private projects automatically excluded
✅ Clear UI: Badge and placeholder reflect current mode
✅ Smart Behavior: Automatic switching between global and local
✅ User Intent: Does exactly what user expected
The search now works perfectly as intended! 🚀