Skip to content

Half-removed onboarding flow: orphan fields + handlers in home_screen.dart + legacy shim in file_browser_screen.dart #10

@ehsan6sha

Description

@ehsan6sha

Audit finding: half-removed onboarding flows leave orphan state fields and handlers

Static analysis flags several unused fields, declarations, and locals concentrated in home_screen.dart plus one in file_browser_screen.dart. Pattern reads as "UI was refactored and removed loading spinners + cancel buttons, but the state-tracking fields and handler methods that fed them were left behind".

Findings

lib/features/home/screens/home_screen.dart

Line Symbol What it is Status
47 bool _isGettingApiKey API-key fetch in-progress flag SET (lines 72, 144, 149, 163) but never READ. Looks like the loading spinner that consumed it was removed.
48 bool _isLinkingWallet Wallet-link in-progress flag Likely same pattern — verify no UI reads it.
162 void _cancelGettingApiKey() Sets _isGettingApiKey = false No callers. Cancel button removed from UI.
188 final isFullySetup Local: isLoggedIn && hasJwt && hasAnyWallet Computed but never used. Suggests a UI branch that consumed it was deleted.
525 void _cancelLinkingWallet() Sets _isLinkingWallet = false and disconnects wallet No callers. Same as _cancelGettingApiKey.

Note _isGettingApiKey is reset to false by _setupApiKeyListener (line 72) when the API key deep-link callback arrives. That reset is also dead because nothing reads the flag — but removing it cleanly requires removing the field, not just the assignment.

lib/features/browser/screens/file_browser_screen.dart

Line Symbol What it is Status
3303 Future<void> _createShareLink(LocalFile file) Comment above it: "Legacy method for backward compatibility". Body: await _createShareForRecipient(file); Explicitly labelled as a shim; no callers. Safe to delete the shim once you confirm no callers via reflection / dynamic dispatch (unlikely in Flutter).

Risk

  • Low in isolation — deleting unused fields/methods is a mechanical change with no behavioural impact.
  • BUT: memory notes (project_fxfiles_fa1_three_mode_signup, project_mode_bc_not_ui_wired, project_pinning_webui_wasm_redeploy) show recent and ongoing work on auth / sign-up flows. The "Mode B/C not UI-wired" memory snapshot was 2026-05-19, closed same day — but the area is in flux. There's a non-zero chance these orphan fields/methods are reserved for in-progress re-wiring rather than truly dead.
  • _isGettingApiKey specifically sits inside _getApiKey and _setupApiKeyListener (the active deep-link API-key flow). Removing the field means tightening that flow's surface — small chance of breaking a parked branch.

Proposed fix (NOT APPLIED)

  1. Delete _isGettingApiKey, _isLinkingWallet, and the matching setters in _getApiKey, _setupApiKeyListener, _cancelGettingApiKey, _cancelLinkingWallet.
  2. Delete _cancelGettingApiKey and _cancelLinkingWallet methods.
  3. Delete unused local isFullySetup at line 188.
  4. Delete _createShareLink shim at file_browser_screen.dart:3303-3305.

Each is a 1-3 line deletion. Total ~15 lines removed.

Verification approach (NOT APPLIED)

  • Run flutter analyze to confirm no new warnings.
  • Run existing widget tests for home_screen and file_browser_screen to confirm no behaviour regression.
  • Manually test the API-key fetch + wallet-link flow end-to-end on a device to confirm the UI doesn't depend on these state fields via setState rebuilds we didn't see.

Recommendation

Defer pending owner confirmation that none of these are parked for an in-progress feature. If the owner confirms genuinely-dead, this is a quick janitorial PR. Easy to bundle with the other "info"-level cleanup PR (deprecated withOpacity migration, unused imports).

Tracking only — no code changes applied per "100%-sure-or-don't-touch" rule.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions