Repository navigation
Support searching organizations by name #444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,17 +15,15 @@ const LANG_COLORS = ['#22c55e', '#f5c518', '#3b82f6', '#ef4444', '#a855f7', '#f9 | |
| const fmt = n => n > 999 ? (n / 1000).toFixed(1) + 'k' : String(n) | ||
|
|
||
| export default function OverviewPage() { | ||
| const { orgs, model, totalRepo, isComplete, loading, runFullExplore } = useApp() | ||
| const { orgs, model, totalRepo, isComplete, loading, runFullExplore, failedOrgNames = [], lastOrgNames = [] } = useApp() | ||
| const { theme } = useTheme() | ||
| const navigate = useNavigate() | ||
| const [open, setOpen] = useState(false) | ||
| const [orgFilter, setOrgFilter] = useState('All Organizations') | ||
| const [showAllOrgs, setShowAllOrgs] = useState(false) | ||
| const infoRef = useRef(null) | ||
| const location = useLocation(); | ||
| const chips = location.state?.chips || []; | ||
| const verifiedOrgs = orgs.map(o => o.login); | ||
| const notVerifiedOrgs = chips.filter(c => !verifiedOrgs.some(org => c.trim() === org)); | ||
|
|
||
|
|
||
| useEffect(() => { | ||
| function handleClickOutside(event) { | ||
|
|
@@ -110,9 +108,9 @@ export default function OverviewPage() { | |
| onRun={runFullExplore} | ||
| /> | ||
| {/* Org identity bar */} | ||
| {chips.length > orgs.length && ( | ||
| {failedOrgNames.length > 0 && ( | ||
| <div className="text-amber-400 mb-4"> | ||
| {`Analysis completed with warnings: ${chips.length - orgs.length} of ${chips.length} organizations could not be loaded: ${notVerifiedOrgs.join(', ')}.`} | ||
| {'Analysis completed with warnings: ' + failedOrgNames.length + ' of ' + lastOrgNames.length + ' organizations could not be loaded: ' + failedOrgNames.join(', ') + '.'} | ||
|
Comment on lines
+111
to
+113
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Externalize the new warning text. The warning at The repository has no i18n library or resource files. Meeting the requirement means adding a localization setup. That setup is a broader change than this feature. Treat it as a follow-up and move the warning text into the resource files once that setup exists.
|
||
| </div> | ||
| )} | ||
| <div | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: AOSSIE-Org/OrgExplorer
Length of output: 8109
Persist failed organization names with the cached analysis.
After a partial run, the cached model keeps only the organizations that resolved. The cache also stores
lastOrgNames, which includes the names that failed.failedOrgNamesis not stored or restored. After a reload,failedOrgNamesis[], so the overview warning is not shown. Users then see a partial analysis without any notice that some inputs were not loaded.Suggested fix
Restore the value in the startup hydration:
setLastOrgNames(cached.lastOrgNames || []) + setFailedOrgNames(cached.failedOrgNames || [])Also add
failedOrgNamesto the object that the persist effect writes, next tolastOrgNames, and to that effect's dependency list. This keeps the warning state with the restored analysis.