refactor: rename MyLibrary to FileBrowser (#1260)

## Summary

* Renames MyLibrary component to FileBrowser, as it better reflects what
it is, in my opinion

## Additional Context

* Frees the Library name for possible future library component that can
cache metadata, provide other ways of browsing than filesystem
structure, etc
---

### AI Usage

Did you use AI tools to help write this code? _**< YES >**_
This commit is contained in:
Arthur Tazhitdinov
2026-03-02 11:00:53 +01:00
committed by GitHub
parent 7dc518624c
commit f0a549b680
11 changed files with 33 additions and 33 deletions
+35
View File
@@ -0,0 +1,35 @@
#pragma once
#include <functional>
#include <string>
#include <vector>
#include "../Activity.h"
#include "RecentBooksStore.h"
#include "util/ButtonNavigator.h"
class FileBrowserActivity final : public Activity {
private:
// Deletion
void clearFileMetadata(const std::string& fullPath);
ButtonNavigator buttonNavigator;
size_t selectorIndex = 0;
// Files state
std::string basepath = "/";
std::vector<std::string> files;
// Data loading
void loadFiles();
size_t findEntry(const std::string& name) const;
public:
explicit FileBrowserActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, std::string initialPath = "/")
: Activity("FileBrowser", renderer, mappedInput), basepath(initialPath.empty() ? "/" : std::move(initialPath)) {}
void onEnter() override;
void onExit() override;
void loop() override;
void render(RenderLock&&) override;
};