diff --git a/resources/js/pages/investor-path/index.tsx b/resources/js/pages/investor-path/index.tsx
index 6416d8f3..ecd7a10c 100644
--- a/resources/js/pages/investor-path/index.tsx
+++ b/resources/js/pages/investor-path/index.tsx
@@ -77,6 +77,63 @@ export default function InvestmentContexts({
: {}),
...(guideSelection ? { investment_guide: guideSelection } : {}),
});
+ // A new reference (park, sector, article) is only kept through the explicit
+ // "continuar" action; opening an old dossier by its title would drop it.
+ const carrying = Boolean(zoneSource || sectorSource || contentSource);
+ const createForm = (
+
+ );
return (
@@ -155,13 +212,24 @@ export default function InvestmentContexts({
)}
-
- Prepare cada investimento no seu dossier. Pode trabalhar em
- várias etapas em paralelo.
-
+ {carrying && createForm}
+ {carrying && contexts.length > 0 ? (
+
+ Ou continuar num dossier que já tem
+
+ ) : (
+
+ Prepare cada investimento no seu dossier. Pode trabalhar
+ em várias etapas em paralelo.
+
+ )}
{contexts.map((item) => (
+ {carrying && (
+ {item.title}
+ )}
+ {!carrying && (
{item.title}
+ )}
Guardado em{' '}
{new Date(item.updated_at).toLocaleString('pt-MZ')}
@@ -251,56 +320,22 @@ export default function InvestmentContexts({
Continuar neste dossier com o artigo
)}
+ {carrying && (
+
+ Abrir este dossier sem acrescentar a nova
+ referência
+
+ )}
))}
{!contexts.length && (
Ainda não criou um investimento neste percurso.
)}
-
+ {!carrying && createForm}
Simulador
diff --git a/tests/frontend/sector-resource-reference.test.mjs b/tests/frontend/sector-resource-reference.test.mjs
index 43ecde59..b67b9cab 100644
--- a/tests/frontend/sector-resource-reference.test.mjs
+++ b/tests/frontend/sector-resource-reference.test.mjs
@@ -86,6 +86,13 @@ test('selected mining context reaches both new and existing dossier actions',()=
nodes(tree).find(n=>n.type==='form').props.onSubmit({preventDefault(){}});
assert.equal(posted[1][0],'/investimentos');
assert.deepEqual(posted[1][1].sector_reference,initial.sector_reference);
+ // Mapa de erros 4.7: the new idea is offered a new dossier first, and an old
+ // dossier is never opened by its title in a way that drops the reference.
+ const all=nodes(tree);
+ assert.ok(all.findIndex(n=>n.type==='form')n.type==='ul'));
+ const open=all.filter(n=>n.type===Link && n.props.href==='/investimentos/SYNTHETIC-case');
+ assert.equal(open.length,1);
+ assert.match(String(open[0].props.children),/sem acrescentar a nova referência/);
});
const energySource=JSON.parse(fs.readFileSync(new URL('database/data/energy-reference-20261111.json',root)));