Skip to content

FUSE: Integrate MountManager with App #11

@efimsky

Description

@efimsky

Parent Issue

Part of #118 (FUSE-based Archive & Remote Browsing Feature)

Summary

Integrate MountManager into the main App class to enable archive browsing on Enter key.

Dependencies

Requires #120 (Archive mounting operations)

Tasks

App Initialization

  • Add self.mount_manager: MountManager | None = None to App.__init__()
  • Initialize MountManager in App.setup() after color init
    from tnc.mount import MountManager
    self.mount_manager = MountManager()

Enter Key Handler

  • Modify Enter key handler in handle_key() (around line 437-443)
  • After self.active_panel.enter() returns a file path:
    • Check if path is an archive using mount_manager.is_archive()
    • If archive, call _enter_archive(path) instead of doing nothing
  • Implement App._enter_archive(path) method:
    • Call mount_manager.mount_archive(path)
    • If successful, navigate panel to mount point
    • If failed, show error message

Cleanup

  • Modify App.cleanup() to call mount_manager.unmount_all()
    def cleanup(self) -> None:
        if self.mount_manager:
            self.mount_manager.unmount_all()
        # ... existing cleanup

Panel Header Indicator

  • Modify Panel.get_header_text() to add [M] prefix when inside mount
  • Check if path starts with /tmp/tnc-mounts/
    if str(self.path).startswith('/tmp/tnc-mounts/'):
        header = "[M] " + header

Testing

  • Test App has mount_manager attribute after setup
  • Test App.mount_manager is a MountManager instance
  • Test cleanup() calls mount_manager.unmount_all()
  • Test Enter on archive mounts and navigates into it
  • Test Enter on archive shows error when mount fails
  • Test Enter on archive without tool shows appropriate error
  • Test panel header shows [M] when inside mount
  • Test panel header does NOT show [M] for normal directories

Files

  • Modify: tnc/app.py
  • Modify: tnc/panel.py
  • Create: tests/test_archive_browsing.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions