# Changelog

All notable changes to `com.amanotes.amadev` are documented here.

## [1.5.6] - 2026-07-22

### Fixed
- `LocalBuild` Android builds on Unity 6.0+: disable debug symbols via `AndroidBuildCompat` reflection shim instead of direct `UserBuildSettings.DebugSymbols` access (avoids compile errors when Android Extensions API is unavailable).

## [1.5.5] - 2026-05-20

### Changed
- Version aligned with Orchestra SDK v0.2.41 release.

## [1.5.4] - 2026-05-15

### Changed
- Auto-recognize packages in `LocalPackages/` folder for dev mode switching.

## [1.5.3] - 2026-05-10

### Changed
- Internal improvements to package discovery and dev mode switching.

## [1.5.2] - 2026-05-05

### Changed
- Internal improvements to preset generation and dev mode UI.

## [1.5.1] - 2026-04-30

### Added
- **Auto-sync `csc.rsp`** — `[InitializeOnLoad]` hook reads `AmaDevSettings` on every domain reload and writes `csc.rsp` if it's out of sync. Defines now take effect automatically without clicking Apply after Unity restarts.
- `AmaDevSettings.IsCscInSync` / `GatherExpectedSymbols` / `ParseCscRspSymbols` — internal helpers for comparing settings state against `csc.rsp` content.
- `SymbolDefineConfig.ReadCscSymbols()` — public accessor that returns a `HashSet<string>` of all symbols currently defined in `csc.rsp`.
- `LogV2Config.CleanStaleFiles` — after generating logger code, removes `.cs` files in the output folder that no longer correspond to any current tag. Prevents orphaned tag files from accumulating.
- `InternalsVisibleTo("Assembly-CSharp-Editor")` — allows project-level editor scripts to access AmaDev internals.
- `documentationUrl` field in `package.json`.

### Changed
- `ReadSymbols()` now syncs logger tag enabled state directly from `csc.rsp` via `SymbolDefineConfig.ReadCscSymbols()` instead of reading from the symbols list. Tags that exist only in `logV2.tags` (not in `symbolDefine.symbols`) now sync correctly.
- `LogV2Config.codeGeneratePath` default changed from `Assets/AmaGDK/LogV2` to `Assets/Generated/LogV2`.
- `package.json` description updated to include preset generation.

### Deprecated
- `SymbolDefine` (standalone ScriptableObject) — use `AmaDevSettings` instead. `[CreateAssetMenu]` removed; migration via `TryMigrateFromLegacy()` still works.
- `PresetGeneratorSettings` (standalone ScriptableObject) — use `AmaDevSettings` instead. `[CreateAssetMenu]` removed; migration via `TryMigrateFromLegacy()` still works.

### Fixed
- Logger tags not syncing from `csc.rsp` when the tag name wasn't also present in the symbols list.
- Dead `confirmed` field removed from `EditorInputDialog`.

## [1.5.0] - 2026-04-24

### Added
- `DevModeSwitcher.SearchForPackage(string packageName, DevModeConfig config)` — searches known directories for a subfolder whose `package.json` matches the given package name. Checks the current repo's `LocalPackages/` first, then `config.searchPaths`.
- `DevModeConfig.searchPaths` — persisted list of parent folders learned from previous local path assignments. Used as search roots for auto-discovery.
- `DevModeConfig.LearnSearchPath(string localPath)` — records the parent folder of a local path as a search root, with normalization to avoid duplicates.
- Auto-discovery in `DevModeTab` — when enabling dev mode, packages without a saved path are automatically searched via `SearchForPackage`. Per-package rows also auto-search before falling back to clipboard detection.

### Changed
- `DevModeSwitcher.BatchEnableDevMode` now returns `List<string>` (enabled package names) instead of `int` count.
- `DevModeSwitcher.BatchDisableDevMode` now returns `List<string>` (disabled package names) instead of `int` count.
- Dev mode log messages now list affected package names instead of just a count.
- Removed per-package `Debug.Log` calls from `EnableDevModeNoResolve` and `DisableDevModeNoResolve` — batch operations log a single summary instead.

## [1.4.0] - 2026-04-12

### Added
- `PresetGeneratorSettings` (`Amanotes.AmaDev`) — ScriptableObject that generates editor `[MenuItem]` scripts from prefab folders. Supports multiple entries, each with its own source folder, template asset, namespace, and output script. Create via `Assets > Create > AmaDev > Preset Generator Settings`.
- `PresetFolderEntry` — per-entry config: `sourceFolder`, `templateAsset`, `nameSpace`, `generatedScript`, `generatedClassName`.
- `PresetGeneratorSettingsEditor` — custom inspector with a `ReorderableList` for entries, per-entry info row (prefab count, folder path, class name), per-entry "Generate Entry [n]" button, and a "Generate All" button.
- `Preset-HierarchyTemplate.txt` — default template for hierarchy menu items. Supports `{{CLASS_NAME}}`, `{{NAME_SPACE}}`, `{{PREFAB_METHODS}}`, and `{{INSTANTIATE_PREFAB_METHOD}}` placeholders. The `InstantiatePrefab` helper is now self-contained (no Orchestra dependency).

### Changed
- `PresetGeneratorSettings` moved from `com.amanotes.orchestra` (`Amanotes.Orchestra` namespace) to `com.amanotes.amadev` (`Amanotes.AmaDev` namespace). Update `CreateAssetMenu` references from `Orchestra/Preset Generator Settings` to `AmaDev/Preset Generator Settings`.
- Template placeholder `{{INSTANTIATE_PREFAB_METHOD}}` replaces the hardcoded `InstantiatePrefab` helper that previously called `UnityExtension.InstantiatePrefabFromGuid`. The generated helper is now fully self-contained.

