You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Inicial structure for mobile and initial support for gsify (#52)
* refactor: prepare shell for mobile targets
Group modules by feature area instead of a flat modules tree. Add runtime target detection so desktop-only features can stay out of future mobile sessions.
Keep GJSify as an experimental separate build path with readable module output for review.
* feat(clipboard): enhance clipboard history functionality with sample actions and clear history option
feat(styles): update clipboard history styles for improved UI consistency
test(clipboard): add unit tests for clipboard log operations and positioning
test(ui): implement tests for clipboard panel layout and actions
fix(dash): handle potential errors in dash container positioning and actions
Copy file name to clipboardExpand all lines: AGENTS.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,16 +64,23 @@ Do not leave a task incomplete if either command reports errors or failures.
64
64
65
65
-`src/` — TypeScript source root
66
66
-`extension.ts` — entry point; iterates the registry and instantiates modules via each definition's `factory`
67
-
-`module.ts` — base `Module` class plus the shared `ModuleOption` / `ModuleMetadata` / `ModuleDefinition` types
67
+
-`module.ts` — base `Module` class plus the shared `ModuleOption` / `ModuleMetadata` / `ModuleDefinition`/ runtime policy types
68
68
-`registry.ts` — aggregator; imports each module's `definition` export and returns them in UI order (used by `extension.ts`)
69
69
-`prefsMetadata.ts` — pure metadata mirror for the prefs UI; cannot import modules because prefs runs in `gnome-extensions-app` (no `resource:///org/gnome/shell/*` available). Also exports `getSections()` (the ordered list of prefs sections)
70
70
-`prefs.ts` — generic extension preferences UI driven by `prefsMetadata.ts`; renders one `Adw.PreferencesGroup` per section
71
71
-`core/` — Clean Architecture core
72
72
-`context.ts` — `ExtensionContext` interface and implementation
73
73
-`logger.ts` — Abstracted logging
74
74
-`settings.ts` — `SettingsManager` abstraction for GSettings
75
-
-`modules/` — feature modules registered by `registry.ts`
76
-
- regular modules use one **folder** per feature module, named after the module (e.g., `dock/dock.ts`); the main entry file shares the folder name
75
+
- feature modules are grouped by semantic area instead of a single `modules/` root:
76
+
-`dock/` — dock module and dock-specific helpers
77
+
-`panel/` — GNOME panel and Quick Settings integrations
78
+
-`desktop/` — desktop-only modules such as tray icons
79
+
-`patches/` — focused Shell behavior patches and monkey-patches
80
+
-`theme/` — theme and color-scheme modules
81
+
-`privacy/` — privacy and screen-sharing behavior
82
+
-`clipboard/` — clipboard history module and UI
83
+
-`device/` — runtime target and hardware capability detection for future mobile work
77
84
-`dev/` — developer-only tooling (e.g., `devTool.ts`), gated behind the `AURORA_DEVTOOLS=1` env var. **Not** a feature module: it is not in the registry, prefs, or gschema, and is instantiated directly by `extension.ts`
78
85
-`shared/` — shared utilities used across modules (e.g., `quickSettings.ts`)
79
86
-`styles/` — SCSS stylesheets (compiled to light + dark CSS)
@@ -97,13 +104,13 @@ Do not leave a task incomplete if either command reports errors or failures.
97
104
98
105
1.**Settings via context:** Modules receive an `ExtensionContext` in their constructor and read configuration through `this.context.settings` (the `SettingsManager` abstraction) rather than touching `Gio.Settings` directly.
99
106
2.**`Main` is fair game:** Importing `Main` (`resource:///org/gnome/shell/ui/main.js`) directly is the idiomatic GNOME-extension way and is expected — there is no shell adapter. Confidence in shell interactions comes from the `tests/shell/` integration suite running a real headless GNOME Shell, not from mocking `Main`.
100
-
3.**Layering & testability:** Keep UI logic (Clutter/St) separated from pure domain logic. Extract complex algorithms into pure TypeScript files with no shell imports (e.g., `src/modules/dock/monitorTopology.ts`, `src/modules/trayIcons/trayState.ts`) so they can be unit-tested with `node --test`. UI/shell glue is covered by integration tests instead.
107
+
3.**Layering & testability:** Keep UI logic (Clutter/St) separated from pure domain logic. Extract complex algorithms into pure TypeScript files with no shell imports (e.g., `src/dock/monitorTopology.ts`, `src/desktop/trayIcons/trayState.ts`) so they can be unit-tested with `node --test`. UI/shell glue is covered by integration tests instead.
101
108
4.**Metadata-Driven UI:** The preferences window is generated dynamically from `src/prefsMetadata.ts` (a hand-maintained mirror of each module's metadata, kept in parity by `tests/unit/registry.test.ts`). If a module needs options, define them in the `options` array of its `ModuleDefinition` and mirror them into `prefsMetadata.ts`.
102
109
5.**Self-Registering Modules:** Each module file exports a `definition: ModuleDefinition` co-located with its class. The factory that constructs the module lives on the definition itself — `src/registry.ts` is a pure aggregator and never references module classes directly.
103
110
104
111
## Adding a Module
105
112
106
-
1. Create `src/modules/myModule/myModule.ts`with a `Module` subclass **and** a co-located `definition` export. Regular modules **must** live in their own folder named after the module (e.g., `dock/dock.ts`, `panel/panel.ts`).
113
+
1. Create a module in the appropriate semantic area with a `Module` subclass **and** a co-located `definition` export. Single-file patches can live directly in `src/patches/`; complex modules should use a feature folder such as `src/panel/myModule/myModule.ts`.
1.**Dependency Injection:**`extension.ts` instantiates an `ExtensionContext` and injects it into every module. **Modules must never use GNOME Shell globals (like `Main`, `Gio.Settings`) directly.**
25
+
1.**Dependency Injection:**`extension.ts` instantiates an `ExtensionContext` and injects it into every module. Modules read Aurora settings through `this.context.settings`; direct imports of GNOME Shell APIs such as `Main` are expected for Shell UI integration.
26
26
2.**Abstractions:**
27
27
- Use `this.context.settings` to interact with GSettings.
28
-
- Use `this.context.shell` for Shell-wide status (e.g., startup check, overview).
29
-
-This allows for easier mocking during unit tests.
28
+
- Use `this.context.device` for runtime target and hardware capabilities.
29
+
-Keep pure logic outside Shell imports when it needs unit coverage.
30
30
3.**Layering:** Separate UI orchestration (Clutter actors) from pure business logic. Complex logic should be extracted into standalone TypeScript functions or classes.
31
31
4.**Self-Registering Modules:** Each module file exports a `definition: ModuleDefinition` co-located with its class, including the factory that constructs it. `src/registry.ts` is a pure aggregator — it imports every `definition` and returns them in UI order. `extension.ts` iterates the registry and calls `def.factory(ctx)` directly; no central factory map exists.
32
32
5.**Metadata-Driven Preferences:** The preferences UI is generated dynamically from `src/prefsMetadata.ts`, a hand-maintained metadata mirror. Prefs cannot import `registry.ts` because it runs in `gnome-extensions-app` (GTK/Adw), which cannot resolve `resource:///org/gnome/shell/*` imports pulled in transitively by module classes. Parity between `registry.ts`, `prefsMetadata.ts`, and the GSettings schema is enforced by `tests/unit/registry.test.ts`.
33
33
34
34
## Adding a Module
35
35
36
-
1. Create `src/modules/myModule/myModule.ts` with a `Module` subclass **and** a co-located `definition` export. Every module **must** live in its own folder named after the module (e.g., `dock/dock.ts`, `trayIcons/trayIcons.ts`). For complex modules, split supporting logic into sibling files inside that folder (e.g., `trayIcons/sniHost.ts`, `trayIcons/trayContainer.ts`):
36
+
1. Choose the semantic source area, then create a `Module` subclass **and** a co-located `definition` export. Single-file modules can live directly in their area, for example `src/patches/myPatch.ts`; complex modules should use a subfolder, for example `src/panel/myPanelFeature/myPanelFeature.ts`.
37
+
38
+
Current source areas are `dock`, `panel`, `desktop`, `patches`, `theme`, `privacy`, and `clipboard`. Use `desktop` for desktop-only features such as tray icons. Add future hardware probes under `device`, not inside feature modules.
0 commit comments