fix: read flows from ~/.chain after config-dir rename

The platform's operator config dir moved ~/.fai -> ~/.chain; the flow
editor read saved flows + layouts from the old path, so it found nothing
after the rename. Update the hardcoded ~/.fai/data/flows paths to
~/.chain.

Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
flemming-it 2026-06-16 09:40:22 +02:00
parent 0ebc319808
commit a0a5038ad7
3 changed files with 5 additions and 5 deletions

View file

@ -49,7 +49,7 @@ String _defaultFlowsDir() {
Platform.environment['HOME'] ?? Platform.environment['HOME'] ??
Platform.environment['USERPROFILE'] ?? Platform.environment['USERPROFILE'] ??
'.'; '.';
return '$home/.fai/data/flows'; return '$home/.chain/data/flows';
} }
class FlowEditorPage extends StatefulWidget { class FlowEditorPage extends StatefulWidget {

View file

@ -18,7 +18,7 @@
// //
// Storage layout: // Storage layout:
// //
// ~/.fai/data/flows/.layout/<flow-name>.json // ~/.chain/data/flows/.layout/<flow-name>.json
// //
// One file per flow. JSON shape: // One file per flow. JSON shape:
// //
@ -93,7 +93,7 @@ class NodePosition {
/// graph view loads / saves them at well-defined moments /// graph view loads / saves them at well-defined moments
/// (open file, drag end), not in the render loop. /// (open file, drag end), not in the render loop.
class LayoutStore { class LayoutStore {
/// Directory `~/.fai/data/flows/.layout/`, created on first /// Directory `~/.chain/data/flows/.layout/`, created on first
/// write. Hidden so it doesn't show up in `fai admin /// write. Hidden so it doesn't show up in `fai admin
/// flows list` style enumerations. /// flows list` style enumerations.
static String defaultDir() { static String defaultDir() {
@ -101,7 +101,7 @@ class LayoutStore {
Platform.environment['HOME'] ?? Platform.environment['HOME'] ??
Platform.environment['USERPROFILE'] ?? Platform.environment['USERPROFILE'] ??
'.'; '.';
return '$home/.fai/data/flows/.layout'; return '$home/.chain/data/flows/.layout';
} }
/// Load the layout for [flowName]. Returns an empty layout /// Load the layout for [flowName]. Returns an empty layout

View file

@ -15,7 +15,7 @@
// 4. The flow's outputs once the run resolves. // 4. The flow's outputs once the run resolves.
// //
// The tab requires the file to be saved on disk the hub's // The tab requires the file to be saved on disk the hub's
// runSavedFlow reads from `~/.fai/data/flows/<name>.yaml`, // runSavedFlow reads from `~/.chain/data/flows/<name>.yaml`,
// not from the in-memory buffer. The dirty banner reminds // not from the in-memory buffer. The dirty banner reminds
// the operator to save before running so they don't run a // the operator to save before running so they don't run a
// stale version by surprise. // stale version by surprise.