## [1.3.2] - 2026-04-11

### Fixed
- Package path info row now shows a clickable folder icon. Clicking it opens the folder in Finder/Explorer via `EditorUtility.RevealInFinder`. Icon is trimmed from the available width so the path text doesn't overlap it.

## [1.3.1] - 2026-04-08

### Added
- `DevModeGlobalToggle` — Persists global dev mode on/off state per-project in `Library/AmaDev/dev-mode-enabled.txt`.
- `DevModeSnapshot` — Persists the set of packages that should be in dev mode per-project in `Library/AmaDev/dev-mode-snapshot.json`. Used to restore the full dev set when re-enabling global dev mode.
- Global **Dev Mode: ON/OFF** button pinned to the bottom of the Packages tab. Batch-enables or disables all dev packages at once. Shows count: `Dev Mode: ON (4)` / `Dev Mode: OFF`.
- **⋯ context menu** per package row — "Change Path..." (hot-swaps if currently active) and "Remove Saved Path".
- `DevModeSwitcher.BatchEnableDevMode` / `BatchDisableDevMode` — Batch manifest operations with a single deferred resolve.

### Changed
- DEV buttons are disabled (grayed out) when global dev mode is OFF. Button state reflects the snapshot config, not the live manifest.
- Package name label is now white. DEV button text is dimmed (semi-transparent white).
- ×/+ visibility buttons are dimmed to match secondary label color.
- Version is always shown instead of the "local" source tag.
- Path info line has a right margin to avoid overlapping the button column.
- Row spacing increased for readability.
- `DrawPackagesTab` in `ProjectCP` uses absolute rect layout — list area is clipped, footer button is always pinned to the bottom regardless of content height.
- Individual DEV toggle now keeps the snapshot in sync (adding/removing from snapshot on toggle).

## [1.2.0] - 2026-04-08

### Added
- `DevModeConfig.ignoredPackages` — Persist a list of hidden packages. Toggle visibility per-package with `IsIgnored` / `SetIgnored`.
- `EditorInputDialog` — Modal editor window for text input. Used by manual restore flow (`EditorInputDialog.Show`).
- `DevModeSwitcher.FindEmbeddedPackageDir` — Locate embedded packages in the `Packages/` folder by scanning `package.json` names.
- `DevModeSwitcher.AddManifestEntry` / `RemoveManifestEntry` — Add or remove entries from `manifest.json` (supports embedded→dev and back).
- `DevModeSwitcher.IsFileReference` / `GetManifestValuePublic` — Query manifest state for a package.
- `DevModeSwitcher.ScheduleResolve` — Deferred `Client.Resolve()` (3s debounce) to batch multiple manifest changes.
- `DevModeTab` — Redesigned UI: DEV pill toggle button, source tags (git/local), collapsible "Other Packages" foldout for ignored packages, path info line with ellipsis trimming.
- `DevModeTab.HandleManualRestore` — Restore flow for externally-linked packages via `EditorInputDialog`.

### Changed
- `DevModeSwitcher.EnableDevMode` — Now supports embedded packages (backs up `package.json`, adds manifest entry). Validation moved to `ValidateLocalPath` call before path checks.
- `DevModeSwitcher.DisableDevMode` — Handles `embedded:` and `embedded` restore paths (restores `package.json.bak`, removes manifest entry).
- `DevModeSwitcher.SetManifestValue` — Rewritten to use `string.Replace` instead of regex group substitution.
- `DevModeSwitcher.ReadDisplayName` — Now checks embedded packages and `file:` references in addition to PackageCache.
- `DevModeSwitcher.ParseDependencies` — Rewritten with proper brace depth tracking and `EmitEntry` helper for reliable lock file parsing.
- `DevModeSwitcher.IsCustomPackage` — Now recognizes `embedded`, `local`, and `local-tarball` sources as custom packages.
- `DevModeTab.DrawRow` — Replaced toggle checkbox with colored DEV pill button. Added source tag labels and fixed-width layout.

### Fixed
- `ParseDependencies` brace counting could misparse nested JSON blocks — rewritten with explicit `topBraceDepth` / `pkgBraceDepth` tracking.
- `ReadDisplayName` returned null for embedded and file-referenced packages.

## [1.1.0] - 2026-04-07

### Added
- `DevModeSwitcher` — Switch packages between registry/git versions and local `file:` paths via manifest.json editing. Tracks original values in `DevModeState` for clean restore.
- `DevModeConfig` — Persistent config (`~/.amanotes/dev-paths.json`) mapping package names to local folder paths.
- `DevModeState` — Tracks which packages are in dev mode and their original manifest values. Stored in `Library/dev-mode-state.json`.
- `DevModeTab` — New tab in Project Control Panel listing custom packages with dev mode toggle.

## [1.0.0] - 2026-04-04

### Added
- `LocalBuild` — ScriptableObject for automated local builds (Android/iOS). Configures keystore, build targets, version/build number, pre/post-build hooks, and output folder. Custom inspector with one-click build trigger.
- `SymbolDefine` — ScriptableObject for managing C# define symbols via `csc.rsp`. Includes logger code generation (`LogV2`) with per-tag conditional logging.
- `ProjectCP` — Editor window (`Window/AmaDev`) for quick scene switching, play-from-scene, FPS and time scale control at runtime.
