Files
Investidor-V2/outputs/investmoz-navegacao-consolidacao-QA-20261016/focus-fix.py
T
nala cef6e201c7
tests / ci (push) Canceled after 0s
versao nrgocios 2
2026-10-16 20:11:05 +02:00

14 lines
1.5 KiB
Python

from pathlib import Path
p=Path('C:/Users/macbook/.config/investmoz/navegacao-consolidacao-QA-20261016/source')
def edit(f,a,b):
q=p/f;s=q.read_text('utf-8');assert a in s,(f,a[:100]);q.write_text(s.replace(a,b,1),'utf-8')
edit('resources/js/lib/portal-navigation.ts',"link('help', 'Apoio ao investidor', '/apoio'),", "link('help', 'Apoio ao investidor', access.context?.guidance || '/apoio'),")
edit('resources/js/components/dossier-navigation-context.tsx',"desk: string; land: string | null", "desk: string; land: string | null; guidance:string|null")
edit('resources/js/components/dossier-navigation-context.tsx'," if (!pref.installed)", " if(stopped)return;\n if (!pref.installed)")
edit('resources/js/components/dossier-navigation-context.tsx',"/^#S(0[1-9]|1[0-9])$/.test(hash)\n ? hash.slice(1)", "/^#S(0[1-9]|1[0-9])$/.test(window.location.hash)\n ? window.location.hash.slice(1)")
# The formatter split the expression; support the exact observed formatted variant below if needed.
q=p/'resources/js/components/dossier-navigation-context.tsx';s=q.read_text('utf-8');a=""" if (id !== active) router.visit(`/investimentos/${id}`);
else setReload((x) => x + 1);""";b=""" const target=`/investimentos/${id}${step?'#'+step:''}`;
if(url!==target)router.visit(target);else setReload((x)=>x+1);""";assert a in s;s=s.replace(a,b,1);q.write_text(s,'utf-8')
print('Explicit step selection persists without returning to an earlier URL hash')