From 46ada38d7f31b3c2fa314dc43a0ee2d06be69037 Mon Sep 17 00:00:00 2001 From: Mohammad Faiz Date: Thu, 23 Apr 2026 01:31:44 +0530 Subject: [PATCH 01/23] Create .gitignore --- .gitignore | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5af33c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +# Dependencies and build output +node_modules/ +dist/ +build/ +.next/ +target/ +__pycache__/ + +# Temp, coverage, and cache files +*.log +*.tmp +*.pid +.cache/ +coverage/ +.nyc_output/ + +# OS and IDE noise +.DS_Store +Thumbs.db +.idea/ +.vscode/settings.json + +# Secrets and local credentials +.env +.env.* +*.pem +*.key +*credentials*.json +*adminsdk*.json + +# Backup and editor swap files +*.bak +*.orig +*_old.* +*_copy.* +*.swp From 262477679f6e0d12710b25e3f8bd4f0351509b63 Mon Sep 17 00:00:00 2001 From: Mohammad Faiz Date: Thu, 23 Apr 2026 01:32:25 +0530 Subject: [PATCH 02/23] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ae345a..6a51979 100644 --- a/README.md +++ b/README.md @@ -317,7 +317,7 @@ If you're editing the markdown / wiki-link parser, Node.js unit tests live under node --test tests/ ``` -`tests/verify-brain-vault.mjs` is an optional end-to-end script that runs the extractor pipeline against a local markdown vault (set `BRAIN_VAULT=/path/to/vault` or edit the default). +`tests/verify-brain-vault.mjs` is an optional end-to-end script that always verifies the bundled fixtures and will also scan a real local vault when you set `BRAIN_VAULT=/path/to/vault`. ### Ideas for Contributions - [ ] Add support for more languages From 778a48e316e89e2d71207bdce9a27b1356d9eee2 Mon Sep 17 00:00:00 2001 From: Mohammad Faiz Date: Thu, 23 Apr 2026 01:33:22 +0530 Subject: [PATCH 03/23] Update index.html --- index.html | 209 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 156 insertions(+), 53 deletions(-) diff --git a/index.html b/index.html index 0bca0bd..8530bf2 100644 --- a/index.html +++ b/index.html @@ -11,19 +11,20 @@ - + + - - - - - - - - + + + + + + + + @@ -3287,7 +3366,12 @@ var _aj=useState(''),excludePatternDraft=_aj[0],setExcludePatternDraft=_aj[1]; var _ak=useState(false),launchFolderAfterExcludeSave=_ak[0],setLaunchFolderAfterExcludeSave=_ak[1]; var _al=useState(null),confirmDialog=_al[0],setConfirmDialog=_al[1]; + var _am=useState(window.innerWidth),viewportWidth=_am[0],setViewportWidth=_am[1]; + var _an=useState(null),mobilePanel=_an[0],setMobilePanel=_an[1]; + var _ao=useState(48),topbarHeight=_ao[0],setTopbarHeight=_ao[1]; + var isMobile=viewportWidth<=980; var svgRef=useRef(null); + var topbarRef=useRef(null); var filePreviewRef=useRef(null); var treemapRef=useRef(null); var matrixRef=useRef(null); @@ -3306,6 +3390,45 @@ useEffect(function(){document.body.className=theme==='light'?'light':'';},[theme]); + useEffect(function(){ + function onResize(){setViewportWidth(window.innerWidth);} + window.addEventListener('resize',onResize); + onResize(); + return function(){window.removeEventListener('resize',onResize);}; + },[]); + + useEffect(function(){ + if(!topbarRef.current)return; + function measureTopbar(){ + if(topbarRef.current){ + setTopbarHeight(topbarRef.current.offsetHeight||48); + } + } + measureTopbar(); + if(typeof ResizeObserver==='undefined'){ + window.addEventListener('resize',measureTopbar); + return function(){window.removeEventListener('resize',measureTopbar);}; + } + var observer=new ResizeObserver(measureTopbar); + observer.observe(topbarRef.current); + return function(){observer.disconnect();}; + },[]); + + useEffect(function(){ + if(!isMobile){ + setMobilePanel(null); + return; + } + setLegendCollapsed(true); + setShowGraphConfig(false); + },[isMobile]); + + useEffect(function(){ + if(!data){ + setMobilePanel(null); + } + },[data]); + useEffect(function(){ return function(){ if(confirmResolverRef.current){ @@ -3359,6 +3482,8 @@ setFolderFilter(null); setPrData(null); setFilePreview(null); + setMobilePanel(null); + setShowGraphConfig(false); } function openExcludeModal(continueToFolder){ @@ -3410,6 +3535,10 @@ }); } + function toggleMobilePanel(panel){ + setMobilePanel(function(prev){return prev===panel?null:panel;}); + } + function analyze(){ var p=parseUrl(repoUrl); if(!p){setError('Invalid URL. Use format: owner/repo');return;} @@ -4062,6 +4191,10 @@ if(file){ setSelected(file); setRightTab('details'); + if(isMobile){ + setMobilePanel('details'); + setLegendCollapsed(true); + } var blast=calcBlast(path,data.connections,data.files); setBlastRadius(blast); setOwnership(null); @@ -4075,7 +4208,7 @@ } updateGraphHighlight(path,blast); } - },[data,repoInfo,localDirHandle]); + },[data,repoInfo,localDirHandle,isMobile]); selectFileRef.current=selectFile; function updateGraphHighlight(path,blast){ @@ -5119,9 +5252,11 @@ function resetAnalysis(){setData(null);setSelected(null);setBlastRadius(null);setOwnership(null);setRepoInfo(null);setRepoUrl('');setPrData(null);setFolderFilter(null);setLocalDirHandle(null);window.history.replaceState({},'',window.location.pathname);} function filterByFolder(path){setFolderFilter(function(prev){return prev===path?null:path;});} var health=useMemo(function(){return calcHealth(data);},[data]); + var mobileSidebarWidth=Math.min(Math.max(viewportWidth-16,240),380); + var mobileRightPanelWidth=Math.min(Math.max(viewportWidth-16,240),460); - return React.createElement('div',{className:'app'}, - React.createElement('div',{className:'topbar'}, + return React.createElement('div',{className:'app',style:{'--topbar-height':topbarHeight+'px'}}, + React.createElement('div',{className:'topbar',ref:topbarRef}, React.createElement('div',{className:'logo',onClick:function(){setShowPrivacy(true);}}, React.createElement('div',{className:'logo-mark'},React.createElement(Icon,{name:'logo',size:'l'})), React.createElement('span',{className:'logo-text'},'CODEFLOW') @@ -5165,6 +5300,16 @@ ' Reset' ) ), + isMobile&&React.createElement('div',{className:'mobile-panel-actions'}, + React.createElement('button',{className:'top-btn'+(mobilePanel==='explorer'?' active':''),'aria-label':'Toggle explorer panel',onClick:function(){toggleMobilePanel('explorer');},type:'button'}, + React.createElement(Icon,{name:'folder',size:'m'}), + 'Explorer' + ), + React.createElement('button',{className:'top-btn'+(mobilePanel==='details'?' active':''),'aria-label':'Toggle details panel',onClick:function(){toggleMobilePanel('details');},disabled:!data,type:'button'}, + React.createElement(Icon,{name:selected?'file':'layout',size:'m'}), + selected?'Inspector':'Insights' + ) + ), React.createElement('div',{className:'topbar-actions'}, React.createElement('button',{className:'top-btn','aria-label':'Analyze Pull Request',onClick:function(){setShowPR(true);},disabled:!data||localDirHandle},React.createElement(Icon,{name:'pull-request',size:'m'}),'PR'), React.createElement('button',{className:'top-btn','aria-label':'Export analysis',onClick:function(){setShowExport(true);},disabled:!data},React.createElement(Icon,{name:'export',size:'m'}),'Export'), @@ -5173,7 +5318,17 @@ ) ), React.createElement('div',{className:'main'}, - React.createElement('div',{className:'sidebar',style:{width:sidebarWidth}}, + isMobile&&React.createElement('button',{type:'button',className:'mobile-panel-backdrop'+(mobilePanel?' visible':''),'aria-label':'Close mobile panel',onClick:function(){setMobilePanel(null);}}), + React.createElement('div',{className:'sidebar'+(isMobile&&mobilePanel==='explorer'?' mobile-visible':''),style:{width:isMobile?mobileSidebarWidth:sidebarWidth}}, + isMobile&&React.createElement('div',{className:'mobile-panel-header'}, + React.createElement('div',{className:'mobile-panel-meta'}, + React.createElement('div',{className:'mobile-panel-title'},'Explorer'), + React.createElement('div',{className:'mobile-panel-subtitle'},data?(folderFilter?'Filtered by '+folderFilter:data.files.length+' files ready to browse'):'Analyze a repo or open a folder') + ), + React.createElement('button',{className:'mobile-panel-close',type:'button','aria-label':'Close explorer panel',onClick:function(){setMobilePanel(null);}}, + React.createElement(Icon,{name:'close',size:'m'}) + ) + ), React.createElement('div',{className:'resize-handle',onMouseDown:function(e){ e.preventDefault(); var startX=e.clientX,startW=sidebarWidth; @@ -5332,7 +5487,16 @@ tooltip&&React.createElement('div',{className:'tooltip',style:{left:tooltip.x,top:tooltip.y}},React.createElement('div',{className:'tooltip-title'},tooltip.title),React.createElement('div',{className:'tooltip-content'},tooltip.content)) ) ), - React.createElement('div',{className:'right-panel',style:{width:rightPanelWidth}}, + React.createElement('div',{className:'right-panel'+(isMobile&&mobilePanel==='details'?' mobile-visible':''),style:{width:isMobile?mobileRightPanelWidth:rightPanelWidth}}, + isMobile&&React.createElement('div',{className:'mobile-panel-header'}, + React.createElement('div',{className:'mobile-panel-meta'}, + React.createElement('div',{className:'mobile-panel-title'},selected?selected.name:'Insights'), + React.createElement('div',{className:'mobile-panel-subtitle'},selected?selected.path:(data?'Browse issues, patterns, and security findings':'Select a file to inspect it')) + ), + React.createElement('button',{className:'mobile-panel-close',type:'button','aria-label':'Close details panel',onClick:function(){setMobilePanel(null);}}, + React.createElement(Icon,{name:'close',size:'m'}) + ) + ), React.createElement('div',{className:'resize-handle',onMouseDown:function(e){ e.preventDefault(); var startX=e.clientX,startW=rightPanelWidth; From 1332387e35517ef19f36566212ee2ee72f839909 Mon Sep 17 00:00:00 2001 From: Mohammad Faiz Date: Thu, 23 Apr 2026 21:46:33 +0530 Subject: [PATCH 22/23] Update index.html --- index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 6df8ca6..a659104 100644 --- a/index.html +++ b/index.html @@ -17,13 +17,13 @@ - - - - - - - + + + + + + +