# Changelog

## [8.4.4] - 2026-08-16

### Fixed

- **Foundry-hidden tokens no longer reveal their locations through special-sense indicators**: Scent, Lifesense, Thoughtsense, Echolocation, and blind/deaf fallback indicators now respect the GM's Foundry Hidden toggle in every selected-token perspective, including perspectives viewed from a GM account.
- **Selecting or dragging a token as GM now hides other Foundry-hidden tokens from that token's perspective**: Visioner suppresses hidden token art, chrome, interaction surfaces, and nested movement-refresh repaints while the observer perspective is active, then restores Foundry's normal GM hidden-token view after deselection.

## [8.4.3] - 2026-08-12

### Fixed

- **Players can now hover and directly target tokens revealed from GM Hidden after joining a scene**: Tokens that were already Foundry-hidden before the player loaded the scene now regain Foundry's normal token-shaped hit area when revealed, restoring hover borders and direct targeting while preserving the GM's ghosted hidden-token interaction.
- **Deselecting a player-owned token after it is hidden no longer causes a libWrapper console error**: Visioner's intentional hidden-token hover guard now uses libWrapper's conditional wrapper contract, so clearing token selection can safely make the token non-interactive without libWrapper unregistering the guard.

## [8.4.2] - 2026-08-07

### Fixed

- **Corner and door peeking now respects Proximity Sight wall restrictions**: Visibility uses the actual peek origin for proximity thresholds, attenuation distance, and Levels 3D collision checks, so peeking cannot bypass restricted walls while still allowing sight when the peek point is within range.
- **Tokens revealed from GM Hidden after a scene loads can now be selected immediately**: Visioner preserves the interaction state Foundry rebuilds during a token's first reveal instead of restoring the disabled hit area and pointer state captured while it was hidden.

## [8.4.1] - 2026-08-02

### Added

- **Active Perceptive conflicts now show a persistent GM-only warning banner**: The non-dismissible banner explains that running both modules is unsupported and can cause severe lag or visibility and door-peeking conflicts. Its **Disable Perceptive** button updates Foundry's module configuration and opens the standard world-reload confirmation.

## [8.4.0] - 2026-08-01

### Added

- **Hidden hazards and loot now have a persistent GM-only canvas marker**: An orange Hidden eye-slash frame identifies placeables that are Visioner Hidden from the selected token. With no token selected, the marker appears when the placeable is Hidden from any scene token, and it is restored after canvas refreshes or token redraws.

### Changed

- **Converting PF2e visibility conditions on hazards and loot now produces Visioner Hidden state**: Standalone Hidden or Undetected conditions are converted for player-character observers as persistent pair visibility instead of leaving an unsupported creature-style Undetected override on these placeables.
- **Visioner Hidden hazards and loot behave as fully undetected interaction surfaces for players**: Their token art, chrome, hover response, hit area, and pointer cursor remain unavailable until the relevant observer reveals them; observed placeables and GM interaction retain Foundry Core behavior.

### Fixed

- **Holding Alt no longer reveals the outline of a Hidden hazard or loot token to players**: Visioner reasserts its hard-hidden token border after Foundry's object-highlighting refresh while preserving normal Alt outlines for observed tokens.
- **Foundry V13 Levels no longer reveals tokens or creates soundwaves through floors during movement**: Legacy 2D sight polygons are supplemented with Levels' 3D sight collision for live reveal, hard-hide, and soundwave decisions. Foundry V14 remains delegated to Core's 3D visibility handling.
- **Creating tokens on Levels scenes no longer turns existing tokens transparent**: Visioner leaves Foundry's initial new-token control pass untouched instead of applying selected-level suppression before Core finishes placing the token.

## [8.3.49] - 2026-07-31

### Fixed

- **Tokens hidden by Levels line of sight no longer flash between render passes on Foundry V13**: Visioner preserves Levels' completed hidden result between V13 refreshes, then restores rendering immediately when Levels' own line-of-sight polygon reveals the token. Foundry V14 and scenes without configured Levels remain unchanged.

## [8.3.48] - 2026-07-31

### Fixed

- **Selecting, hovering, or switching tokens no longer flashes tokens from other levels**: Visioner suppresses covered tokens before Foundry changes the active level and keeps that suppression through token, detection-filter, tooltip, and soundwave refreshes. Deselecting still restores the full all-level scene view.
- **Dragging or moving a selected token no longer causes rapid multi-level flicker**: Visioner keeps the original token's vision source stable while Foundry initializes its drag preview and avoids forcing incomplete preview or movement frames visible.
- **Tokens outside a level's defined surface region remain visible**: Core's level culling, Visioner hard hiding, detection filters, and movement soundwaves now agree that off-surface tokens belong to the unrestricted scene view, while tokens hidden through Foundry's own toggle remain protected.

## [8.3.47] - 2026-07-31

### Fixed

- **Undetected tokens no longer reveal their elevation text on Foundry V13 or V14**: Visioner now re-hides elevation tooltips rebuilt by Core for Undetected and detection-filter-only tokens, while Observed tokens retain their normal elevation display.

## [8.3.46] - 2026-07-31

### Fixed

- **Moving tokens now follow live line of sight without disappearing, flashing, or staying stuck in a stale Undetected state**: During drags and committed movement, Visioner defers stale stored visibility to Foundry's current line of sight, preserves valid reveals while AVS settles, and returns rendering to the settled AVS state when the batch completes.
- **Soundwaves now switch cleanly to and from full token art during movement**: Active soundwaves are re-evaluated against current line of sight even while stored visibility temporarily lags. Removing or settling a soundwave no longer leaves the target invisible, reveals full art without sight, or keeps a stale soundwave after sight opens.
- **Multi-level scenes no longer lose Core scene surfaces when Visioner hides an unseen token**: Visioner now preserves Foundry's multi-level renderability, hides only the affected token's visual layers, and defers its hard-hide pass until Core finishes refreshing the scene level.
- **Deselecting tokens now restores the full multi-level scene for GMs**: Visioner returns to the previous all-levels view instead of leaving the canvas locked to the selected token's floor, preventing other decks or floors from disappearing after token selection.
- **Foundry V13 no longer shows condition icons for unseen tokens after movement**: Visioner keeps condition and effect icons hidden while a token is Undetected or represented only by a soundwave or another detection filter, then restores them when the token becomes Observed again. Foundry V14 behavior is unchanged.

## [8.3.45] - 2026-07-31

### Fixed

- **Scenes without Token Vision now defer visibility entirely to Foundry Core**: Visioner skips AVS processing, visibility overrides, hard hiding, detection wrappers, movement soundwaves, and visibility indicators while Token Vision is disabled. Changing the setting also clears stale Visioner render effects without altering saved visibility states, preventing tokens from remaining transparent and allowing Visioner behavior to resume when Token Vision is re-enabled.

## [8.3.44] - 2026-07-31

### Fixed

- **Tokens no longer vanish from stale Undetected states while AVS is inactive**: Visioner's hard-hide rendering now ignores old automatically calculated visibility data when AVS is disabled or combat-only AVS is outside an encounter. Explicit manual Undetected overrides remain supported.
- **Undetected tokens now hide rebuilt effect icons**: Hard-hide refreshes now discover replacement token-effect containers created by PF2e or other modules instead of only hiding the original container.

## [8.3.43] - 2026-07-28

### Fixed

- **Roll-context visibility now applies as a temporary attack state**: Effects such as Elemental Rage temporarily expose the matching target as Concealed during the attack, allowing Flat Check Helper to provide its native DC 5 check with AVS enabled or disabled, then restore the target's prior visibility without persistent conditions or canvas changes.

## [8.3.42] - 2026-07-28

### Fixed

- **Roll-context visibility works without a rule-level predicate**: Effects such as Elemental Rage now apply their contextual Concealed state during real ranged attacks without PF2e throwing an error when the `PF2eVisionerEffect` rule element has no top-level predicate.

## [8.3.41] - 2026-07-28

### Changed

- **Roll-context visibility now uses native PF2e selectors and predicates**: Contextual `overrideVisibility` operations declare their roll domains with `selectors`, while their predicates are passed unchanged to PF2e for evaluation. Elemental Rage concealment can now use `selectors: ["attack-roll"]` with `predicate: ["item:ranged"]` instead of Visioner recognizing a hardcoded ranged predicate.

## [8.3.40] - 2026-07-28

### Added

- **Effects can now make their actor Concealed only against ranged attacks**: An `overrideVisibility` operation using the `origin:item:ranged` predicate now supplies Concealed only to incoming ranged attack rolls, covering Elemental Rage's visibility benefit without a distance approximation or persistent token concealment.

### Performance

- **Large combats no longer repeat full combat-tracker row searches for every participant**: Visioner now indexes Foundry and PF2e HUD combatant rows once per tracker visibility pass, reuses unchanged Stealth initiative markers, and skips redundant DOM writes to reduce pan stutter in encounters with many participants.

## [8.3.39] - 2026-07-27

### Fixed

- **Selected tokens could disappear or remain soundwave-only while moving in complete darkness**: Controlled tokens and their drag previews now remain visible as full token art throughout selection and movement, while soundwaves continue to apply only to other heard tokens.
- **Heard tokens could lose their soundwaves during movement through complete darkness**: Visioner now preserves Foundry's valid soundwave render surface when geometric line of sight crosses darkness but the observer-target state remains Hidden.
- **Non-token deletions could trigger unnecessary Auto Cover cleanup**: The deletion hook now exits for effects, actors, and other non-token documents instead of running token-pair cleanup for every document type.

### Performance

- **Reduced validated settings work during movement and visibility rendering**: Frequently used Visioner setting values are now cached and updated immediately when settings change, avoiding hundreds of repeated Foundry validation calls along a token path.

## [8.3.38] - 2026-07-27

### Fixed

- **Soundwaves could disappear or reveal full token art while moving in complete darkness**: Heard tokens now retain their soundwave-only rendering across control, drag-preview, and committed-movement refreshes, including observers blinded by darkness.
- **Manual cover could be recorded with the wrong original state on attack rolls**: Attack-roll overrides now preserve existing manual cover as their base state instead of treating it as undetected automatic cover.

### Performance

- **Reduced repeated work during token visibility refreshes**: Visioner now reads each detection setting once per refresh instead of repeatedly invoking Foundry's validated settings lookup for every nested detection check.
- **Moved soundwave observer discovery behind its movement throttle**: Active soundwaves still render every frame, while expensive observer and visibility work runs only when due; GM Vision cleanup remains immediate.

## [8.3.37] - 2026-07-26

### Fixed

- **Tokens heard through sight-blocking walls could appear fully visible instead of as soundwaves**: When a wall blocks sight but allows sound, Visioner now keeps Foundry's hearing filter unless the observer currently has precise visual line of sight. Precise nonvisual senses such as echolocation continue to reveal the full token.

## [8.3.36] - 2026-07-26

### Fixed

- **Foundry-hidden tokens could still add movement-processing overhead on token-heavy scenes**: Visioner now excludes tokens hidden with Foundry Core's token toggle before viewport position resolution and movement spatial-index construction, preventing irrelevant hidden tokens from consuming position and indexing work.

## [8.3.35] - 2026-07-26

### Fixed

- **Visioner could reduce performance outside combat with AVS Only Active in Combat enabled**: Detection-mode visibility now bypasses Visioner token-state processing while the combat gate is closed, preserving Foundry Core detection behavior and avoiding repeated Visioner work on token-heavy scenes.

## [8.3.34] - 2026-07-26

### Fixed

- **Line of Sight Cover Regions could grant cover through empty areas inside their bounding box**: Boundary checks now use Foundry's canonical RegionDocument polygons, so diagonal, rotated, concave, separated, and holed regions grant cover only when the line of sight crosses their drawn geometry.

## [8.3.33] - 2026-07-25

### Fixed

- **Attack cards could report Hidden or Undetected while Visioner Manager showed Observed**: The visibility-factor API now reads the canonical observer-target state, including the sparse Observed default, and uses that same state for its explanation, preventing contradictions such as Undetected with Bright Light.
- **Manually set visibility states could be attributed to darkness or another automatic factor**: Visibility explanations now identify Token Manager and API manual states as a Manual Override instead of presenting an environmental condition as their cause.
- **Blinded and Deafened observers could show only Blinded as the reason for an Undetected target**: Combined sensory loss now displays Blinded + Deafened and explains that both vision and hearing are unavailable.
- **Converted PF2e visibility conditions could appear as an unexplained Stored State**: Hidden, Concealed, and Undetected conditions converted into permanent Visioner overrides now display System Conversion, while the tooltip identifies the original PF2e condition.

## [8.3.32] - 2026-07-24

### Fixed

- **Dazzled could be shown as the visibility reason when the target was already Hidden**: Dazzled now appears only when the target would otherwise be Observed or Concealed, so Hidden, Undetected, and Unnoticed keep precedence and the attack card reports the relevant visibility factor.
- **Cover regions could still apply cover in empty areas inside their bounding box on Foundry v14**: Exact containment checks now use the real v14 `RegionDocument` API and its required elevation coordinate, so separated, concave, and diagonal region shapes grant cover only inside their drawn geometry.

## [8.3.31] - 2026-07-21

### Fixed

- **Cover regions could apply cover outside their drawn shapes**: Concave regions and regions made from separated shapes could treat empty space inside their overall bounding box as covered. Region cover now respects the exact drawn shape boundaries.
- **Visibility and cover icons could remain stranded on the map after hovering, zooming, or changing scenes**: Replacing an indicator now destroys its previous DOM and PIXI elements, leaving a token during pan or zoom cancels deferred hover restoration, and pending visibility-factor requests are discarded when their overlay or canvas is torn down.

## [8.3.30] - 2026-07-20

### Fixed

- **Living tokens could briefly flicker into view when an encounter ended with AVS Only Active in Combat enabled**: Combat-end visibility and detection state cleanup now runs as one non-rendering batch, suppresses rendering while temporary AVS effects are removed, then performs a single Foundry Core perception refresh after cleanup is complete.

## [8.3.29] - 2026-07-20

### Fixed

- **Tokens could still remain visible and targetable through walls with Auto Visibility disabled**: The 8.3.28 safeguard did not cover GM selected-token view, where a stored Observed state could still override Foundry Core's current wall line of sight. Visioner now releases only render state it explicitly hard-hid, while Foundry-hidden tokens retain their normal GM ghost visibility.

## [8.3.28] - 2026-07-19

### Fixed

- **Players could see NPCs through walls after previously seeing them when Auto Visibility was disabled**: A stored Observed state could make Visioner force a Core-hidden NPC mesh visible even though Visioner had not hidden it, overriding Foundry's current wall line of sight. Player rendering now remains under Foundry Core unless Visioner is releasing one of its own hard-hidden states; GM visibility behavior is unchanged.
- **Hovering an owned token could reveal an undetected NPC's location while Auto Visibility was enabled**: Target-mode hover badges checked how the NPC saw the hovered character without first checking whether that character knew the NPC existed. Player hover overlays now suppress observers that are Undetected or Unnoticed from the hovered character's perspective, while GMs and known-location Hidden targets remain unaffected.

## [8.3.27] - 2026-07-19

### Added

- **Distracting Performance can now apply Create a Diversion to an ally**: When the performer has Distracting Performance, targeting exactly one allied token before opening or applying the diversion results makes that ally Hidden from observers beaten by the Performance check instead of hiding the performer. Failed checks leave the ally's existing visibility unchanged, and no valid ally target (or multiple allied targets) safely falls back to the normal self-benefit. Preview, apply, and revert all preserve the chosen beneficiary.

## [8.3.26] - 2026-07-19

### Added

- **Tiles can now provide cover**: Tile Configuration now includes Visioner cover controls matching wall cover states. A tile can provide lesser, standard, or greater cover whenever an attack line crosses it, or explicitly provide no cover.

### Changed

- **AVS validation now makes observer and target roles clear on the canvas**: Hovering a validation row adds readable `OBSERVER · SEES` and `TARGET · state change` labels alongside the existing blue and yellow borders. Label size adapts to canvas zoom so the text remains readable when zoomed out without overwhelming tokens when zoomed in.
- **Queued AVS validations can now be reviewed in any order**: The validation tooltip now has Previous and Next buttons plus a queue-position counter. GMs can browse every pending token change without accepting or rejecting the currently displayed item first.

### Fixed

- **Loot and hazard tokens could remain visible through walls in a GM's selected-token view**: Non-hidden loot and hazards remain available to the GM, but now obey the selected observer's line of sight through solid walls and closed doors like regular tokens. Foundry-hidden and Visioner-hidden states continue to hide them normally.
- **Accept All could leave other AVS validations queued and immediately reopen the indicator**: Accept All now collects every pending validation, closes the indicator immediately, removes the accepted overrides as one batch, and performs one final AVS recalculation instead of repeatedly refreshing and re-queuing work between individual changes.

## [8.3.25] - 2026-07-17

### Fixed

- **GM Vision could still apply Visioner visibility states and effects**: GM Vision now leaves token rendering entirely to Foundry Core, ignoring both automatic and manual Visioner visibility states and clearing Visioner hard-hide, soundwave, filter, sharing, and system-hidden indicator effects.
- **Manual Visioner states stopped working with GM Vision off when Auto Visibility was disabled**: Auto Visibility's highlight cleanup incorrectly released manually hidden tokens during refreshes, making target tokens flash when hovered. Manual states now remain active whenever GM Vision is off, including with Auto Visibility disabled.

## [8.3.24] - 2026-07-15

### Fixed

- **The Visibility Factors tooltip never explained why a dazzled observer saw a target as concealed**: The reason-lookup loop meant to check the observer's other precise senses read a sense array as if it were a lookup object, so its "does this observer have another precise sense besides vision" check always came back true - even for an observer with no other precise sense at all. This silently blocked the dazzled explanation from ever being recorded, leaving the tooltip's fallback "reason not captured" text instead. Also fixed: the reason's own translation string was misplaced outside the block other reason strings live in, so an untranslated key showed up in place of the message even once the logic was fixed.
- **A benign "could not resolve token objects for dialog override" warning logged on nearly every attack roll**: The check meant to guard against unresolved attacker/target tokens also caught two completely normal, non-error cases - a manual cover override already in place, or the player accepting the auto-detected cover unchanged - and logged the same warning for all three situations. The warning now only fires when the tokens are actually unresolved.
- **A deafened observer never got credit for being deafened in the Visibility Factors tooltip**: The list of an observer's own conditions only ever checked for blinded, so a deafened observer trying to pinpoint an invisible target by hearing alone never saw that explanation, and was silently treated as having full hearing even while deafened. Deafened is now recognized alongside blinded.

## [8.3.23] - 2026-07-14

### Fixed

- **PF2e Party actor tokens were treated like ordinary combatants by Auto Visibility and move-time detection**: A token whose actor is the special "party" sheet type has no vision or stealth of its own, but Auto Visibility still evaluated it as an observer and target, and the during-move soundwave engine still scanned it for hearing-based indicators. Party actor tokens are now excluded from both roles in Auto Visibility, from movement-time detection, and from soundwave scans; ordinary characters and NPCs that merely belong to the party (by alliance or ownership) are unaffected.
- **Rolling initiative for multiple combatants at once ("Roll All"/"Roll NPCs") could roll the dice but never save anyone's initiative**: PF2e commits a batch roll's initiative values in a single write, only after every individual roll in the batch finishes. The GM's stealth-initiative cover dialog reused one fixed window id across every open instance, so two or more Stealth-rolling combatants in the same batch collided on that id and left at least one dialog impossible to resolve, stalling the whole batch indefinitely - even for combatants who weren't using Stealth at all. Each cover dialog now gets its own unique window id.

## [8.3.22] - 2026-07-14

### Added

- **Stealth-initiative cover is now set by the GM, not auto-applied or left to the rolling player**: When a token rolls Stealth for initiative, the module used to silently auto-detect cover - or let the rolling player pick it themselves via buttons in their own roll dialog - and apply the resulting bonus directly. The GM now sees a dialog, reusing the module's existing cover-button styling, to confirm or override the cover state before the roll's dice are cast, whether the GM is rolling directly or a connected player is. A player waiting on a remote GM's decision now sees a small "Waiting for GM" dialog instead of a toast that could be missed, and the roll falls back to the auto-detected cover after 30 seconds if the GM never responds, so it can never hang indefinitely.

### Fixed

- **Auto Visibility kept enforcing hidden/undetected states and move-time soundwave rings outside encounters, even with "AVS Only Active in Combat" enabled**: The setting correctly paused the main recalculation engine between encounters, but the core detection override and the during-move soundwave engine never checked it at all, so previously-stored states and move-time rings kept being enforced regardless of combat state. Both now step aside for Foundry's native vision whenever the setting is on and no encounter is active.
- **A second connected GM could see "Item ... does not exist!" errors while tokens moved**: The automatic effect writes that Auto Visibility performs on every token move ran on every connected GM client at once instead of just one, letting two clients race to create, update, or delete the same ephemeral effect on a moved token's target. Only the elected primary GM now performs these writes; other GM clients still see the result through Foundry's normal document sync.
- **A creature could stay invisible for good even while fully observed, with no move in progress**: Foundry's own token rendering can independently leave a token in an inconsistent partial-invisible state - visible off while renderable and its mesh stay on, or any other mismatched combination - for reasons that have nothing to do with Visioner's own hide/reveal logic. Visioner only ever restored render state it had personally hidden, so a token Foundry left invisible on its own had nothing to bring it back; it stayed that way until something unrelated happened to jog it loose, if anything ever did. Restoring a token's render state after a move also reset its mesh but never its own visibility flag, and a separate guard against Foundry prematurely revealing a still-moving hidden target could run twice per frame against a stale snapshot, undoing its own correct decision. Visioner now forces a token's render state back to visible whenever every observer agrees it's fully observed (or it's a GM-hidden ghost token), regardless of who left it invisible or why.
- **Stealth-initiative cover could be granted by tokens that weren't even part of the encounter**: Auto-detected cover for a stealth-initiative roll scanned every token on the canvas by alliance alone, so a non-combatant token elsewhere on the map could still grant, or fail to block, cover. Cover detection now only considers tokens that are actual combatants in the current encounter.

## [8.3.21] - 2026-07-13

### Fixed

- **A deafened observer with only scent (no darkvision, in the dark) couldn't sense anything at all**: The system-hidden indicator - the marker shown for creatures Foundry's own renderer hides entirely but a special sense can still detect - only recognized lifesense, thoughtsense, and echolocation. Scent was never wired in, so a creature relying on scent alone (deafened, or otherwise unable to hear) got no indicator for targets it should have sensed as hidden, and appeared to detect nothing at all. Scent now gets the same treatment as lifesense: range-gated, unconditional detection, with its own indicator color.
- **The cover tooltip could reveal enemy positions a player hadn't actually detected**: Holding the cover-overlay keybind showed cover badges for every token Foundry's own renderer happened to draw, without checking whether the player's controlled token had actually detected that target. On scenes where core Foundry doesn't restrict rendering by itself (unrestricted vision, already-explored fog), this leaked the exact location of undetected and unnoticed enemies, including ones outside the current encounter. The cover overlay now also checks Auto Visibility's own detection state for non-GM users, matching the guard already used by the regular hover badges; GMs keep seeing cover for every token as before.
- Removed debug logs leftover

## [8.3.20] - 2026-07-11

### Fixed

- **Reselecting an observer still didn't repaint soundwaves for creatures only heard, not seen**: The 8.3.19 fix nudged Foundry into recomputing its own detection flag on reselect, but that flag was never the broken half - the mesh that actually draws the ring gets force-hidden whenever no token is controlled, and only gets re-armed on an actual state change to hidden. Reselecting a target that had been hidden the whole time (before, during, and after the deselect) produces no such change, so the mesh stayed invisible regardless of how many times the underlying flag got recomputed. Reselecting an observer - or switching to another token and back - now re-arms that mesh directly from the currently stored state instead of waiting for a change that was never going to happen.

## [8.3.19] - 2026-07-11

### Fixed

- **Reselecting an observer didn't repaint soundwaves for creatures only heard, not seen**: Deselecting and reselecting the same token (without moving it) skipped Visioner's own recalculation, since nothing about the observer had actually changed - correctly so. But that also meant nothing nudged Foundry's own vision refresh, which isn't guaranteed to have picked up the reselected token's active vision source in time to redraw detection rings. Soundwave rings only reappeared once the observer moved a square, triggering a fresh vision refresh incidentally. Reselecting now explicitly nudges that refresh, so soundwaves repaint immediately instead of waiting for the next move.

## [8.3.18] - 2026-07-11

### Fixed

- **Starting a corner peek right after a door peek left the door's slit cone stuck in place**: Door peeks clamp the rendered vision cone to a slit polygon by writing it onto the token's vision source; corner peeks don't need that clamp, but nothing ever cleared it, so the slit polygon silently carried over and got reapplied. Ending a peek entirely had the same gap. Starting a corner peek, or ending any peek, now clears that leftover clamp so the token's vision (and what the GM sees others peeking at) actually reflects the new peek instead of the previous one.
- **Peeking without darkvision could collapse a token's vision down to a tiny circle**: A corner peek has no explicit range, so it fell back to the peeking token's own current sight radius - which, for a non-darkvision creature standing somewhere dark, can genuinely be near zero, regardless of how well-lit the area being peeked into actually is. Darkvision creatures never noticed since their own radius is already effectively unlimited. Corner peeks (and door peeks configured with no range limit) now fall back to the scene's full radius instead, so what's actually revealed is governed by the walls and lighting at the peeked-at location, not the peeking creature's own current surroundings.

## [8.3.17] - 2026-07-11

### Added

- **Door peeking can now require GM approval**: A new world setting lets the GM require player door-peek attempts to open a GM approval dialog first. Approved requests start the same door peek on the player's client; denied requests do not reveal anything, and GMs can still peek directly. The GM approval dialog also shows a clickable door ID that pans the canvas to the requested door.

### Fixed

- **Door peeking now respects the slit settings instead of revealing full sight**: Door peeks now clamp the sight polygon, light-perception mask, and rendered vision mesh to the configured slit, so a 1-degree slit stays a 1-degree peek instead of showing the token's normal field of view on lit maps.
- **Approved door peeks now resume on the requesting client**: The GM approval response now uses socketlib's targeted-user call correctly, so clicking Approve actually starts the pending peek for the player who requested it.
- **Door peeking stays slit-only after idle perception refreshes**: Foundry can rebuild active vision, light, or darkness sources after mouse movement stops. Visioner now reclamps those rebuilt sources immediately while a peek is active, so the token's normal full field of view cannot reappear beside the slit.
- **Player peeks now reveal creatures inside the slit immediately**: GM-authored Auto Visibility updates now trigger a targeted visibility re-evaluation on the requesting player's client. This refresh includes creatures that are currently invisible, so player peeks reveal the same valid targets as GM peeks without exposing anything outside the configured slit.
- **Aiming a peek no longer causes avoidable FPS drops**: Pointer-driven peeks now throttle geometry updates and skip unchanged directions, reducing repeated vision-source rebuilds, perception refreshes, and Auto Visibility recalculations while preserving responsive aiming.
- **Player-initiated door peeks revealed nothing at all**: The GM's client checks line of sight for a player's peeking token without that token being its own controlled vision source, which fell back to a sight check that didn't know about the peek's excluded door wall. A disagreement between that fallback and the peek-aware wall check was resolved in favor of an unrelated heuristic instead of the peek, so the door stayed opaque for players even though the same peek worked fine when the GM did it. Player peeks now correctly see through the slit.
- **Sweeping across a target during a peek could fail to reveal it, even for a moment**: Re-aiming quickly could land several mouse positions inside the same network-send window; only the very latest one was kept, dropping any of the others that actually pointed at the target. A second, earlier throttle inside the peek itself discarded in-between mouse positions the same way before they were ever considered. Both throttles now combine the cones they would have dropped into the full area actually swept, so a target passed through mid-sweep is still caught.
- **Peeking still needed to "settle" on a target for about a second before it revealed**: Line-of-sight results were cached by position only, with no awareness of an active peek. Since re-aiming a peek never moves the token, the very first (pre-aim) result computed for a pair got cached and kept being replayed for several seconds no matter how the peek's aim changed afterward. An active peek now always computes a fresh line-of-sight result instead of reusing a stale one.
- **Corner peeking's own view flickered continuously while aiming**: Corner peeks move the vision source's own viewing point with the mouse, so Foundry fully rebuilds it on every re-aim tick; door peeks don't have this problem since their viewpoint stays fixed in place. Corner peeks now rebuild their own rendered vision at a smoother, throttled rate, while what other tokens can see of them still updates at full speed.
- **A revealed token's turn marker could flash while peeking**: The reveal refresh triggered by peeking forced a token redraw without checking whether that token's turn marker was mid-rebuild, unlike every other refresh path in the module. Revealing the current combatant mid-peek could repeatedly retrigger that rebuild, flashing the marker. The reveal refresh now waits for the turn marker to be ready first, matching the existing guard used everywhere else.
- **Peeking suppressed soundwaves for creatures only heard, not seen**: A peek's visual cone correctly restricts what the peeking creature can see, but the same gate was also being applied to Foundry's aggregate detection result, which mixes in hearing and other non-visual senses. A creature detected only by hearing outside the peek's cone lost its soundwave entirely instead of keeping it. That gate now steps aside whenever Visioner already considers the target hidden (heard, not seen).

## [8.3.16] - 2026-07-10

### Fixed

- **Foundry-hidden tokens no longer flash into view while the GM moves or reselects an observer**: Foundry's movement and control refreshes could render a hidden target at translucent GM alpha until it was hovered. Visioner now preserves the target's prior observer-view render state across movement and deselect/reselect while leaving already-visible GM ghost tokens unchanged. The movement guard runs inside the existing visibility refresh, and reselection restores only the small cached set of hidden targets; neither path adds line-of-sight checks, frame loops, or animation work, so token movement FPS is unaffected.

## [8.3.15] - 2026-07-07

### Fixed

- **Soundwaves now appear mid-move the instant a creature slips out of sight, instead of at the destination**: When a controlled token moved so that a previously-seen creature lost line of sight, its soundwave (heard-not-seen indicator) only showed up once the move finished and the visibility recompute settled — a noticeable lag. Visioner now tracks each observer's live line of sight during the move and shows the soundwave the moment sight is lost, then hands off cleanly to the settled render at the destination with no flash back to a visible token. Hold-drags stay frozen until release, as before.

## [8.3.14] - 2026-07-06

### Fixed

- **Opening a door now reveals creatures to the players immediately, without the GM reselecting a token**: Auto Visibility leaned on the GM's currently-controlled token for line-of-sight, so a creature made visible through a newly-opened door stayed hidden for other observers until the GM selected that observer — and even then the recompute could run against wall geometry Foundry had not finished rebuilding yet, leaving the creature hidden for several seconds (or indefinitely with custom door meshes). Visioner now computes each observer's line of sight independently of the GM's selection, and rebuilds the wall geometry synchronously when a door opens or closes, so the reveal is correct and immediate for everyone.
- **Corner and door peeking no longer flicker for non-darkvision actors**: Foundry could treat a non-darkvision peeker in darkness as darkness-blinded at the shifted peek origin, collapsing the active vision source to the token footprint on alternating refreshes. Visioner now keeps the peek source radius stable and applies the door-slit cone itself, so peek vision stays steady without leaking sight outside the slit.

## [8.3.13] - 2026-07-06

### Fixed

- **Creatures seen through an open door at wide angles are no longer hidden**: When a sightline through an open door grazed the corner shared by the door and an adjoining wall, Visioner's wall-aware geometry blocked it on the plain-wall side even though Foundry's own vision saw through the open door — hiding creatures the party should see (until AVS was disabled or the token was reselected). The open-door line-of-sight pass now trusts Foundry's vision polygon as well as Visioner's geometry, so those creatures stay visible.

## [8.3.12] - 2026-07-04

### Fixed

- **Door peeking no longer reveals creatures from previously explored fog**: When a room had already been explored, Foundry could treat tokens in old fog-of-war history as visible during an active peek, even outside the current slit. Visioner now gates core visibility through the active peek LOS, FOV, and range so peeking only reveals creatures inside the current opening.

## [8.3.11] - 2026-07-02

### Added

- **PF2e Electromagnetic Sense is now recognized**: Visioner now includes `electromagnetic-sense` in the special-sense registry, sense parsing aliases, region sense suppression, hover detection factors, and localized sense labels, so the PF2e system sense appears and behaves consistently with other nonvisual special senses.

### Fixed

- **Blinded now suppresses visual special senses consistently**: Visual senses such as truesight, see-all, see-invisibility, and infrared vision no longer continue to observe targets while the observer is blinded. Truesight and see-all still counter invisibility when the observer can see, while sense-invisibility remains nonvisual and only detects invisible targets.

## [8.3.10] - 2026-07-02

### Fixed

- **Door peeking no longer relies on Shift+right-click**: Browsers such as Brave and Firefox can reserve Shift+right-click for their own context menu, so the shortcut could fail or open browser UI instead of peeking. Door Peek is now an unbound configurable keybind: assign a key, hover a peek-enabled door, and press the key. The existing door range, permission, and DC checks still apply.

## [8.3.9] - 2026-07-01

### Fixed

- **Corner peeking no longer crashes with a `ClockwiseSweepPolygon.contains` stack overflow**: Corner peeks could reuse the same geometry object for line-of-sight and field-of-view checks. Visioner now snapshots and unwraps the original geometry before clamping LOS to the peek FOV, so repeated corner-peek updates no longer recursively call the wrapper.
- **Door peeking recognizes Shift in Foundry v14**: The door peek shortcut now reads Foundry's namespaced `foundry.helpers.interaction.KeyboardManager` first, while keeping the older global fallback.

## [8.3.8] - 2026-07-01

### Fixed

- **Precisely-sensed creatures (e.g. echolocation) no longer show a soundwave ring**: A creature detected precisely by a non-visual sense such as echolocation is correctly `observed`, but it still displayed the "heard, not seen" soundwave ring.
  Echolocation has no dedicated Foundry detection mode, so the creature is detected through the imprecise **hearing** detection mode — and Foundry attaches the hearing soundwave filter to anything that mode detects, regardless of whether the sense is precise.
  Visioner now clears that ring whenever the viewing token actually observes the target, so precisely-sensed creatures render as normal observed tokens. Imprecisely-heard (hidden) creatures keep their soundwave.

- **No more soundwave flicker on precisely-sensed creatures while moving**: Moving a token near a creature you sense precisely but cannot see — for example one detected by echolocation through a door — briefly flashed a soundwave ring on it for about a second before settling to no ring.
  The during-move soundwave check treated any sensed-but-out-of-sight creature as needing a ring, including precisely-sensed (observed) ones.
  Soundwaves are an imprecise-detection cue, so the during-move check now only rings creatures that are actually hidden (heard, not seen); observed and concealed creatures no longer flicker a ring mid-move.

- **Observed creatures no longer vanish mid-move when they carry an undetected/hidden condition**: A creature you observe (for example a prone, off-guard target you can plainly see) but which also carries the PF2e `undetected`, `hidden`, or `unnoticed` condition would blink out completely for the duration of any token's movement, then reappear when the move settled.
  The PF2e system's sight detection refuses to detect anything carrying those conditions; while stationary Visioner works around that, but during a move it deferred to that same core check, so the observed creature disappeared.
  Visioner now keeps observed and concealed creatures detectable throughout a move (line-of-sight is still enforced by the vision polygon, so moving behind a wall still hides them), matching the stationary behavior.

### Changed

- **System conditions are now consumed when converted to Visioner overrides**: With "System conditions act as Visioner overrides" enabled, applying a standalone (GM-applied) Hidden, Concealed, or Undetected condition now converts it into a permanent Visioner override against the creature's enemies **and removes the PF2e condition itself**.
  Previously the condition was kept, which caused problems: because a PF2e condition is actor-wide, the system refuses to detect the creature by sight for _everyone_, so Visioner had to fight that per-viewer — and during movement the creature would blink out entirely, or a precisely-sensed creature would still show a soundwave.
  Consuming the condition hands full ownership of the visibility state to Visioner and eliminates that interference.
  Conditions granted by an effect, spell, or rule element (for example from Sneak or Avoid Notice) are left untouched.
  The conversion is permanent: once removed, the condition is not restored if the override is later cleared.

## [8.3.7] - 2026-07-01

### Fixed

- **Heard-but-unseen creatures no longer vanish while you move a token**: When moving a token, any creature you can hear but not see (a "hidden" soundwave target) briefly disappeared entirely for the duration of the movement, then popped back as a soundwave once the move settled.
  While stationary, Visioner force-shows the soundwave for hidden creatures because the core hearing sense is unreliable; but during a move it deferred to that same unreliable core detection, which reports "not heard" throughout the movement animation, so the creature — mesh and soundwave ring alike — blanked out until the move ended.
  Non-visual senses (hearing, tremorsense, scent, lifesense, thoughtsense) now keep detecting hidden creatures throughout a move, matching the stationary behavior, so their soundwaves stay put.
  Sight still reveals a hidden creature the moment line of sight opens mid-move, and deliberately hidden creatures keep their soundwave without being revealed.

## [8.3.6] - 2026-06-30

### Fixed

- **GM Vision no longer paints soundwaves on every token while moving**: With GM Vision enabled the GM sees the whole scene, but moving a token still drew a "heard, not seen" soundwave ring on every other creature until it was hovered, then re-drew them on the next move.
  The during-move soundwave engine did not honor the GM Vision bypass that the rest of automatic visibility already respects.
  It now suppresses and clears all move-time soundwaves while GM Vision is active, so tokens simply stay visible.

## [8.3.5] - 2026-06-30

### Fixed

- **Defeated creatures no longer stay stuck on a stale visibility state**: A dead, dying, or unconscious NPC was excluded from automatic visibility entirely, so others' view of it was never recomputed — a creature that died while undetected or hidden kept that state indefinitely. The corpse then only flickered into view while a token was moving (Foundry's own rendering) and vanished again once movement settled, sometimes leaving its status icon floating. Defeated tokens are now still excluded as observers (a corpse senses nothing) but are recomputed like any other target, so a downed creature becomes visible per normal sight as soon as the next visibility pass runs (for example when any nearby token moves).

## [8.3.4] - 2026-06-30

### Fixed

- **No-vision (theater-of-mind) scenes no longer flag every token as heard-only on movement**: In scenes with token vision disabled, moving a token made every other token appear as a greyed, soundwave-ringed "sensed but unseen" creature until it was hovered, then re-broke on the next move. The during-move soundwave check decided whether an observer could see a target from its vision polygon, which does not exist when a scene has token vision turned off, so observed tokens were mistaken for out-of-sight ones. With token vision disabled (global sight), observers are now treated as seeing every target, so no stray soundwave rings appear on movement. Manual "hidden" overrides still show their ring.

## [8.3.3] - 2026-06-29

### Added

- **Chat indicator when a Rule Element adjusts cover**: When an `adjustCover` Rule Element changes the cover used for a roll, the GM now sees a compact indicator on the chat card showing the change — the original cover crossed out, an arrow, then the final cover — with a hover tooltip naming the adjustment source and the transition (for example, "Cover adjusted by rule element (shooting-star): Standard → None"). It appears on attack rolls, saving throws, and Stealth checks, and only the GM sees it. This mirrors the existing Sniping Duo and cover-override indicators, so adjusted cover is auditable at a glance instead of silently altering a roll. On attack rolls the chip sits next to the target's AC; on saving throws and Stealth checks — where cover is a circumstance modifier on the roller rather than a DC — it sits next to the roll result.

### Fixed

- **`adjustCover` "while-active" adjustments no longer vanish when the carrying effect is edited or refreshed**: Editing an effect that holds an `adjustCover` operation — or any item update that re-runs its Rule Elements — went through a separate refresh path that did not recognize `adjustCover`. That path cleared the stored cover-adjustment flag and never re-applied it, so a `while-active` adjustment worked once and then disappeared on the next edit or lifecycle event (it appeared to "work only once"). The refresh path now applies, removes, and re-registers `adjustCover` like every other operation, so `while-active` adjustments persist for the full duration of the effect and survive edits and world reloads.
- **`adjustCover` can now target a specific creature instead of always affecting everyone**: The operation read the wrong targeting field — it always resolved `observers`, which defaults to "all", so any attempt to scope the adjustment via `targets`/`tokenIds` was ignored and every pair was affected. Targeting is now chosen by `direction`, exactly as documented: `direction: "from"` uses `observers` (which observers get the reduced-cover view of the subject) and `direction: "to"` uses `targets` (which targets get reduced cover from the subject). This makes `"specific"` (with `tokenIds`), `"targeted"`, `"enemies"`, and `"allies"` all work, so an adjustment can apply to a single chosen creature rather than the whole scene.

## [8.3.2] - 2026-06-27

### Added

- **System conditions can drive Visioner visibility (opt-in)**: With the new "System conditions act as Visioner overrides" setting enabled, applying the PF2E Hidden, Concealed, or Undetected condition to a token makes it that to its enemies; removing the condition reverts to automatic visibility. Existing manual overrides are never replaced.
- **Presence-only thoughtsense marker for sound-blocked hidden targets**: A hidden target detected by thoughtsense only (sound is blocked, no hearing) now renders presence-only — the creature token and its soundwave ring are hidden and only the purple thoughtsense indicator shows, including in the GM view. Audible hidden targets keep their soundwave.
- **Relative cover adjustments via Rule Elements (`adjustCover`)**: A `PF2eVisionerEffect` operation that reduces a target's effective cover at roll time — by one or more steps (`mode: "step"`) or by an AC-bonus amount (`mode: "bonus"`) — without permanently changing stored cover. Supports `while-active` (persistent while the effect lasts) and `next-attack` (consumed after the first qualifying roll) scopes, cumulative stacking by priority, and predicates. Enables spells like Shooting Star and Phase Bolt to carry the behavior directly.

### Changed

- **Rebuilt during-move visibility as a freeze-and-settle engine**: While a token moves, Visioner now lets Foundry's core detection render the scene and recomputes a fresh AVS assessment once the move finishes, instead of running a per-frame render-lock and sight-line layer. Movement visibility is more reliable and lighter-weight, with live soundwaves driven directly off the token's detection filter.
- **Hearing takes precedence among imprecise senses**: When several imprecise senses could detect a target, hearing is now the detecting sense whenever it actually can (observer not deafened, sound not blocked, target not invisible), falling back through Tremorsense > Lifesense > Thoughtsense > Scent only when hearing cannot. Invisible targets are unchanged.

### Fixed

- **Soundwaves clear the moment line of sight opens mid-move**: A hidden target revealed during an observer's move now drops its soundwave ring at the square where line of sight reaches it, instead of only at the end of the move. Deliberately hidden creatures (Hide or AVS overrides) keep their soundwave through the whole move.
- **Off-screen targets recompute when sense-affecting conditions change**: Removing a sense condition such as deafened now re-evaluates the whole scene instead of only the on-screen viewport, so off-screen audible targets are no longer left stale (for example, soundwaves now appear for off-screen creatures after deafened is removed).
- **GM deselect and select-all restore tokens and clear stale rings**: Deselecting all tokens or pressing select-all as GM now restores hard-hidden (undetected) tokens and clears leftover soundwave detection rings, so tokens no longer stay invisible or keep stray rings after losing a controlled observer.
- **Player views stay frozen on deselect and during hold-drag**: Players no longer reveal every undetected token or clear soundwaves when deselecting (that omniscience is now GM-only), and hold-dragging a token no longer mutates soundwave visuals before the move is committed.
- **Tokens repaint when leaving a render-hidden state without a reselect**: A token hard-hidden while undetected now repaints its token and soundwave as soon as it becomes detectable again (for example after deafened is removed), instead of staying blank until the observer is reselected.
- **Thoughtsense/lifesense indicator clears and restores on observed transition**: The purple presence-only indicator is removed and the token's visibility is restored when a move gains sight of a sensed target, so an observed token no longer stays invisible or keeps a stuck indicator.
- **System-hidden indicators track their token during drags and movement**: The lifesense/thoughtsense indicator square now follows the token frame-by-frame during hold-drags and movement (including fast, auto-panning drags) and settles after the move, instead of lagging behind or popping in at the wrong grid cells.
- **Players no longer reveal undetected tokens when deselecting**: A player deselecting their token now keeps its last view frozen, so undetected tokens stay hidden instead of becoming visible once no token is controlled. GM deselect still reveals everything.
- **Limited (terrain) walls now obscure hearing like sight**: A wall set to Limited for sound now follows Foundry's terrain rule for hearing — sound passes through one crossing but is blocked by a second — matching how Limited walls already work for sight. A creature behind a terrain wall crossed twice is now undetected (fully hidden, no soundwave) instead of showing a hidden soundwave through the wall.
- **Undetected creatures reveal mid-move when line of sight opens**: An undetected target now becomes visible the moment a moving observer's line of sight reaches it, instead of only after the move finishes. Creatures deliberately hidden via a Sneak/Hide override stay undetected through the move.
- **Hidden creatures no longer leak their chrome**: When a creature is hard-hidden from you (undetected), its PF2E condition icons, nameplate, and bars are now hidden along with the token instead of floating at its location or riding the movement ruler during a drag; they reappear when it becomes visible again.
- **Legendary Sneak no longer forces creatures undetected**: Legendary Sneak no longer adds a phantom degree-of-success boost to Hide, and it never auto-downgrades a Hidden creature to Undetected when it moves — it only removes the cover/concealment requirement for Hide and Sneak, as the feat states.
- **Observer-perspective tooltips no longer reveal undetected creatures**: Holding the observer hotkey as a player no longer shows visibility badges for any creature it cannot perceive (undetected or unnoticed), which previously gave away their location. The GM still sees everything.

## [8.3.1] - 2026-06-21

### Fixed

- **Visioner loads reliably after the detection-wrapper split**: Consequences AVS handling, Point Out chat notifications, and the Foundry canvas visibility wrapper now import from the right module paths, preventing startup failures that could make Visioner disappear from settings.
- **Presence-only senses stay indicator-only**: Lifesense and thoughtsense indicators now keep the token body, effects, stale soundwaves, and detection-filter meshes hidden through Foundry refreshes and render-flag updates.
- **Lifesense respects blocked paths**: Lifesense no longer reveals living or undead targets through sight-blocking walls or silence/sound-blocking paths; thoughtsense remains independent of those paths.
- **Thoughtsense indicators keep their mode color**: Thoughtsense now keeps its purple indicator color even when the observer is blind and deaf.
- **Peek vision respects the clipped FOV for occlusion consumers**: Peek LOS geometry is clamped to the active peek FOV while still honoring the original wall-constrained LOS, preventing roof and occlusion logic from seeing outside the peek slit.

## [8.3.0] - 2026-06-20

### Added

- **New core-like perception engine**: Visioner now stores detection, concealment, cover, and encounter awareness separately, giving AVS, manual overrides, action previews, token rendering, and the public API one shared rules model.
- **Automatic migration to the new engine**: Existing visibility maps, AVS overrides, manual states, scene cleanup data, and deleted-token recovery data migrate into the new profile format.
- **Peek for corners and doors**: Tokens can peek around wall corners and through configured doors, with token-side origin handling, configurable slit/sweep/range behavior, optional blind-GM door Perception DCs, local peeker indicators, and GM mirror overlays.
- **Expanded PF2E rule-element support**: Visioner rule elements can qualify Seek actions, change sense ranges, suppress off-guard from Blind-Fight-style features, provide or override cover, modify detection modes, and drive aura visibility.

### Changed

- **Concealed now behaves as Observed + Concealed**: Visioner Manager controls, hover badges, action previews, validation rows, and tooltips now show concealed visibility as an observed creature with concealment instead of treating it as a separate detection state.
- **Unnoticed is now encounter awareness**: Unnoticed is reserved for encounter-start Avoid Notice and tracker awareness flows instead of being offered as a general manual visibility state.
- **Action previews use the new engine**: Seek, Hide, Sneak, Consequences, Point Out, Create a Diversion, and Take Cover previews share consistent row actions, timers, bulk overrides, visibility labels, and apply/revert behavior.
- **Manual visibility writes update immediately**: Manual changes now refresh token visuals, validation rows, override indicators, and detection state through the same path used by automation.

### Fixed

- **Movement visibility is smoother and more accurate**: AVS now waits for Foundry token animation, avoids stale mid-move batches, keeps LOS and soundwaves synchronized during drags, and reduces movement-time refresh spikes without freezing the live polygon.
- **Imprecise-sense soundwaves stay reliable**: Hidden targets detected by hearing, scent, tremorsense, and similar senses keep responsive soundwave indicators through movement, darkness, wall transitions, and range changes.
- **Nonvisual senses follow PF2E expectations more closely**: Precise nonvisual senses reveal normally, imprecise senses use soundwaves, tremorsense respects ground/elevation, and deafened or scent-only observers still get appropriate nonvisual feedback.
- **Invisible creatures use remembered-position visibility correctly**: Invisible creatures can remain represented by soundwaves while hidden, become undetected when blocked, and reappear through the movement preview as sight lines clear.
- **Doors and walls stay in sync with Foundry detection**: Door open/close and wall interactions refresh affected token pairs while keeping Foundry detection, explicit visible pairs, and Visioner visibility aligned.
- **Cover and action automation use better PF2E context**: Aim-Aiding, Blind-Fight, Seek concealment qualifiers, range-qualified actions, Take Cover, and corner peeking now use the same perception and cover context as the rest of Visioner.
- **Blinded player tokens remain targetable after deselecting**: A player-owned blinded PC no longer disappears from its own player when the token is deselected.

## [8.2.11] - 2026-05-16

### Added

- **PF2E HUD Take Cover can route player requests to the GM**: Non-GM Take Cover clicks from PF2E HUD now request the GM to open the Visioner Take Cover preview for the active canvas token, while GM-side preview resolution prefers the real scene token over actor prototype token data.

### Fixed

- **Visioner Manager manual visibility choices hide Unnoticed**: The Visioner Manager no longer offers Unnoticed in per-row visibility action buttons or bulk visibility buttons, keeping Unnoticed reserved for encounter-driven awareness flows.
- **Take Cover AVS cleanup returns cover to auto**: Accepting cover-only AVS validation for Take Cover now clears the manual cover override instead of applying a new lower cover effect, letting automatic cover calculation take over after movement.
- **Take Cover cover overrides validate and display clearly**: Take Cover manual cover changes now create AVS cover-only override markers, show as manual cover to auto-cover transitions in the AVS indicator and dialog, and use an auto-cover icon instead of another shield icon.
- **Take Cover expiration uses GM chat confirmation**: Movement, attack actions, and unconscious/dead/dying conditions now create a GM chat prompt to remove Take Cover and return cover to automation, instead of silently clearing the manual cover state. When the covered token moves, pure Take Cover cover-only AVS rows are suppressed; mixed visibility rows still show, including Take Cover-sourced rows, but omit the expiring cover change.
- **Take Cover duplicate application blocked**: Take Cover cannot be applied again while the target already has an active Take Cover state, including direct action use, prone shortcut handling, preview application, and PF2E HUD entry points.
- **Take Cover baselines match the cover overlay**: Take Cover preview calculations now use the same manual-cover-first cover state path as the `G` overlay, so lesser, standard, and greater cover upgrades are based on the same scene state the GM sees.
- **Take Cover Ceaseless Shadows context shown**: The Take Cover preview now shows the acting token name and a Ceaseless Shadows badge when the feat is active, making creature-cover upgrades visible before applying cover changes.
- **Scene purge clears manual cover state**: Scene data purge now removes manual cover map entries and related Take Cover override markers so stale manual cover no longer survives cleanup.
- **Consequences apply defaults to AVS when enabled**: Consequences changes now prefer AVS override handling when AVS is active, preventing chat Apply Changes from leaving visibility state stuck until token movement.
- **Legendary Sneak AVS context**: Stealth overrides from Sneak or manual changes are no longer flagged for stale positioning when the target has Legendary Sneak; AVS awareness rows now show a Legendary Sneak badge in the tooltip and validation dialog, including when PF2E exposes the feat through actor roll options instead of item collections.
- **Pending movement visibility no longer flashes wrong tokens**: Controlled-token movement now tracks the pending destination through Foundry detection wrappers, suppresses blocked vision and light sources while the mover crosses walls, preserves hidden/undetected render state during animation, restores rendering after the final AVS assessment, and waits briefly for Foundry's token animation to attach so movement does not snap to the destination.
- **Pending movement detection keeps libWrapper chained**: Canvas visibility suppression now still calls Foundry's wrapped `testVisibility` function before forcing a Visioner-hidden result, preventing libWrapper from unregistering the wrapper during movement visibility refreshes.
- **Hidden state rendering matches actor type during movement**: Loot and hazard tokens marked hidden by Visioner stay hidden from the observer during pending movement, while NPCs marked hidden can remain visible when line of sight allows it; undetected and unnoticed NPCs still stay hidden.
- **Debug console noise removed**: Temporary pending-movement, system-hidden, AVS hook, visibility-factor, and token-manager diagnostics no longer print to the browser console or capture stack traces during normal play.
- **Deselecting an observer restores GM visibility**: Releasing the last controlled observer now clears observer-specific hidden-token overlays and render locks without falling back to the stale selection, then refreshes no-observer vision so hidden targets become visible again.
- **Auto-cover blocker and wall results are stricter**: Token cover overrides now apply only from blockers that actually contribute to the attacker-target pair, per-call filter overrides are honored, wall cover no longer falls back to lesser or standard cover below configured thresholds, and creature-only obstruction is handled by the creature-cover path instead of the wall-cover evaluator.
- **AVS validation preserves mixed Take Cover visibility rows**: Removing Take Cover can release visibility back to AVS without discarding remaining visibility overrides, force post-removal validation through same-position debounce, suppress expiring Take Cover cover deltas on mixed rows, and show auto-calculated cover changes distinctly in the indicator and dialog.
- **Visioner Manager handles cover-only AVS flags correctly**: Cover-only Take Cover flags are treated as AVS-controlled visibility instead of manual visibility overrides, and target-mode managers refresh when a visibility change targets the managed token.

## [8.2.10] - 2026-05-15

### Fixed

- **Offscreen tokens no longer stay hidden after zooming out**: Visioner's detection wrapper no longer treats targets outside the current camera viewport as undetectable during Foundry detection tests, preventing zoomed-in movement from leaving offscreen tokens visually hidden until another movement refresh.

## [8.2.9] - 2026-05-13

### Fixed

- **Hazard/Loot and hidden-wall prep without PC tokens persists and can be cleared**: GMs can now mark loot, hazards, and hidden walls Hidden from PCs while prepping scenes that have no player character tokens yet. The Hazard/Loot Manager and Hidden Scene Visibility scene tool store prep defaults on those targets, future player-owned character tokens inherit the hidden visibility when they are added, and that same scene tool can Clear Prep to remove prep defaults plus current PC token and hidden-wall visibility entries.
- **Search exploration works during no-PC scene prep**: The Search token HUD button recognizes prepped-hidden loot targets, and the token HUD action plus hidden-wall scene button now fall back to player-owned PC actors with Search active when there are no PC tokens on the scene.
- **No-PC Search exploration results apply later**: Open Results rebuilds actor-based PC searchers instead of requiring scene tokens, and applying those results stores actor-specific scene prep so future PC tokens inherit the discovered token and hidden-wall visibility.

## [8.2.8] - 2026-05-13

### Fixed

- **Hidden wall settings reveal immediately**: The wall quick settings dialog now shows the hidden wall identifier, stealth DC, and connected wall inputs as soon as the GM checks Hidden Wall, without waiting for Apply.
- **Search exploration no longer blocked by combat**: GM-triggered Search exploration for hidden walls, hidden loot, hazards, and hidden NPCs is now available whenever the GM chooses to run it, including during active combat or while testing exploration on another scene.

## [8.2.7] - 2026-05-12

### Added

- **Deny Advantage chat indication added**: Attack chat cards now show a GM-facing Deny Advantage indicator when the class feature suppresses visibility-driven off-guard from hidden or undetected attackers.

### Fixed

- **Hidden-attacker off-guard suppression respected**: Visibility-driven off-guard now honors native Blind-Fight and Deny Advantage during batch effect sync and attack-roll refreshes, handles PF2e token-document roll contexts, and repairs already-built AC DCs so hidden attackers no longer make protected defenders off-guard.
- **PF2E off-guard suppression sources expanded**: Visibility-driven off-guard suppression now also recognizes PF2E's `offGuardable` flanking attribute for Deny Advantage, off-guard immunity rules, and Starsong Nectar's undetected-only protection, with matching chat-source labels.

## [8.2.6] - 2026-05-11

### Fixed

- **Non-AVS interaction overhead reduced**: The fallback floating HUD button no longer accumulates document-level drag listeners across token selections, observer-mode hover tooltips now read the observer visibility map once per hover instead of once per visible target, and token refresh hooks now skip visual-effect helper loading unless the refreshed token is actually controlled.
- **Cover visualization occupancy checks precomputed**: The cover overlay now builds its blocking-token occupancy list once per overlay instead of rechecking every scene token and visibility state for every sampled grid square, reducing work in crowded scenes while holding the cover visualization key.

## [8.2.5] - 2026-05-11

### Fixed

- **AVS large-scene batch performance improved**: Full AVS recalculations with many changed tokens now avoid duplicate bidirectional pair processing, preserve global visibility and line-of-sight caches for non-movement batches, avoid hot dynamic imports inside batch execution, and reuse freshly recomputed lighting after one forced refresh instead of recalculating every token's light for rapid follow-up batches.
- **AVS override validation performance improved**: Override validity checks now prewarm and reuse the visibility, cover, and vision analyzer modules, removing multi-second import stalls from large-token override validation runs.
- **Non-AVS interaction overhead reduced**: The fallback floating HUD button no longer accumulates document-level drag listeners across token selections, observer-mode hover tooltips now read the observer visibility map once per hover instead of once per visible target, and token refresh hooks now skip visual-effect helper loading unless the refreshed token is actually controlled.
- **Cover visualization occupancy checks precomputed**: The cover overlay now builds its blocking-token occupancy list once per overlay instead of rechecking every scene token and visibility state for every sampled grid square, reducing work in crowded scenes while holding the cover visualization key.

## [8.2.4] - 2026-05-11

### Fixed

- **Visioner LOS now matches Foundry token visibility polygons**: AVS line-of-sight checks now respect Foundry's point visibility results in both Foundry v13 and v14, preventing targets hidden by the rendered vision/lighting polygon from being marked observed by Visioner's geometric fallback while preserving Visioner's custom proximity wall behavior.

## [8.2.3] - 2026-05-11

### Fixed

- **Proximity wall sight and sound types respected by Visioner**: Proximity and reverse proximity walls now use their sight and sound thresholds in Visioner's line-of-sight, sound-blocking, and wall auto-cover checks instead of behaving like normal always-blocking walls, and threshold edits now invalidate Visioner's wall visibility caches.
- **Sound proximity uses the sound source side**: Visioner now evaluates sound proximity walls from the target/noise-maker side, so sight-blocked targets within a sound proximity threshold can still be detected as hidden by hearing instead of incorrectly remaining undetected.
- **Light toggles wait for Foundry lighting refresh**: Ambient and token-emitted light changes no longer trigger AVS recalculation before Foundry finishes rebuilding light sources, preventing transient token-render artifacts during light enable/disable.
- **Offscreen light recalculations respect the viewport**: Empty viewport-filter results no longer fall back to processing every token, and stale movement tracking no longer makes normal light batches refresh offscreen tokens.
- **Startup token visual refreshes skip offscreen tokens**: Scene reload/canvas-ready visual refreshes no longer call `refresh()` on tokens outside the current viewport, avoiding offscreen token texture flashes after reloading the game.
- **Reload-time visual refreshes avoid no-op canvas work**: Pair-specific visual updates now skip offscreen tokens too, early reload refreshes wait for viewport geometry, and vision-sharing scene checks no longer force a perception rebuild when no token IDs changed.
- **Hidden-wall visual refreshes skip offscreen tokens**: Hidden wall sight-restoration paths no longer force-refresh every token on the scene, closing another reload/control-token path that could briefly draw offscreen token textures.
- **Offscreen tokens skipped during Foundry detection tests**: Visioner's detection-mode wrapper now ignores targets outside the current viewport before running Foundry point tests, preventing reload and lighting perception rebuilds from touching hidden offscreen token meshes.
- **Imprecise detection renders hidden targets outside sight**: Targets that Visioner marks hidden via hearing, tremorsense, or similar non-visual senses now remain visible to the selected observer even when Foundry's visual point test fails, instead of disappearing as undetected.
- **Foundry core sound wall collisions respect proximity**: In Foundry v14/core Levels scenes, sound wall polygon collisions now fall through to Visioner's proximity-aware wall checks instead of short-circuiting all sound proximity walls as blocked.
- **Proximity sight attenuation respected**: Proximity and reverse proximity sight walls with threshold attenuation now limit how far Visioner line of sight can continue past the wall instead of becoming fully transparent as soon as the observer qualifies for the threshold.
- **AVS rule-element global restored without debug instrumentation**: The module now preserves `window.pf2eVisioner.services.autoVisibilitySystem` for rule elements after reloads while removing the temporary token-flash diagnostic hooks.

## [8.2.2] - 2026-05-10

### Fixed

- **Hazard/Loot Manager party DC uses active party level**: The Party DC button now reads the active PF2E Party actor level before falling back to scene player-token averaging, so level 4 parties show DC 19 instead of the level 1 fallback DC 15.

## [8.2.1] - 2026-05-10

### Fixed

- **Token config Visioner controls match actor type support**: Companion and familiar PF2E token configs now show the Visioner box, while loot token configs no longer show Encounter Master or Vision Master controls.

## [8.2.0] - 2026-05-09

### Added

- **Search exploration automation for out-of-encounter play**: Added GM-triggered Search exploration support for PF2E exploration activity workflows. GMs can roll Seek checks for every PC currently using the Search exploration activity against a specific hidden target, without relying on token movement, encounter turns, or automatic 10-minute polling.
- **Search exploration target HUD buttons**: Loot, hazards, and hidden NPCs now get a dedicated Token HUD Search button outside combat when they are valid exploration Search targets. Hidden walls get the same workflow through wall tools when no Token HUD exists.
- **Consolidated Search exploration results dialog**: Exploration Search results now open in a target-focused dialog. The target is the subject, each row is a searching PC, and Apply updates the PC-to-target visibility relationship in the correct direction.
- **Search exploration support for hidden walls**: Hidden walls can be searched through the exploration Search workflow, use wall stealth DCs, default to vision-based detection presentation, and successful results can set the wall observed for the searching PC.
- **Initial scene hidden setup tool**: Added a GM scene setup action that marks all scene loot tokens, hazard tokens, and Visioner hidden walls as hidden to every player character, creating the expected starting visibility state for exploration Search scenes.
- **Hazard/Loot Manager**: Added a dedicated manager for scene hazards and loot. It shows hazard and loot tables separately, opens actor sheets, applies hidden or observed visibility for all player characters, and exposes scene setup controls for hidden exploration content.
- **Loot stealth DC management**: Loot rows in the Hazard/Loot Manager can edit their Visioner stealth DC and can set that DC from the PF2E party-level simple DC table.
- **Hazard minimum proficiency management**: Hazard rows in the Hazard/Loot Manager expose the minimum Perception proficiency rank used for detection, matching PF2E hazard sheet behavior where stealth DC is read from the system sheet rather than edited by Visioner.

### Fixed

- **Foundry v13 Seek template placement no longer leaves a false waiting warning**: The v13 MeasuredTemplate Seek flow now recognizes the template after placement so the GM does not keep seeing the "waiting for the player's Seek template" warning after the template exists.
- **Seek template and region cleanup after results open**: GM-placed Seek templates and v14 regions are removed after the GM opens the Seek results dialog, and the chat panel returns to the correct result-opening state.
- **Seek outside combat no longer shows encounter template controls to the GM**: Out-of-combat Seek no longer exposes the setup-template workflow intended for encounter Seek.
- **Hidden loot-only Seek opens results**: Seek now opens results when the only valid target is hidden loot, avoiding the incorrect "No valid Seek targets found" warning.
- **Hidden wall-only Seek opens results**: Seek now opens results when the only valid target is a hidden wall, even when no NPCs are inside the Seek area.
- **Hidden wall successes now offer action buttons**: Search results for hidden walls now treat successful detection as a real visibility change to observed, so Apply buttons appear when the outcome changes the wall state.
- **Initial scene setup clears Foundry core hidden on loot and hazards**: When the GM initializes loot and hazards as Visioner-hidden to PCs, Visioner also clears Foundry's core `hidden` flag on those target tokens so players can discover them through Visioner state instead of core canvas hiding.
- **Search exploration HUD appears for Visioner-hidden NPCs**: NPCs hidden or undetected to any PC through Visioner visibility maps now show the Search exploration Token HUD button, even when they do not have a PF2E Hidden/Undetected condition or Foundry core hidden state.
- **Search exploration activity detection handles PF2E effect activity data**: PCs with Search represented through PF2E exploration activity data or active Search effect items are detected as valid searchers.
- **Search exploration rolls once per GM action**: The old multi-trigger behavior that could create repeated rolls from a single movement/update path is removed.
- **Hazard manager no longer edits unsupported hazard stealth DCs**: Hazard stealth DC editing was removed from the manager because hazard DCs come from the PF2E sheet; Visioner now edits only the supported proficiency requirement for hazards.

## [8.1.15] - 2026-05-08

### Fixed

- **Darkness spell areas create linked darkness lights in Foundry v13 and v14**: Visioner now handles PF2E v14 effect-area Regions in addition to v13 MeasuredTemplates, restoring automatic AmbientLight creation, syncing, and cleanup for Darkness spell areas.
- **Darkvision sees through non-heightened Darkness again**: Unranked Darkness lights now default to ordinary spell darkness instead of rank 4, PF2E system and prepared senses are merged correctly, and core Levels polygon-only vision blocks fall back to wall LOS so rank 1-3 Darkness does not hide creatures from darkvision.

## [8.1.14] - 2026-05-07

### Fixed

- **Prone Take Cover reopens the normal dialog after the special effect is active**: Taking Cover while prone applies the ranged-only effect directly on first use, but opens the normal Take Cover dialog on later uses while that effect is already present.
- **Prone Take Cover expires after all attack-trait actions**: The special prone Take Cover effect now clears from actions with the attack trait, such as Grapple, in addition to attack rolls.
- **Greater cover bonus controls use the greater cover color**: Sneak and Hide cover controls now color the greater cover option with the greater cover palette instead of the standard cover color.

## [8.1.13] - 2026-05-07

### Changed

- **Take Cover better matches PF2E prone rules**: Prone tokens taking cover now receive a dedicated ranged-attack greater cover effect instead of being treated as generic standard or greater cover.
- **Cover effects are visible but unidentified on tokens**: Visioner cover effects now show token icons while remaining unidentified to players.

### Fixed

- **Prone Take Cover no longer opens an unnecessary first-use dialog**: Taking Cover while prone now applies the special ranged-only cover effect directly unless that effect is already present, in which case the normal Take Cover dialog opens.
- **Prone Take Cover expires after attack actions or standing up**: The special prone Take Cover effect is removed when the actor makes an attack roll, uses an action with the attack trait, or loses the prone condition.
- **Attack rolls no longer show false Take Cover automation panels**: Attack roll messages that mention Take Cover through cover effect metadata are no longer misidentified as Take Cover action messages.
- **Greater cover bonus controls use the greater cover color**: Sneak and Hide cover controls now color the greater cover option with the greater cover palette instead of the standard cover color.
- **Rule-element cover checks handle missing token documents safely**: Cover rule element lookup now guards missing token document flag APIs instead of throwing during Take Cover analysis.

## [8.1.12] - 2026-05-07

### Added

- **Take Cover preview now supports bulk cover overrides**: The Take Cover dialog shows bulk cover buttons for none, lesser, standard, and greater cover, using cover-specific icons and styling.
- **Seek template placement can be range-limited**: A new Advanced Seek setting can limit Seek template placement by center-to-center distance from the seeker, with the placement preview clamping to the allowed edge when the mouse moves beyond the configured range.
- **PF2E HUD Take Cover now opens Visioner's cover workflow**: Clicking PF2E HUD's AC Take Cover button is intercepted when Visioner automation is enabled and opens the existing Visioner Take Cover preview dialog instead of applying PF2E's generic cover effect directly.

### Changed

- **Seek template range preview matches Seek styling**: The placement limit ring now uses the Seek blue accent color instead of the cover-warning orange.
- **Take Cover initializes from live auto-cover**: The Take Cover preview now starts each row from the freshly calculated auto-cover state instead of upgrading stale stored cover or a PF2E system cover effect level.
- **Bulk cover controls use cover-specific presentation**: The Take Cover bulk override bar now uses a cover-specific label and colors none, lesser, standard, and greater cover buttons with the same green, yellow, orange, and red palette used elsewhere.
- **Action dialogs have more room for their controls**: Seek, Hide, Sneak, and Create a Diversion preview dialogs open wider so result tables and action controls do not crowd each other.
- **Row Apply and Revert buttons match the compact icon-button style**: Per-row action buttons now use the same 30px rounded border treatment as adjacent action buttons while keeping their green and orange action colors.
- **Seek Detected By column is more compact**: The Seek results table now keeps the Detected By column narrow and centered since it only displays an icon.

### Fixed

- **Seek template placement no longer fails when the mouse is out of range**: Out-of-range mouse positions now place the template at the maximum allowed center-to-center range instead of showing an error and doing nothing, including when Foundry creates the underlying region before Visioner receives it.
- **Seek template placement returns to token controls**: After placing a Seek template, Visioner switches back to the token controls layer instead of leaving the user in region/template tooling.
- **Action dialog row buttons stay horizontal**: Seek, Hide, Sneak, Point Out, Create a Diversion, Consequences, and Take Cover action buttons now share explicit horizontal table-cell styling so Apply, Revert, and timer buttons do not stack vertically.
- **Action dialog footer buttons stay horizontal**: Bulk Apply All and Revert All footer buttons in action dialogs now use explicit row styling so they stay side by side.
- **Take Cover preview layout stays contained while resizing**: The Take Cover filters, bulk controls, results table, and footer now remain inside the dialog content layout instead of drifting or resizing independently.
- **Take Cover bulk cover controls include every cover level**: The dialog exposes none, lesser, standard, and greater cover as bulk-set options and keeps the clear action separate.
- **Consequences dialog columns no longer crush the Actions column**: The Attack Consequences table now reserves enough space for visibility controls and row action buttons instead of clipping the Actions header and buttons.

## [8.1.11] - 2026-05-07

### Fixed

- **Foundry v14 party tokens no longer cause recursive actor preparation during NPC vision sync**: Visioner now resolves scene token actor types by actor ID before touching token actor getters, avoiding stack overflows from party token synthetic actors.
- **Stealth-based initiative rolls now receive detected cover bonuses**: Stealth initiative rolls are routed through Visioner's stealth cover handling, can detect cover from wall-blocked hostile observers, and apply the selected cover modifier to the initiative roll without re-rendering the submitting dialog.

## [8.1.10] - 2026-05-06

### Fixed

- **Unnoticed tokens now disappear from observer vision like undetected tokens**: The detection wrapper now treats `unnoticed` as reaching the same non-detection threshold as `undetected`, so encounter-start unnoticed enemies are hidden on canvas as well as in combat trackers.

## [8.1.9] - 2026-05-05

### Fixed

- **Stealth initiative hidden results now require a valid hiding prerequisite**: Failed Stealth initiative checks only become `hidden` when the stealther has standard or greater cover, is concealed by the current Visioner state, or has the concealed condition; otherwise the encounter-start override is `observed`.
- **Auto-cover now works with cover-reducing attack features**: Visioner-created AC cover modifiers now use the PF2E/SF2E system `cover` slug, allowing features such as Starfinder 2e Operative Aim to reduce or suppress the cover bonus instead of treating Visioner cover as unrelated custom AC.

## [8.1.8] - 2026-05-05

### Fixed

- **Stealth initiative now uses initiative order and degree of Perception DC failure**: Passing Perception DC is split between `unnoticed` when the stealther beats the observer's initiative and `undetected` otherwise, while failed checks become `hidden` unless they miss the DC by more than 10 and do not beat the observer's initiative, in which case they become `observed`.

## [8.1.7] - 2026-05-04

### Fixed

- **Combat-start cover no longer gets stuck after token movement**: Combat-start cover now registers active auto-cover pairs and movement cleanup clears both the stored cover state and applied ephemeral cover effects when tokens move.

## [8.1.6] - 2026-05-03

### Fixed

- **Stealth initiative visibility is only determined at encounter start**: Initiative edits before combat starts now naturally use the latest values when encounter stealth overrides are first applied, while later initiative updates only refresh tracker UI and no longer recalculate initial `undetected`/`unnoticed` states.
- **Selected unnoticed icons stay purple in Visioner dialogs**: Selected `unnoticed` state buttons now use the same purple styling as the rest of the unnoticed UI instead of falling back to white.
- **Stealth initiative tracker markers stay purple on NPC rows**: Markers now render outside the tracker name element so PF2E HUD hidden-name hue filters, NPC row icon styling, and row-scoped visibility color variables can no longer recolor them green.

## [8.1.5] - 2026-05-03

### Fixed

- **Player Stealth initiative rolls now apply encounter visibility through the GM**: Non-GM initiative updates now request GM-side encounter stealth processing over socketlib, avoiding permission errors and allowing enemy `undetected`/`unnoticed` overrides to be written correctly.

## [8.1.4] - 2026-05-03

### Fixed

- **Undetected stealth initiative combatants no longer reveal their identity in trackers**: Player combat tracker rows now mask names and token images for encounter-start `undetected` stealth initiative combatants until the matching encounter override is removed.
- **Stealth initiative tracker marker stays purple in PF2E HUD**: The marker now forces its icon color so PF2E HUD tracker styles cannot recolor the `user-secret` indicator green.

## [8.1.3] - 2026-05-03

### Fixed

- **Auto-cover no longer upgrades creature-provided lesser cover when unrelated walls exist**: Creature-only cover now stays on the token-cover path unless a wall actually intersects the attacker-target line.
- **Open doors no longer grant wall cover**: Wall cover overrides on open doors are ignored, matching the door's non-blocking state.
- **Wall cover now requires a real in-between wall hit**: Off-axis sampled-only wall coverage no longer grants standard or greater cover, while walls directly between attacker and defender still grant at least standard cover even when edge sampling is below threshold.

## [8.1.2] - 2026-05-03

### Added

- **Combat-start cover computation**: Added an opt-in Cover setting that computes normal auto-cover states between non-allied combatants when combat starts, seeding encounter cover without creating manual cover overrides.
- **GM-hidden token support for stealth initiative**: Encounter stealth initiative setup now toggles GM-hidden stealth combatants visible at combat start before applying the appropriate encounter-start visibility overrides.

## [8.1.1] - 2026-05-03

### Fixed

- **Unnoticed override tooltip icons now use the correct purple color**: Floating override tooltips now include an explicit `unnoticed` state color rule, preventing the `user-secret` icon from inheriting the generic green observed styling.

## [8.1.0] - 2026-05-03

### Added

- **First-class `unnoticed` visibility support**: PF2E Visioner now recognizes `unnoticed` as its own visibility state throughout the module, including labels, colors, Token Manager state options, hover tooltip badges, and AVS override flows. This lets Visioner model the PF2E distinction between a creature whose location is unknown (`undetected`) and a creature whose presence is not known at all (`unnoticed`).
- **Encounter stealth initiative setup**: Added an opt-in world setting for PF2E Avoid Notice style encounter starts. When enabled, combatants who rolled initiative with the Stealth statistic receive encounter-start AVS overrides against enemy observers.
- **Rules-accurate Avoid Notice visibility states**: Stealth initiative is now compared against each enemy observer's Perception DC. If the Stealth initiative meets or exceeds the DC, the stealther becomes `unnoticed`; otherwise Visioner leaves the pair to regular AVS visibility calculations.
- **Tracker hiding for initial unnoticed enemies**: Player combat trackers now hide stealthers only while the initial encounter-start `unnoticed` override is active. `undetected` enemies remain visible in the tracker, because the observer knows someone is present.
- **PF2E HUD combat tracker support**: The encounter stealth tracker filtering also applies to PF2E HUD tracker rows in addition to the core Foundry combat tracker.
- **Stealth initiative tracker marker**: Combatants who rolled Stealth for initiative now show a small purple `user-secret` marker beside their tracker name, with a tooltip that identifies the roll statistic without exposing per-user visibility state.
- **Unnoticed hover tooltip state**: `unnoticed` uses a purple `user-secret` hover badge and the same no-sense-badge behavior as `undetected`, making it visually distinct from hidden and undetected states.

### Improved

- **Compatibility with PF2E Avoid Notice workflows**: Encounter stealth setup is disabled by default so tables that prefer the PF2E Avoid Notice module or manual handling can keep their existing flow unchanged.
- **Multi-token player ownership handling**: If a player owns several tokens and any owned enemy observer can see a stealther, that stealther remains visible to the player in the combat tracker.
- **Initial stealth override lifecycle**: Encounter-start `unnoticed` overrides preserve any previous AVS override for the same observer-target pair and restore it when the encounter-start override is removed.

### Fixed

- **Stealth initiative no longer depends on initiative order for visibility**: Avoid Notice visibility now follows Stealth roll versus Perception DC, including equal values counting as a success for the stealther.
- **Only enemy observers participate in encounter stealth setup**: Allies are no longer considered when deciding whether a stealth initiative combatant is initially unnoticed.
- **Tracker rows no longer reveal stealthers on their turn while the initial unnoticed override remains active**: Repeated tracker refreshes keep hidden rows suppressed until the GM removes the encounter-start override.
- **Initial tracker hiding is not recreated after later Sneak/undetected states**: Once the initial encounter-start unnoticed override is removed, later changes back to undetected or unnoticed do not re-hide the combatant as part of this feature.

## [8.0.6] - 2026-04-27

### Fixed

- **Wall auto-cover thresholds now apply when walls obscure token edges but not the center ray**: Wall cover detection now runs target coverage sampling whenever scene walls are present, so Foundry V14 wall threshold settings can produce standard or greater cover even when the exact center-to-center line is clear.
- **Wall auto-cover detects Foundry V14 wall placeables reliably**: Wall cover checks now read both `canvas.walls.objects.children` and `canvas.walls.placeables`, preventing always-`none` cover results when Foundry exposes walls only through the placeables collection.
- **Wall auto-cover no longer skips real wall intersections because of Levels' broad collision pre-check**: Cover detection now evaluates intersected walls directly with per-wall height checks, reads Foundry V14 wall coordinates from document and edge data, and treats measured wall coverage thresholds as authoritative instead of always falling back to standard cover.
- **Clear selected token data no longer emits Foundry V14 forced-deletion warnings**: Token flag cleanup now uses `foundry.data.operators.ForcedDeletion` when available and falls back to legacy `-=` syntax only on older Foundry versions.
- **Movement through wall boundaries now refreshes LOS immediately**: Movement batches no longer reuse burst LOS memo entries or stale global visibility cache hits, perception now rebuilds vision after hidden/undetected effect cleanup, and observed/concealed batch updates also remove legacy off-guard effects so tokens become visible immediately after moving back into line of sight.
- **AVS movement re-detection no longer repeats stale visibility writes**: Visibility map cleanup now uses Foundry V14 dotted forced-deletion paths for individual target entries, preventing old `undetected` values from surviving an `observed` update.
- **AVS movement batches now keep the latest duplicate pair result**: When the same observer-target pair is recalculated more than once during a movement batch, the final result now wins instead of keeping an earlier stale state.
- **Wall quick cover icons use cover colors again**: The wall quick settings dialog now uses the same cover icon color utility classes as the wall manager, including the missing lesser-cover utility.

## [8.0.5] - 2026-04-22

### Fixed

- **Saving throws and skill checks no longer get stuck in PF2E check dialogs**: `8.0.4` expanded Visioner's dialog callback binding to generic submit buttons so attack-roll cover overrides would keep working on Foundry V14, but saving throw and skill-check dialogs use that same submit button for the actual roll. Visioner now limits the submit-button fallback to attack contexts only, preserving V14 attack support without blocking non-attack rolls.

## [8.0.4] - 2026-04-21

### Fixed

- **Deleted rule-element effects no longer leave stale visibility or cover overrides behind**: Some PF2e effect deletions were skipping Visioner cleanup because the delete hook relied on live `item.rules` instances instead of the persisted `item.system.rules` data. Deleted effect cleanup now reconstructs Visioner operations from item data, removes stale override/cover sources, and clears the matching registry flags reliably.
- **Rule-element visibility cleanup now removes custom source IDs correctly**: Visibility overrides using a custom `source` value could survive deletion because cleanup matched only the generated rule-element ID. Cleanup now matches both the rule-element ID and any explicit operation source, preventing stale predicate-based visibility overrides from reappearing after movement or recalculation.
- **`provideCover` rule element is now recognized by the schema**: The operation existed in the implementation and documentation, but was missing from the PF2eVisionerEffect schema choices, so item data using `type: "provideCover"` was rejected before it could run. The schema now accepts `provideCover` correctly.

## [8.0.3] - 2026-04-21

### Fixed

- **Attack-roll auto-cover works again with PF2E check dialogs on Foundry V14**: PF2E V14 uses a submit button in the check modifiers dialog instead of the older `button.roll` path, so Visioner's dialog cover callback could fail to bind and selected cover overrides would never apply. Auto-cover now binds to both dialog button variants, defers attack cover application to the dialog when PF2E check dialogs are enabled, and correctly applies the selected cover level to the target AC/DC.
- **Attack-roll auto-cover no longer drops to detected lesser cover before dialog selection**: Attack rolls were applying detected cover in the pre-roll wrapper before the PF2E check dialog existed, causing the later manual selection in the dialog to be ignored. The wrapper now detects cover and defers final application to the dialog callback, making the chosen cover state authoritative.
- **Visibility-map deletions stay compatible with both Foundry V13 and V14**: V14 now uses `foundry.data.operators.ForcedDeletion`, while V13 still expects legacy `-=` deletion syntax. Visibility-map persistence now uses the modern operator when available and falls back to legacy whole-flag and nested-key deletion syntax otherwise, preserving backward compatibility.

## [8.0.2] - 2026-04-20

### Fixed

- **Observed visibility now clears stale stored entries correctly**: When a visibility pair returned to `observed` while the observer still had other non-observed targets, the old target entry could remain in the persisted visibility map and be read back as stale `hidden`/`undetected`. Visibility map writes now explicitly remove obsolete target keys during the document update, keeping persisted state aligned with the calculated result.
- **Closed doors no longer incorrectly block same-side line of sight**: The door LOS shortcut could treat diagonal rays that passed near a closed door as blocked even when both sampled points were on the same side of the door plane. Door checks now require a real plane crossing, preventing false `hidden`/`undetected` results when tokens remain on the same side of a closed door.
- **Long token moves no longer snap to the destination mid-animation**: Auto-visibility batches could finalize against a moving token before the rendered token had reached its destination, then persist visibility/detection state onto that token and cause Foundry to snap it to the endpoint. Movement batches and token flag writes now wait for the token to settle before processing.

## [8.0.0] - 2026-04-14

### Added

- **Foundry VTT V14 support**: PF2E Visioner now supports Foundry VTT V14, including updated native region/surface collision handling for multi-level scenes.
- **Automatic AVS recalculation for Define Surface changes**: AVS now immediately recalculates when `Define Surface` region behaviors are created, updated, or deleted.
- **Automatic AVS recalculation for region level placement changes**: Changing a region's placement levels now forces an immediate AVS refresh, ensuring cross-level visibility stays in sync with Levels configuration.
- **Seek template auto-cleanup after results open**: When a GM places a Seek template and opens the Seek results dialog, the placed template region is automatically removed and the setup button state is reset.

### Improved

- **Cross-level native surface collision side selection**: Levels/Foundry surface collision checks now choose the correct surface side based on ray direction (`above` for upward rays, `below` for downward rays), improving consistency for vertical LOS and sound checks between levels.

### Fixed

- **Visibility map persistence consistency**: Visibility map writes now use full token document updates consistently, matching cover map persistence and preventing store test regressions.
- **Lighting region lookup safety**: Auto-visibility lighting calculations now safely handle scenes/tests where `scene.regions` is missing or not provided as a plain array.

## [7.6.3] - 2026-03-31

### Fixed

- Remove more debug logs.

## [7.6.2] - 2026-03-31

### Fixed

- Remove debug logs.

## [7.6.1] - 2026-03-31

### Fixed

- **Hide/Stealth with cover wipes all roll options**: When `context.options` was a `Set` (as PF2e system passes it), the cover injection code fell back to an empty array, stripping all existing roll options (action:hide, secret, check:statistic:stealth, etc.) and leaving only `area-effect`.
- **Stealth checks incorrectly tagged as area-effect**: Cover injection for stealth checks was adding `area-effect` to roll options (copy-pasted from saving throw logic). Stealth cover uses `action:hide`/`action:sneak` predicates, not `area-effect`.

## [7.6.0] - 2026-03-30

### Added

- **Deferred Seek for targets outside line of sight**: Seek no longer applies overrides to targets the seeker cannot see. Results for targets behind walls are stored on the seeker token and automatically applied when LOS is established (via movement or opening doors). Deferred results clear on turn change or combat end. A clock icon ("No LOS") appears in the Seek dialog for deferred targets.
- **Per-row accept in override indicator tooltip**: Right-click individual rows in the AVS indicator tooltip to accept a single override change without opening the full dialog.
- **Override indicator updates on door changes**: The AVS changes indicator now updates when doors are opened/closed, not just on token movement.
- **Door changes trigger deferred seek and override validation**: Opening/closing doors now triggers batch recalculation, deferred seek application, and override indicator updates via the `batchComplete` hook.
- **Deferred seek indicator badge**: The "Seek (Deferred)" source label appears in the override validation dialog and tooltip for overrides applied from deferred seek results.

### Fixed

- **Seek/Hide "Apply Changes" no longer bypass validation**: Both action apply buttons silently swallowed validation errors via empty `catch {}`, allowing incorrect visibility changes. Now blocks the apply and warns if validation fails.
- **Seek skips allies when ignoreAllies setting is enabled**: The "Apply Changes" button now respects the `ignoreAllies` setting, filtering out allied tokens from seek outcomes before applying overrides.
- **Seek skips loot tokens without GM-configured stealth DC**: Loot tokens with no explicit stealth DC (or DC 0) are excluded from seek results entirely. Only loot with a GM-set DC participates in seek.
- **Override indicator accumulates across multiple tokens**: When multiple PCs move simultaneously, overrides from all tokens are accumulated and shown together instead of the last token's result overwriting previous ones.
- **Override indicator tooltip stays on hover**: Added 150ms hover delay so the tooltip doesn't disappear when moving the cursor from the indicator to the tooltip content.
- **Override indicator per-row hover highlight**: Tooltip rows show a subtle background highlight on hover for better right-click targeting.
- **Cover icon colors in validation dialog**: Greater cover icons now display correct red color instead of inheriting dark secondary text color from a CSS specificity issue.
- **Token images in validation dialog**: Fixed image resolution order and added inline sizing to prevent Foundry's global `max-width: 100%` from collapsing token images to 0px.

## [7.5.2] - 2026-03-27

### Fixed

- **Sneak "Apply Changes" now removes the Sneaking effect**: The chat Apply button was resolving the wrong unlinked token when multiple tokens shared the same actor name. Token resolution now prioritizes the token ID stored in message flags from "Start Sneak".
- **Sneak "Revert" now works correctly**: Revert clears AVS pair overrides and triggers a fresh AVS recalculation instead of attempting to restore stale cached states. Button properly switches back to "Apply Changes" after reverting.
- **Sneak revert no longer silently fails without a session**: `SneakActionHandler.revert()` was returning early when no active session existed (always the case from the chat button path). Now falls through to the base class revert.
- **Sneaking effect removal uses PF2e `itemTypes.effect` accessor**: Effect lookup via `actor.items.filter()` returned empty on PF2e's Collection. Now uses `actor.itemTypes.effect` with a name-based fallback, fixing cases where the Sneaking effect persisted after apply/revert.
- **Invisible condition now shows translucent token immediately**: Toggling the invisible condition applies Foundry's `InvisibilityFilter` via `_configureFilterEffect`, so the GM sees the visual effect without a page refresh. Scoped to the controlled token to avoid affecting other tokens of the same actor.

### Improved

- **Cached debug setting reads for faster batch processing**: Logger `isEnabled()` now reads `autoVisibilityDebugMode` and `debug` settings once per session instead of on every call, eliminating ~0.6ms overhead per log check during combat batch updates. Changing debug settings prompts a world reload to apply.

## [7.5.1] - 2026-03-24

### Fixed

- **Invisible token movement no longer degrades to undetected**: Hidden state now persists across movement recalculations. Previously, moving an invisible token re-read `previousState` from the live visibility map (which already said `hidden`), causing it to degrade to undetected. Now `hidden` correctly resolves to `hidden` in `resolveInvisibilityFromPreviousState`.
- **Invisible condition removal now updates visibility immediately**: `extractAuxiliaryConditions` was checking `flags.invisibility` (per-observer tracking data) as evidence of invisibility. These flags persist after the condition is removed, causing the target to remain invisible to the stateless calculator. Now only checks `flags.invisible` (explicit flag) and the actual PF2e condition.
- **Invisibility previousState reads from ConditionManager flags first**: Adapter now reads `previousState` from the stable `flags['pf2e-visioner'].invisibility[observerId].previousState` set when invisibility is first applied, falling back to `visibilityMapCache` only if flags aren't available.
- **GM guards re-applied to BatchOrchestrator**: Re-added `game.user.isGM` guards to `_applyBatchResults` and `_syncEphemeralEffectsForUpdates` after linter revert.

## [7.5.0] - 2026-03-24

### Added

- **Invisibility previous-state tracking**: When a creature becomes invisible, visibility now degrades based on PF2e rules. Previously observed/concealed targets become hidden (observer knew where they were); previously hidden targets become undetected. Targets with no prior visibility state default to undetected.

### Improved

- **600x batch processing speedup**: Eliminated dynamic imports and unnecessary `await` yield points in the per-pair visibility calculation loop. 56 visibility calculations dropped from ~6600ms to ~11ms for 8 tokens.
- **Batched visibility map writes**: Grouped per-pair `token.document.update()` calls by observer, reducing O(N²) Foundry document writes to O(N) per batch.
- **Skip darkness ray checks when no darkness sources**: Adapter skips async `checkDarknessRayIntersection` entirely when `hasDarknessSources` is false, eliminating unnecessary async overhead.
- **Ephemeral effect sync optimization**: Switched from per-pair sequential `updateSingleVisibilityEffect` to batched `batchUpdateVisibilityEffects`, and stopped generating `forceEphemeralOnly` entries for every unchanged pair.

### Fixed

- **Player permission errors on condition changes**: Added GM guards to token document writes in `ConditionManager`, `BatchOrchestrator`, ephemeral effect handlers (`batch.js`, `update.js`), preventing "lacks permission to update Token" errors on player clients.

## [7.4.0] - 2026-03-18

### Added

- **Starfinder 2e (sf2e) system support**: Module now works with both Pathfinder 2e and Starfinder 2e. System-dependent paths (icons, compendiums, settings) are resolved dynamically via a system adapter.

## [7.3.2] - 2026-03-17

### Fixed

- **Stealth cover bonus always showing Greater Cover**: Stealth checks evaluated cover against every token on the scene (including those behind walls with no line of sight, allies, and neutral tokens), causing the cover override to incorrectly default to Greater Cover. Now filters observers by line of sight (using VisionAnalyzer) and alliance, and only considers hostile tokens that can actually see the hider.
- **Stealth cover detection direction reversed**: Cover was being detected from hider→observer instead of observer→hider, checking what cover the observer had rather than what cover the hider had.
- **Stealth cover state uninitialized in roll path**: `detectedState` was not initialized to `'none'` in `handleCheckRoll`, causing the cover precedence comparison to silently fail.

## [7.3.1] - 2026-03-17

### Fixed

- **Impulse attack rolls not applying cover flat check**: Kineticist impulse attack rolls (`impulse-attack-roll`) were not recognized as attacks, so cover conditions were not applied. Added impulse attack roll support to both the action extractor and ephemeral effect rule selectors.

## [7.3.0] - 2026-03-11

### Improved

- **Lazy CSS loading for improved performance**: Module stylesheets are now loaded on-demand instead of all at init. Only base variables and colorblind CSS load at startup (~147KB); the remaining ~226KB (token manager, dialogs, responsive, tooltips, position tracking) loads when the corresponding UI is first opened and unloads when closed. Reduces style recalculation overhead during normal gameplay.

## [7.2.1] - 2026-03-07

### Fixed

- **3D line-of-sight mismatch with Levels API at different elevations**: Cover detection disagreed with the Levels API when tokens were at different elevations (e.g., attacker at 100ft, target at 0ft). The wall height check used a full height beam (bottom-to-top of both tokens) instead of a single midpoint ray matching the Levels API behavior. Now uses midpoint-to-midpoint ray and defers to the Levels API `testCollision` as the authoritative 3D collision check.
- **Walls auto-detection no longer grants lesser cover**: Auto-detected wall cover is clamped to standard minimum. Manual wall overrides can still grant lesser cover.

## [7.2.0] - 2026-03-07

### Added

- **Sense Suppression Region Behavior**: New region behavior that allows GMs to suppress specific senses within a region. Useful for areas with overpowering stench (disabling scent), zones of silence (suppressing hearing), magical darkness fields, and more. Configurable per-region with multi-select sense checkboxes and separate "Affects Observer" / "Affects Target" options.
- **Seek action respects sense suppression**: The Seek action now filters out suppressed senses before determining detection. If all senses are suppressed (e.g., blinded + hearing suppressed), the seek cannot detect any targets.
- **Sense suppression indicators**: Suppressed senses are shown as a small ban icon overlay on hover tooltip badges, as a badge in the Seek dialog header, and as a reason in the visibility factors overlay.

### Fixed

- **Seek "Detected By" column showing stale data**: The Detected By column in seek results now uses the freshly-calculated sense from the seek adapter instead of falling back to a potentially stale detection map.

## [7.1.3] - 2026-03-06

### Fixed

- **Walls with max height (Wall Height module) still providing cover when attacker is far above them**: When using Wall Height to set a max height on walls (e.g. 5ft), elevated attackers would still receive cover from those walls even when clearly shooting over them. The wall height check used a combined elevation envelope of both tokens instead of calculating the actual 3D line-of-sight elevation at the wall's intersection point. Now uses proper 3D interpolation — if the sight line passes above (or below) the wall at the point where it crosses, the wall is correctly ignored for cover and visibility.

## [7.1.2] - 2026-03-05

### Fixed

- **Cover roll options not appearing on attack rolls**: Cover roll options (`target:cover-level:<state>`, `target:cover-bonus:<bonus>`) were not injected into the attack roll's `context.options`, so they didn't appear in the Roll Inspector. Now injected via both the dialog callback and the ephemeral effect paths.

## [7.1.1] - 2026-03-05

### Fixed

- **AVS not updating on token movement**: Fixed a bug where AVS visibility recalculation was silently skipped when tokens moved. The animation detection check produced a false positive when `_animation` was null (no animation running), causing all position updates to be dropped without processing. This affected both player and GM token movements.
- **Levels elevation cover bypassing "Walls Allow Greater Cover" setting**: Levels elevation adjustment could upgrade cover to 'greater' in both the wall override path and the general elevation adjustment path, bypassing the `wallCoverAllowGreater` setting. Both paths now cap at 'standard' when the setting is disabled.
- **Levels distance calculation using wrong divisor**: The grid distance calculation in `LevelsIntegration` used `canvas.dimensions.distance` instead of `canvas.dimensions.size / canvas.dimensions.distance`, producing incorrect elevation-based cover results.
- **Cover level roll options missing from ephemeral effects**: Auto-cover ephemeral effects and aggregated cover effects now include `self:cover-level:<state>` and `self:cover-bonus:<bonus>` roll options, enabling rule elements and predicates to check the active cover level.

## [7.1.0] - 2026-03-04

### Added

- **Thoughtsense**: New sense that detects creatures with minds as an imprecise sense. Has no effect on mindless creatures or objects (constructs). Undead without the mindless trait are detected; mindless undead are not. Shows a purple border indicator on system-hidden tokens, matching the lifesense indicator style.

## [7.0.1] - 2026-02-25

### Fixed

- **Huge/Gargantuan tokens getting greater cover from walls with Levels module**: Levels elevation adjustment in the wall cover path could upgrade cover to 'greater', bypassing the "Walls Allow Greater Cover" setting. Wall cover is now capped at 'standard' after Levels adjustment when the setting is disabled.

## [7.0.0] - 2026-02-24

### Added

- **Token Size Cover Filter**: New settings to ignore tokens from providing Auto-Cover based on their size relative to the attacker
  - Ignore Smaller Tokens — tokens smaller than the attacker won't provide cover
  - Ignore Same Size Tokens — tokens the same size as the attacker won't provide cover
  - Ignore Larger Tokens — tokens larger than the attacker won't provide cover

- **Region Cover Behavior**: New region behavior that grants cover to tokens based on region placement, similar to AVS Concealment regions but for cover
  - **Override Mode**: Tokens inside the region always have the configured cover level from any observer
  - **Line of Sight Mode**: Cover applies when the line between observer and target crosses the region boundary, or when both tokens are inside
  - **One Way Mode**: Cover only applies to tokens inside the region when observed from outside; tokens inside looking out get no cover
  - Configurable cover level (Lesser, Standard, Greater) per region
  - Can be enabled/disabled per region behavior
  - Integrates with the auto-cover detection pipeline — region cover is combined with existing cover calculations, taking the highest

## [6.0.1] - 2026-02-24

### Fixed

- **Sneak "Apply Changes" ignoring start state and cover/concealment**: Clicking "Apply Changes" directly now correctly accounts for whether the token started hidden/undetected and whether they ended in cover or concealment, matching the behaviour of "Open Sneak Results" → "Apply All Changes".

## [6.0.0] - 2026-01-23

### ✨ Added

- **Token Manager Timers**: Active timed overrides now tick live in the UI
  - Countdown updates without requiring a re-render
  - Badge tooltip updates stay in sync with the displayed time

- **Action Dialog Row Timers**: Row-level duration picker available via the clock button
  - Selecting a duration applies that override as timed (rounds/realtime)
  - Selected duration is reflected on the row (button state/label)

- **Timer Duration Dialog UX**: Combat-only round timing fields are now context-aware
  - Start/End of turn + combatant selector hidden for non-round timers (realtime/permanent)
  - Round options still require an active combat

### 📝 Notes

- **What timers are**: Timers attach to manual AVS pair overrides (observer → target) as a `timedOverride` payload
  - While a manual override exists, AVS calculations for that pair are bypassed
  - When a timer expires (or is cancelled), the manual override is removed and AVS resumes controlling that pair

- **Timer types**
  - Rounds: decrements on combat turn changes; can expire at start/end of a selected combatant’s turn; requires active combat
  - Realtime: expires at a wall-clock timestamp; checked periodically by the GM client; does not expire while the game is paused

- **Combat end behavior**: Round-based overrides convert to Permanent when combat ends

## [5.7.0] - 2026-01-29

### ✨ Added

- **Turn Change AVS Override Validation**: GM prompted to accept/reject AVS changes for manual overrides each turn
  - **Unified table view**: Shows all override relationships (Observer → Target) in turn change mode
  - **Automatic visibility calculation**: Displays current visibility AVS wants to apply vs manual override
  - **Cover calculation**: Shows cover changes (none/lesser/standard/greater) AVS wants to apply
  - **Deduplication**: Each observer-target pair shown once regardless of combatant order
  - **Token navigation**: Click token images to pan to token
  - **Bulk actions**: Accept All/Reject All for efficient management
  - **Individual control**: Accept/reject per override relationship
  - **Conflict prevention**: Skips prompt if dialog already open from token movement

### 🔧 Technical

- **API enhancements**: Added `clearAllAVSOverrides(tokens)`, `hasAVSOverrides(token)`, `getAVSOverrides(token)` methods
  - `clearAllAVSOverrides`: Now accepts optional token/array to reset specific tokens
  - `hasAVSOverrides`: Check if token has any AVS overrides (as observer or target)
  - `getAVSOverrides`: Get all overrides involving token with names, images, states
- **Combat hooks**: Added `checkAvsOverrides()` on turn change
  - Checks all combatants for AVS overrides
  - Calculates current visibility using `calculateVisibilityWithoutOverrides()`
  - Calculates current cover using `CoverDetector.detectFromPoint()`
  - Deduplicates overrides using Map with observer-target key
- **Dialog integration**: Reuses existing `OverrideValidationIndicator` and `OverrideValidationDialog`
  - Added `isTurnChange` flag for different UI/messaging
  - Unified table layout for turn change mode
  - Observer/Target columns with tooltips explaining relationships

## [5.6.1] - 2026-01-27

### 🐛 Fixed

- **Shared Vision Blindness Handling**: All vision sharing modes now properly respect blindness conditions
  - **One-way**: Blinded master cannot share vision, minion falls back to own vision
  - **Two-way**: Blinded master cannot share, but minion blindness doesn't prevent master from sharing
  - **Replace**: Blinded master causes minion to fall back to own vision
  - **Reverse**: Blinded minion causes master to fall back to own vision

## [5.6.0] - 2026-01-27

### ✨ Added

- **ShareVision Rule Element Operation**: Implemented vision sharing between tokens
  - **Four modes**: `one-way`, `two-way`, `replace`, `reverse` for flexible vision control
  - **Actor UUID based**: Master identification persists across scenes using actor UUIDs
  - **Predicate support**: Conditional vision sharing based on roll options
  - **Immediate vision refresh**: Controlled tokens see changes instantly
  - **Automatic cleanup**: Master token deletion/defeat removes all associated vision sharing
  - **Scene transition handling**: Vision sharing properly maintained when moving between scenes
  - **Reliable vision reinitialization**: `preUpdateToken`/`updateToken` hook pair ensures vision sources update after flag changes

- **Shared Vision Indicator**: Floating indicator showing active vision sharing relationships
  - **Master/Minion detection**: Automatically detects if controlled token is sharing vision or receiving it
  - **Multi-minion support**: Cycle through multiple minions when master has several
  - **Mode-specific icons**: Different icons for each vision sharing mode (arrows, exchange)
  - **Quick actions**: Left-click to pan, right-click to remove, cycle arrow for multiple minions
  - **Configurable size**: Client setting with small/medium/large/xlarge options (defaults to small)
  - **Draggable**: Position saved per-client
  - **Count badge**: Shows current minion index (1/3) when multiple minions exist
  - **Token config integration**: Works with both rule element and manual token config methods

### 🔧 Technical

- **Helper function**: Added `getSceneTokenIdFromActorUuid` to resolve actor UUIDs to scene token IDs
- **Flag system**: Uses `visionMasterActorUuid`, `visionMasterTokenId`, `visionSharingMode`, `visionSharingSources` flags
- **Detection wrapper**: Updated to handle reverse mode correctly
- **Cleanup hooks**: Master token deletion and scene changes trigger proper vision sharing removal
- **SharedVisionIndicator class**: Singleton pattern with refresh support and live size updates
- **Dual detection**: Checks both `visionMasterTokenId` (token config) and `visionMasterActorUuid` (rule elements)

### 🐛 Fixed

- **Token config vision mode dropdown**: Now works correctly on first try after selecting a master
- **Vision master actor UUID**: Token config now properly saves both token ID and actor UUID for persistence

## [5.5.1] - 2026-01-13

### 🐛 Bug Fixes

- **Vision for NPCs**: Fixed setting not fully applying on toggle
  - Now updates existing NPC tokens already on scenes
  - New NPC tokens created on canvas now inherit the setting (on/off)
  - NPC prototype tokens now sync so future drops inherit correctly

## [5.5.0] - 2026-01-10

### ✨ Added

- **Action Qualification Force Override**: Added `forceStartQualifies` and `forceEndQualifies` properties for `modifyActionQualification` rule elements
  - Allows effects to force Hide/Sneak prerequisites to pass regardless of cover/concealment
  - Useful for custom effects like "camouflage dye" that enable stealth without normal requirements
  - Supports both top-level flags (`hide.forceEndQualifies`) and position-scoped flags (`sneak.end.forceQualifies`)
  - Integrated into Hide/Sneak dialogs, action handlers, and turn-end validation

- **GM Vision AVS Warning**: GM-only banner warns that AVS won't work while PF2e GM Vision is active (no vision polygon)
  - Includes dismiss (×) and a persistent "Don't show again" option (client setting)

### 🐛 Bug Fixes

- **AVS Scene Disable**: Purging/cleanup no longer clears the per-scene "Disable AVS" flag

## [5.4.1] - 2026-01-09

- **Override Validation Indicator**: Fixed indicator showing for players; now GM-only
- **Override Validation Indicator**: Fixed indicator appearing on token control/selection; now only shows for actual movement/queued validations

## [5.4.0] - 2026-01-04

### ✨ Added

- **Override Validation Queue System**: Implemented LIFO queue for managing multiple token movement indicators
  - Processes most recent token movement first
  - Auto-advances to next indicator after accepting/rejecting current one
  - Shows queue position in indicator title (e.g., "(3 of 3)")
  - Visual queue badge displays total pending indicators
  - Tooltip shows next token in queue
  - Tokens moving multiple times update data without re-ordering in queue
  - Scrollable tooltip with increased size (300-450px) for better readability
  - Moving token highlighted in green with walking icon
  - Right-click now accepts only current indicator's overrides and advances to next

- **Sniping Duo Dedication**: Added support for the "designated spotter" not granting lesser cover for Strikes between duo members
  - Token Config UI to pick a Sniping Duo spotter
  - Auto-cover ignores the spotter as a blocker for eligible Strikes
  - Chat indicator added when Sniping Duo cover-ignore applies

## [5.3.1] - 2025-12-06

### 🛠️ Improved

- **Encounter Master Dialog**: Improved token selection UX
  - Filters out hazards and loot tokens from the selection list
  - Sorts tokens by proximity to the token being configured

## [5.3.0] - 2025-12-05

### ✨ Added

- **Encounter Master Token Setting**: Added ability to manually link tokens to a master token for encounter participation
  - Tokens with an Encounter Master set will be considered part of the encounter when their master is in combat
  - Useful for eidolons, companions, pets, or other minions not directly in the combat tracker
  - Accessible via Token Config → Vision tab → PF2E Visioner section
  - Visual dialog with token images and pan-to-token functionality for easy selection

## [5.2.2] - 2025-12-02

### 🐛 Bug Fixes

- Actually push the code

## [5.2.1] - 2025-12-02

### 🐛 Bug Fixes

- **Sneak End Position Qualification**: Fixed concealed, hidden, and undetected states not qualifying for sneak ending position
  - End position now correctly qualifies with concealed state
  - End position qualifies with hidden/undetected when `sneakAllowHiddenUndetectedEndPosition` setting is enabled
  - Fixed `ActionQualifier.checkSneakPrerequisites` incorrectly returning `qualifies: false` when no rule element sources exist

## [5.2.0] - 2025-12-02

### ✨ Added

- **Blinded Condition Terrain**: Creatures with the Blinded condition now treat all movement as difficult terrain (cost x2), reflecting the difficulty of moving without sight.
- **Darkness Spell Terrain**: Darkness spell templates now automatically create an attached Region that applies difficult terrain (cost x2) to all movement types (Climb, Swim, Fly, Stride) within the area.

## [5.1.1] - 2025-11-25

### 🐛 Bug Fixes

- **Wall Movement Property**: Fixed wall movement property changes incorrectly triggering AVS recalculation
  - Wall movement restrictions (`move` property) should not affect line of sight calculations
  - Removed incorrect check that excluded walls with `move=NONE` from sight blocking calculations

## [5.1.0] - 2025-11-21

### ✨ Added

- Scene setting: per-scene "Disable AVS for this Scene" flag with a localized tooltip (checkbox title) to suppress Auto-Visibility System calculations for the current scene.
- Ensure AVS honors the per-scene disable flag: added early-exit checks to the AVS batch pipeline and visibility recalculation entry points so no calculations are performed when the scene flag is enabled.
- Recalculate AVS state when the per-scene flag is changed: register an `updateScene` hook to trigger a recalculation when the scene flag is toggled.

## [5.0.2] - 2025-11-19

### 🗑️ Removed

- **Rule Elements**: Removed `PF2eVisionerVisibility` rule element
  - This rule element has been deprecated in favor of `PF2eVisionerEffect` which provides more comprehensive functionality
  - All references to `PF2eVisionerVisibility` have been removed from the codebase
  - Users should migrate existing items to use `PF2eVisionerEffect` instead

## [5.0.1] - 2025-11-19

### 🐛 Bug Fixes

- **Rule Elements**: Fixed `PF2eVisionerEffect` rule elements not working on feats, equipment, and other non-effect items
  - Previously only processed rule elements on items with `type: "effect"`
  - Now correctly processes rule elements on all item types (feats, equipment, effects, etc.)
  - Affects lifecycle reapplication, movement reapplication, and item update hooks

## [5.0.0] - 2025-10-24

**PF2eVisionerEffect Rule Element System:**

- Complete rule element framework for advanced visibility and cover control
- Eight operation types for comprehensive customization:
  - `modifySenses`: Modify sense ranges and precision (darkvision, hearing, etc.)
  - `overrideVisibility`: Force specific visibility states with direction control
  - `distanceBasedVisibility`: Apply visibility states based on distance bands
  - `overrideCover`: Provide or block cover to specific targets
  - `modifyActionQualification`: Control action prerequisites
  - `conditionalState`: Apply states based on conditions
  - `offGuardSuppression`: Suppress off-guard penalty from hidden/undetected attackers
- Predicate support at both rule and operation levels for conditional application
- Priority system for conflict resolution between multiple effects
- Source tracking for qualification checks and effect management
- Range limitations and directional control (to/from)
- Full PF2e roll options integration

**Off-Guard Suppression:**

- Suppress off-guard penalty when attacked by hidden/undetected creatures
- Removes ephemeral off-guard effects when suppression is active
- Works with attack roll pipeline and AVS ephemeral effect system
- Compatible with other off-guard sources (flanking, prone, etc.)

#### 📚 Documentation

- Comprehensive `RULE_ELEMENTS.md` with examples for all operations
- Operation-specific property references and use cases
- Homebrew guide with best practices
- Example JSON configurations for common feats and spells
- API documentation for rule element system

#### 🔧 Technical

- Extensive test coverage for all rule element operations
- Integration with existing visibility and cover systems
- Clean separation between rule element logic and effect application
- Support for both PC and NPC actors

## [4.5.7] - 2025-11-18

### ⚡ Performance Improvements

- Introduced a centralized, pan-aware RAF scheduler so HoverTooltips, visual-effects pulses, and other animations throttle or pause while the canvas is panning/zooming; scheduler has dedicated unit coverage
- Hover tooltips, cover overlays, and HUD badges now suspend DOM/PIXI work during pan/zoom and resume cleanly afterward, avoiding compounded FPS drops
- Cover visualization and wall label overlays respect viewport culling and use a dedicated render layer so showing all labels at once no longer tanks performance

### 🐛 Bug Fixes

- Hover tooltips no longer misinterpret keybind releases during pan/zoom
  - `onHighlightObjects(false)` clears `_savedKeyTooltipsActive`, preventing Alt/O overlays from relaunching immediately after keyup
  - Regression test (`hover-tooltips-keybind-state.test.js`) reproduces the pan-lock scenario to guard future changes
- Wall cover labels respect the keybinding lifecycle: holding the key shows all manual overrides simultaneously, releasing it clears every label and destroys the dedicated layer to avoid lingering sprites

## [4.5.6] - 2025-11-16

### ✨ Features

- **Lesser Cover Wall Override**: Added lesser cover as a wall cover override option
  - New "Lesser Cover Maximum" option in Wall Manager and wall quick config
  - Walls can now be set to provide up to lesser cover based on coverage thresholds
  - Added bulk action to set all walls to lesser cover
  - Cover cycling now includes lesser: auto → none → lesser → standard → greater → auto

### 🐛 Bug Fixes

- **Wall Cover Override Logic**: Fixed wall cover override behavior
  - Cover-granting overrides (lesser/standard/greater) now apply if wall intersects line, regardless of natural blocking
  - Override 'none' only applies if wall would naturally block (to remove natural cover)
  - Ensures overrides work correctly even when walls wouldn't naturally provide cover

### ⚡ Performance Improvements

- **UI Hook Optimization**: Reduced unnecessary UI re-renders
  - Token and wall cover cycling tools only re-render when icon/title actually changes
  - Update token tool only refreshes on visioner-related flag changes
  - Prevents redundant control panel updates during token/wall updates
- **Canvas Panning Performance**: Optimized operations during canvas panning
  - Skip wall identifier label refresh during active panning
  - Skip hover tooltip badge position updates during panning
  - Skip animation frame scheduling during panning to reduce RAF overhead
  - Cache canvas rect to avoid forced reflows during panning
  - Batch DOM transform updates to minimize layout thrashing

## [4.5.5] - 2025-11-14

### ✨ Features

- **Seek Template Dialog Enhancements**:
  - Added Shift+Click on "Setup Seek Template" button to skip dialog and use defaults burst 15ft.
  - Added "Always Skip Seek Template Dialog" setting to always use default values (15ft burst)
  - Changed label from "Radius" to "Length" when selecting line (ray) template type

### 🐛 Bug Fixes

- **Seek Template Dialog Close Button**: Fixed dialog not reopening after closing with X button
  - Dialog now properly resolves promise when closed via X button or Cancel
  - Ensures template setup can be used again after closing dialog

## [4.5.4] - 2025-11-12

### ✨ Features

- **Customizable Seek Template Dialog**: Added dialog to configure Seek template type and radius
  - Choose from burst (circle), cone (90 degrees), or line (ray) template types
  - Configurable radius in feet (defaults to 15 feet burst)
  - Works for both GM and player template creation

### 🐛 Bug Fixes

- **Seek Results Template Filtering**: Fixed Seek results dialog showing tokens outside template when reopened
  - Improved template lookup to check both `canvas.scene.templates` and `canvas.templates.placeables`
  - Fixed token ID consistency by using `actorToken.id` instead of `actor.id` for template matching
  - Filter out outcomes marked as `changed: false` when template is present
- **Template Type Resolution**: Fixed undefined `fallbackTemplate` variable error in event-binder

- **Window Minimization Support**: Fixed AVS visibility calculations not working when GM window is minimized
  - Replaced `requestAnimationFrame` with synchronous batch processing to bypass browser throttling
  - Added automatic perception refresh when window is restored from minimized state
  - Implemented Levels module compatibility: bypasses 3D collision detection when minimized, uses 2D geometric LOS
  - Window state listener detects minimize/restore and triggers full perception refresh on restore
  - Ensures all visibility state changes apply correctly even when Foundry window is in background
  - Perfect for GMs running multiple applications or streaming while game window is minimized

## [4.5.3] - 2025-11-09

### ✨ Features

- **Customizable Wall Cover Labels Keybind**: Replaced Alt key handling with a configurable keybinding for showing wall cover labels
  - New keybinding: "Show Wall Cover Labels" in Controls settings
  - Hold the configured key while the walls tool is active to display cover status labels (NONE, LESSER, STANDARD, GREATER) on walls
  - Labels automatically hide when the key is released or when switching away from the walls tool
  - Prevents interference with Foundry's native Alt-click functionality for wall selection
  - Only shows labels for walls with explicit cover overrides (AUTO labels are not displayed)

## [4.5.2] - 2025-11-02

### Changed

- **Lifesense Targeting**: Changed targeting from right-click/shift+right-click to T/Shift+T keys
  - Hover over lifesense indicators and press T to target token (releases others)
  - Shift+T adds/removes token from selection

## [4.5.1] - 2025-11-01

### 🐛 Bug Fixes

- Made wall cover labels performance better
- Remove tooltips from the screen when changing scenes

## [4.5.0] - 2025-01-XX

### 🎉 Major Release - Rule Elements System

#### ✨ New Features

## [4.4.13] - 2025-10-25

### 🐛 Bug Fixes

- **Rule Element Performance**: Fixed performance issue where tokens with rule elements triggered full AVS recalculation on movement
  - Rule elements now only trigger AVS recalculation when initially created (`onCreate`) or during encounter events (`onUpdateEncounter`)
  - Token movement with active rule elements no longer causes unnecessary recalculation of all tokens
  - AVS naturally picks up rule element flag changes through its normal event-driven batch processing
- **NPC Sneak Detection**: Fixed sneak speed calculations for NPCs with passive abilities
  - `FeatsHandler` now correctly detects passive actions (type: "action") in addition to feats
  - NPCs with abilities like "Swift Sneak" will now have proper sneak distance calculations displayed
  - Sneak distance chip in chat panels now works correctly for both PCs and NPCs

## [4.4.12] - 2025-10-24

### 🐛 Bug Fixes

- **Chat Action Detection**: Improved action detection logic to prevent false positives
  - Action type detection now relies strictly on PF2e system context flags rather than flavor text
  - Removed flavor text parsing for Sneak, Hide, Create a Diversion, Avoid Notice, and Take Cover actions
  - Prevents incorrect action detection when action names appear in unrelated messages (e.g., "Hide Shield", "Sneak Attack")
  - More reliable action identification through PF2e's `context.options` and `context.slug` fields
- **Wall Height Integration**: Fixed token height calculation to reject invalid Wall Height module flags
  - Wall Height token height flags with value 0 or null are now ignored
  - Falls back to size-based height calculation when Wall Height flag is invalid
  - Prevents tokens from being treated as having zero height when Wall Height module provides incomplete data

## [4.4.11] - 2025-10-23

### 🐛 Bug Fixes

- Fix recursion issue with dice so nice

## [4.4.10] - 2025-10-23

### ✨ Features

- **Camera Vision Aggregation**: Added option to aggregate visibility across multiple party tokens for camera/spectator accounts
  - New setting: "Camera Vision Aggregation" in Vision settings (disabled by default)
  - When enabled, accounts with observer permissions on multiple tokens will display the best (most permissive) visibility state
  - Visibility order: Observed > Concealed > Hidden > Undetected
  - Solves the issue where camera accounts would lose sight of enemies when their primary observer token went behind a wall
  - Enables proper streaming without leaking GM information or requiring invisible dummy actors
  - Perfect for broadcast/spectator setups where camera needs to see what any party member can see

## [4.4.9] - 2025-10-22

### Changes

- **Factors tooltip**: Changed (i) icon to use actual state icons
- **Hover Tooltips**: made ALT respect the Remove Target Hover Tooltips From Players setting
- **Lifesense Indicator**: Added Factors tooltip when lifsense is indicated on the canvas

## [4.4.8] - 2025-10-19

### ✨ Features

- **Visibility Factors Keybind**: Added customizable keybind to display detailed visibility factors for controlled tokens
  - Hold the keybind to show factor badges (info icon) above all other tokens from controlled token's perspective
  - Hover over badges to see comprehensive tooltip explaining visibility state:
    - Current visibility state (Observed, Hidden, Undetected, Concealed)
    - Lighting conditions (Bright Light, Dim Light, Darkness, Magical Darkness with ranks)
    - Detailed reasons including observer/target conditions, sense detection, and lighting interactions
  - No default keybind assigned - configure in Controls settings
  - Works alongside existing Alt/O keybind overlays
  - Badge positions update in real-time as tokens move
  - Includes support for all visibility factors:
    - Observer conditions (blinded, dazzled, deafened)
    - Target conditions (invisible, hidden, concealed, undetected)
    - Lighting factors (bright, dim, darkness, magical darkness ranks 1-5, greater magical darkness)
    - Sense detection (darkvision, low-light vision, greater darkvision, lifesense, tremorsense, scent, hearing, echolocation, and more)
    - Precise and imprecise sense acuity

## [4.4.7] - 2025-10-19

### 🐛 Bug Fixes

- **Wall Priority**: Walls now always block vision regardless of darkness presence - no more "darkvision through walls" edge cases
- **Precomputed Lighting**: Fixed precomputed lighting to also check for darkness between tokens, not just at token locations
- Ensures consistent "undetected" states when walls properly block line of sight
- Prevents false positives where tokens appeared "observed" when they should be "hidden" behind walls
- More accurate darkness detection catches magical darkness areas that single-ray sampling missed

## [4.4.6] - 2025-10-19

### 🐛 Bug Fixes

- **AVS Line of Sight**: Fixed incorrect visibility calculations during token movement/animation
  - **Primary Fix**: Batch processing now defers entirely when tokens are moving, waiting for movement to complete
  - **Secondary Fix**: Precomputed LOS cache is skipped for animating/dragging tokens as a safety net
  - Prevents stale LOS data from causing tokens to see through walls during movement
  - Ensures visibility calculations always use final token positions after movement completes
  - Fixes issue where dragging a token would incorrectly show visibility through walls
  - Implements defense-in-depth approach for maximum accuracy during token movement
- **Hybrid Vision Consensus**: Improved LOS algorithm using consensus between Foundry's vision polygon and full geometric validation
  - **Previous Approach**: Shot rays between all combinations of 9 observer points and 9 target points (81 rays total)
  - **New Approach**: Compare Foundry's vision polygon with complete geometric LOS algorithm, use consensus logic for final result
  - **Consensus Logic**: When both systems agree, trust the result; when they disagree, use geometric as tiebreaker
  - **Geometric Algorithm**: Center-to-target ray sampling requiring 2+ clear rays when center is blocked (same logic for validation and fallback)
  - **Fallback Logic**: If vision polygon unavailable, use the same conservative geometric sampling algorithm
  - More realistic vision model - you look from your eyes (center) toward different parts of the target
  - Handles edge cases where vision polygon and geometric LOS disagree by using more predictable geometric result
  - Significantly more efficient (90% fewer rays) while maintaining accuracy and flexibility through dual validation
  - Best of both worlds: Foundry's precision when it agrees, geometric predictability and flexibility when it doesn't

## [4.4.5] - 2025-10-19

### ⚡ Performance Improvements

- **AVS Feedback Loop Prevention**: Eliminated multiple feedback loops causing excessive visibility recalculations
  - Added flag-based guard in `LightingEventHandler` to prevent rapid re-triggering after batch completion
  - Skip perception refresh when no actual visibility changes occurred (`uniqueUpdateCount === 0`)
  - Suppress `lightingRefresh` events during `canvas.perception.update()` to prevent cascading updates
  - Skip processing module's own ephemeral effects in `ItemEventHandler` (identified by `aggregateOffGuard` flag)
  - Suppress both `refreshToken` hook processing AND `lightingRefresh` events during ephemeral effect sync
  - Uses `requestAnimationFrame` for precise, deterministic flag control instead of arbitrary timeouts
  - All suppression flags are cleared after the next render frame for optimal timing
  - Prevents cascading `refreshToken` → `lightingRefresh` → batch cycles during effect updates
- **Optimized Ephemeral Effect Sync**: Dramatically reduced unnecessary `refreshToken` events
  - Changed from syncing ALL tokens in scene to only syncing specific observer-target pairs that changed
  - Reduced complexity from O(allTokens × changedTokens) to O(updates)
  - Skip hazards and loot tokens entirely - they don't need visibility effects
  - Typical scenes now trigger 2-4 `refreshToken` events instead of 28+ after each batch
  - Ephemeral effect updates no longer trigger cascading `refreshToken` → `lightingRefresh` → batch cycles

## [4.4.4] - 2025-10-18

### 🐛 Bug Fixes

- Add some more AVS debug logs to help track down an issue

## [4.4.3] - 2025-10-18

### 🐛 Bug Fixes

- **AVS**: When a token gets dead or defeated, clear avs overrides and hide indicator
- **Visioner manager**: Filter out dead and defeated tokens

## [4.4.2] - 2025-10-17

### 🐛 Bug Fixes

- **_AVS_**: Fix player side not triggering AVS calculations

## [4.4.1] - 2025-10-15

### Changes

- Disable sneak fancy functions like blocking movement until start sneak and hide sneaking token if avs is turned off

## [4.4.0] - 2025-10-14

### ✨ Features

- **Sneak End Position Extended States**: Added optional setting to allow Hidden/Undetected states for sneak end positions
  - New setting: "Allow Hidden/Undetected for Sneak End Position" (disabled by default)
  - When enabled, sneak end positions qualify with Hidden or Undetected states (in addition to Concealed)
  - Visual indicator: Plus icon (+) appears in column header legend when setting is active
  - Setting located in General > Visioner Dialogs Settings

### Changes

- **Line of Sight Accuracy**: Fixed visibility issue by implementing comprehensive 9-point sampling
  - LOS now samples 9 points on each token: center + 4 corners (with 2px inset) + 4 edge midpoints
  - Creates 81 possible sight lines (9×9) to accurately detect visibility around partial obstacles
  - Previously used only 3 points per token, which could miss valid sight lines around corners

- **Hover Tooltip Performance**: Make sure tooltips appear for newly created tokens
  - Make sure tooltips doesnt render above ui elements

## [4.3.1] - 2025-10-13

### 🐛 Bug Fixes

- Fixed an issue with the mesh and turn marker

## [4.3.0] - 2025-10-12

### ✨ Features

- Added clickable badges to token hover tooltips for quick access to Token Manager
  - Click on observer badge to open Token Manager in observer mode for that token
  - Click on target badge to open Token Manager in target mode for that token
  - Highlights and scrolls to relevant row in Token Manager after opening
- Levels module integration for AVS calculations
  - When Levels module is present, AVS calculations will consider levels
  - Automatically detects Levels module and integrates without additional configuration

### 🐛 Bug Fixes

- Fixed tooltip showing above ui elements
- Fixed tooltip not hiding when panning the canvas
- Fixed tooltips now showing for newly added tokens without requiring a refresh

## [4.2.2] - 2025-10-09

### 🐛 Bug Fixes

- **Echolocation Sense Detection**: Fixed incorrect sense labeling when echolocation is active
  - Echolocation was being stored as "precise hearing" instead of "echolocation", causing incorrect badge icons
  - Detection map now correctly stores `sense: 'echolocation'` with `isPrecise: true`
  - Tooltips now properly show echolocation icon instead of hearing icon when echolocation is detecting targets
  - Sound-blocking walls now correctly prevent echolocation detection
  - Regular hearing remains as an imprecise sense even when echolocation is active

### ✨ Features

- **Cover Display Consolidation**: Moved cover badges from hover tooltips to keybind overlay (G key)
  - Hover tooltips now only show visibility and sense badges for cleaner display
  - Cover information (both manual and auto-cover) consolidated under G-key overlay
  - Manual cover badges show cog icon (⚙️) to distinguish from auto-calculated cover
  - Auto-cover badges show plain cover icon without additional markers
  - Keybind overlays now suppress hover tooltips while active for clearer viewing
  - Hover tooltips automatically restore after releasing keybind while still hovering

- **Global Scene Settings**: Added default settings for scene-specific visual indicators
  - New "Hidden Wall Indicator Width" setting in General UI (default: 10px, range: 1-30px)
    - Automatically updates wall visuals when changed
  - New "Dim Lighting Threshold" setting in General UI (default: 0.25, range: 0.0-1.0)
    - Controls what light level is considered "dim" for visibility and concealment calculations
    - Values below this threshold are treated as dim light (provides concealment in PF2E)
    - Affects how the module interprets lighting levels for automatic visibility states
    - **Automatically triggers AVS recalculation** when changed (global or per-scene) to immediately update visibility states
  - Scene Configuration now uses these global defaults when scene-specific values aren't set
  - Provides consistent defaults across all scenes while allowing per-scene customization

### Changes

- Changed scent and see invisibility sense badges icons to better match their meanings
  - Scent: changed to nose icon
  - See Invisibility: changed from dashed user icon to person with rays icon

## [4.2.1] - 2025-10-08

### 🐛 Bug Fixes

- **Immediate Door Visibility Updates**: Fixed issue where token visibility wasn't updating until a door was opened/closed
  - Wall changes (door open/close, wall create/update/delete) now trigger immediate visibility recalculation instead of using 100ms throttle
  - Resolves delay where players had to interact with a door before visibility states updated correctly

## [4.2.0] - 2025-10-08

### ✨ Features

- **Detection Badges System**: Added sense detection badges to visibility tooltips and dialogs
  - Hover tooltips now display which sense detected each token (vision, darkvision, tremorsense, lifesense, scent, hearing, etc.)
  - Sense badges appear alongside visibility and cover badges for comprehensive at-a-glance information
  - Seek dialog includes new "Detected By" column showing which sense was used to detect each target
  - All sense detection features respect AVS (Auto-Visibility System) setting - only shown when AVS is enabled
  - Supports: vision, light-perception, darkvision, greater-darkvision, low-light-vision, see-invisibility, echolocation, tremorsense, lifesense, scent, and hearing
  - Detection badges show even for "observed" targets to provide complete sensory information

## [4.1.1] - 2025-10-08

### ✨ Features

- Support for petal step feat (tremorsense logic)
- Recalculate AVS states when addin\removnig supported feats

## [4.1.0] - 2025-10-08

### 🐛 Bug Fixes

- movmentType fly now shows as undetected again for tokens senseing with Tremorsense

### ✨ Features

- **Wall Height Integration**: Added automatic support for the Wall Height module
  - Cover detection now respects wall elevation ranges, allowing tokens above walls to see over them
  - Visibility and line of sight calculations factor in wall heights when determining obstruction
  - Elevation-aware filtering prevents low walls from blocking sight between elevated tokens
  - No configuration required - automatically activates when Wall Height module is present

- All the module now uses locale keys (good luck translators!)

## [4.0.4] - 2025-10-07

### 🐛 Bug Fixes

- Handle a case where gridless scene darkness sources were not properly accounted for their points of shape

## [4.0.3] - 2025-10-07

### 🐛 Bug Fixes

- Remove console logs

## [4.0.2] - 2025-10-07

### 🐛 Bug Fixes

- Implemented movement blocking for players awaiting Sneak confirmation, preventing unintended actions during sneak attempts
- End-of-turn validation button now correctly appears when required, ensuring GMs can address deferred sneak checks
- Seek dialog now properly filters out hazards and loot from the defeated token filter, ensuring they always appear in results
- All dialogs now show or hide action buttons (Apply/Revert) based on the following criteria:
  - If the old visibility state is AVS-calculated and the new state is not AVS-calculated - show actions
  - If the old visibility state is AVS-calculated and the new state is AVS - hide actions
  - If the old visibility state is not AVS-calculated and AVS is selected or a state other than the old one - show actions
  - If the old visibility state is not AVS-calculated and the new state is the same state - hide actions
- All dialogs now check only the specific token that initiated the action when determining if the old state is AVS-controlled

## [4.0.1] - 2025-10-07

### 🐛 Hotfix

- Fixed issue with token visibility not updating correctly
- Improved error handling in UI hooks

## [4.0.0] - 2025-10-03

### 🎉 Major Release - Architecture Refactor & Enhanced Automation

This is a **major release** featuring comprehensive refactoring, new automation features, and critical bug fixes.

### ✨ New Features

#### Enhanced Sneak Mechanics

- **Improved State Management**: Sneak actions now properly track and manage visibility states throughout the action lifecycle
- **Visual Indicators**: Enhanced feedback for sneaking tokens with improved UI
- **End-of-Turn Position Validation**: New dialog system for validating position requirements at turn end with defer functionality
- **AVS Control Integration**: Sneak and Hide actions now properly integrate with Auto Visibility System (AVS) control logic
- **Sneak-Aware Filtering**: Override validation indicator now filters appropriately based on sneak states

#### Region Behavior Enhancements

- **Visibility Region Behavior**: Added new visibility types to region behavior system
- **Concealment Region Behavior**: New concealment region type with proper activation/deactivation
- **Improved Logic**: Optimized concealment region behavior with better detection and state management

#### Feat Support

- **Camouflage Feat**: Implemented Camouflage feat support to bypass cover/concealment requirements in natural terrain
  - Properly evaluates terrain stalker selections
  - Integrates with cover and concealment detection
- **Terrain Stalker**: Enhanced Terrain Stalker logic to correctly relax end position requirements

#### Chat Automation Improvements

- **Enhanced Dialogs**: Improved filtering logic in chat dialogs (Seek, Hide, Sneak, Consequences, Point Out) for better clarity and consistency
- **Consequences Dialog**: Refactored preview dialog and action handler with improved error handling and override management
- **Override-Only Consequences**: Consequences button now only shows for overrides, reducing clutter

#### Visibility Detection

- **Lifesense Detection**: Enhanced lifesense detection by adding trait checks
  - Detects "mindless" trait for undead/constructs
  - Updated related visuals and tests
- **Acuity Preservation**: VisionAnalyzer now preserves sense acuity information for better detection accuracy

### 🔄 Refactoring & Architecture

#### Visibility System Refactor

- **New Calculation Workflow**: Implemented completely new visibility calculation workflow with comprehensive separation of concerns
- **StatelessVisibilityCalculator**: Main calculation logic extracted to ~200 lines (from 900+ lines)
  - Extracted 22+ focused methods with single responsibilities
  - Improved readability and maintainability
  - Modular, debuggable architecture
- **Movement Action Integration**: Refactored visibility calculation logic to incorporate movement actions and sound blocking
- **AVS Control Mechanism**: Added Auto Visibility System control flags to manage visibility state automation

#### Code Quality Improvements

- **Event Listener Management**: Simplified event listener management and cleanup in hover tooltips
- **Error Handling**: Enhanced error handling when removing token event listeners
- **Flag Management**: Comprehensive improvements to flag management and cleanup processes
- **Test Structure**: Enhanced test structure with better mocks and clearer organization

### 🐛 Fixed

#### Critical Visibility Bugs

- **Greater Darkvision Feat Detection**: Fixed critical bug where player characters with the Greater Darkvision feat could not see through rank 4 magical darkness
  - **Root Cause**: VisionAnalyzer was only checking `actor.system.perception.senses`, which the PF2e system doesn't always populate when vision comes from feats (vs. ancestry traits)
  - **Solution**: Added fallback mechanism to explicitly check actor feats when vision capabilities aren't found in senses
  - **PF2e Rules Compliance**: Now correctly implements:
    - Greater Darkvision + rank 4+ darkness = **observed** ✓
    - Darkvision + rank 4+ darkness = **concealed** ✓
    - No darkvision + rank 4+ darkness = **hidden** ✓
  - **Backward Compatible**: Senses always take priority over feats; only applies feat detection as fallback

- **Darkvision Feat Detection**: Also fixed detection of regular Darkvision feat using the same fallback mechanism

#### Wall & Vision Fixes

- **Wall Change Cache Clearing**: Wall property changes now trigger proper cache clearing for VisionAnalyzer
  - Wall direction changes (left → both) immediately recalculate visibility
  - Sight/sound blocking changes immediately update detection states
  - Observer conditions (deafened, blinded) properly re-evaluated after wall changes

- **Line of Sight in Darkness**: Adjusted line of sight checks to properly account for magical darkness in visibility calculations
  - Now correctly handles cross-boundary darkness scenarios
  - Improved detection of darkness along vision rays

- **Sight Blocking Logic**: Refined vision analyzer tests to use `canvas.walls.checkCollision` for accurate sight blocking
  - More consistent with Foundry's native vision system
  - Better integration with Wall Height module

#### Cover Detection Fixes

- **Wall Blocking Logic**: Updated wall blocking logic in CoverDetector for improved readability and accuracy
  - Wall direction tests adjusted to reflect changes in cover override logic
  - Better handling of partial walls and directional blocking

#### Action & Dialog Fixes

- **Visibility State Trust**: Updated visibility handling to trust AVS/getVisibilityBetween results
  - Removed redundant 'concealed' checks from conditions
  - Improved error logging in visibility helpers

- **Override Indicator**: Enhanced override indicator handling with proper cleanup
  - Fixed cleanup method calls after token deletion
  - Proper event listener removal

- **Tooltip Management**: Cleaned up tooltip visibility handling during canvas panning and hovering
  - Tooltips now properly hide during panning
  - Better state management for hover interactions

#### Feat Logic Fixes

- **Feat Qualification**: Removed unnecessary start qualification checks for Camouflage and other feats
  - Simplified feat handling logic
  - Clearer requirements for cover/concealment bypass

### 🗑️ Removed

- **Client Viewport Filtering**: Removed client viewport filtering feature as it was causing performance issues
  - Updated related references in code and tests
  - Simplified rendering pipeline

- **Deprecated Tests**: Removed outdated test suites
  - Echolocation and legacy lifesense tests (replaced with new implementation)
  - Override removal tests for action dialogs (functionality moved)

### 🔧 Technical

#### Test Coverage

- **Comprehensive New Tests**: Added extensive test suite for new features
  - Greater Darkvision feat detection tests (unit, integration, debug)
  - Wall change cache clearing tests
  - Sneak mechanics and filtering tests
  - Region behavior tests
  - AVS control mechanism tests
  - Lifesense trait detection tests

- **Test Refactoring**: Refactored existing tests for clarity and consistency
  - Greater Darkvision feat tests restructured
  - Import verification tests updated
  - Direction-aware override tests enhanced

#### Performance

- **Batch Processing Optimizations**: Enhanced visibility handling with movement detection and batch processing
  - Reduced redundant calculations
  - Better caching strategies
  - Improved AVS override cleanup

#### Documentation

- **Comprehensive Guidelines**: Added extensive PF2E Visioner development guidelines
  - Architecture documentation updated
  - Copilot instructions enhanced
  - Debug guides for Wall Height integration

#### Debug & Logging

- **Enhanced Debug Messages**: Added debug logging for feat-based vision detection
- **Import Verification**: Better import count verification in tests
- **Error Messages**: Improved error messages throughout the codebase

### ⚠️ Breaking Changes

While we've maintained backward compatibility where possible, this major version includes:

- **Refactored Visibility Calculation API**: Internal visibility calculation methods have new signatures
  - Public API remains unchanged
  - Internal integrations may need updates
- **AVS Control Flags**: New control mechanism may affect custom integrations with visibility system
- **Region Behavior Types**: New region behavior types may require scene updates for advanced users

### 📊 Statistics

- **Test Suites**: 134+ test suites, 1556+ tests passing
- **Code Reduction**: Main visibility calculator reduced by 78% (900 → 200 lines)
- **New Methods**: 22+ new focused methods in visibility calculation
- **Files Modified**: 50+ files updated across the codebase

---

## [3.1.5] - 2025-09-06

### 🐛 Fixed

- **Token Manager**: Target mode will show perception dc correctly again
  - Changed to partials usage instead of monoith template

## [3.1.4] - 2025-09-06

### 🐛 Fixed

- **Manual Cover**: Fixed Stealth and Saving Throw rolls handling of manual cover

## [3.1.3] - 2025-09-06

### 🐛 Fixed

- **Manual Cover**: Had an issue that only the first token gets the bonus, this is now fixed
  - Auto cover will trigger automatically if manual cover is set to 'none' if you really need no cover, use override methods

## [3.1.2] - 2025-09-05

### ✨ New Features

- **Manual Cover Indicators For Attack rolls**: Added visual indicators in chat messages of attack rolls to show when manual cover is applied, blocked override when manual cover is detected

- **Wall manager**:
  - Added progress bar and enhanced performance of updates
  - Added keybind to open wall manager

### 🐛 Fixed

- **Enforce RAW with Manual Cover**: Fixed manual cover doesnt qualify for enforce raw

- Fixed ephemeral effects duplication bug where rules were being added repeatedly on page refresh
- Improved rule deduplication in cover aggregates to prevent multiple identical rules
- Enhanced canonicalization process to prioritize higher cover bonuses when rules conflict
- Added defensive GM-only checks to prevent effect creation/deletion race conditions
- Improved error handling and logging for ephemeral effect management

## [3.1.1] - 2025-09-05

### 🐛 Fixed

- **Manual Cover Fixes**: Fixed issues with manual cover detection and application when it needs to take precedence over auto cover situations

- **Behavior Activation/Deactivation**: Fixed region behavior state management
  - **Activation**: Region behaviors now properly run activate when behavior is activated
  - **Deactivation**: Region behaviors now properly run when behavior is deactivated

## [3.1.0] - 2025-01-20

### ✨ New Features

#### Region Behavior System

- **PF2e Visioner Region Behavior**: Added custom region behavior for automatic visibility management
  - **Visibility State Control**: Set visibility state (observed, concealed, hidden, undetected) for tokens
  - **Inside Token Control**: Optional checkbox to apply visibility state between tokens inside the region
  - **Two-Way Region**: Optional checkbox to make tokens outside the region have the same visibility state to tokens inside
  - **Clean Exit**: Visibility relationships are reset to 'observed' when tokens exit regions
  - **Integration**: Fully integrated with existing PF2e Visioner visibility system and effects

- **Token config**: Add configs to protoype tokens config

### 🐛 Fixed

- **Point out dialog**: Weird rectangle is now gone
- **All Dialogs**: Names will be wrapped on word breaks

## [3.0.6] - 2025-09-02

### ✨ Enhanced

- **Wall Manager**: Added select and go to wall
- **Auto cover from walls**: Another grooming to the algorithm

## [3.0.5] - 2025-09-02

### 🐛 Fixed

#### Cover Detection

- **Door State Awareness**: Fixed cover calculation to properly respect door states
  - **Open doors/secret doors** no longer provide cover (consistent with Foundry's vision system)
  - **Closed/locked doors/secret doors** continue to provide cover as normal walls
- **Cover Override Precedence**: Cover overrides now take precedence over door states
- **Action Dialogs**: Use portraits instead of token images

### 🔧 Technical

## [3.0.4] - 2025-09-02

### ✨ Enhanced

#### Dialogs

- **Click on token image to go to current row token**: will select and pan to the token
- Name column word wrap

## [3.0.3] - 2025-09-02

### ✨ Enhanced

#### Wall Manager Interface Overhaul

- **Scrollable Table**: Added scrollable table container
- **Search & Filter System**: Comprehensive search and filter functionality:
  - **Text Search**: Search by identifier or wall ID with debounced input
  - **Type Filter**: Filter by Walls, Doors, or Secret Doors
  - **Hidden Filter**: Show only hidden walls, non-hidden walls, or all
  - **Cover Filter**: Filter by cover override type (Auto, None, Standard, Greater)
  - **Live Counter**: Shows total wall count and currently visible count
  - **Clear Filters**: One-click button to reset all filters
- **Clickable Wall Type Images**: Replaced dropdown with clickable wall type images:
  - **Left-click**: Cycles forward through Wall → Door → Secret Door
  - **Right-click**: Cycles backward through Wall → Secret Door → Door
  - **Visual Feedback**: Hover effects with orange border and scaling animations
- **Bulk Cover Actions**: Added bulk cover override buttons in header:
  - **Cover: Auto**: Sets all walls to automatic cover detection
  - **Cover: None**: Sets all walls to never provide cover
  - **Cover: Standard**: Sets all walls to maximum standard cover
  - **Cover: Greater**: Sets all walls to maximum greater cover

### 🔧 Technical Improvements

- **Performance**: Debounced search input for better performance with large datasets
- **Cover Priority Logic**: Simplified cover detection to prioritize walls when any wall provides cover, otherwise prioritize token blockers

## [3.0.2] - 2025-09-02

### 🔧 Fixed

#### Cover System Architecture Improvements

- **Wall Side Detection**: The algorithm was backwards, this is fixed

## [3.0.1] - 2025-09-01

### 🐛 Fixed

#### Wall Coverage Calculation Improvements

- **Directional Wall Logic**: Fixed critical bug where RIGHT directional walls weren't providing cover when attacked from the correct side
- **Coverage Percentage Accuracy**: Improved wall coverage percentage calculation by removing arbitrary center weight reduction that could underestimate cover
- **Foundry VTT Constants**: Updated directional wall logic to properly use Foundry's wall direction constants (BOTH: 0, LEFT: 1, RIGHT: 2)
- **Sampling Density**: Increased sampling points around target perimeter from 3 to 4 per edge for more accurate coverage detection
- **Corner Sampling**: Added explicit corner point sampling for better PF2e rule compliance
- **Cross-Product Calculation**: Enhanced mathematical precision in directional wall blocking logic

#### Point Out Action System Enhancements

- **ApplicationV2 Warning Dialogs**: Converted Point Out target selection warnings to modern Foundry ApplicationV2 framework
- **Player/GM Warning System**: Added comprehensive warning dialogs for when attempting Point Out without target selection

## [3.0.0] - 2025-09-01

### 🎉 Major Release - Advanced Visibility and Cover Toolkit

This major release represents a complete architectural overhaul, transforming PF2E Visioner from a perception toolkit into a comprehensive visibility and cover management system. The module has been rebuilt from the ground up with a modular auto-cover system, enhanced UI components, and extensive new features for tactical gameplay.

### ✨ New Features

#### 🛡️ Auto-Cover System (Complete Architectural Rewrite)

- **Modular Architecture**: Brand new auto-cover system with specialized components:
- **Enhanced Detection Modes**: Multiple intersection algorithms for precise cover calculation:
  - **Any Mode**: Ray intersects any part of blocker token
  - **10% Mode**: Grid-square-based intersection 10% threshold (default mode)
  - **Coverage Mode**: Percentage-based side coverage
  - **Tactical Mode**: Corner-to-corner line-of-sight using "best attacker corner" rule
- **Template Integration**: Full support for area effects and templates with proper cover bonuses
- **Elevation Integration**: Automatic height and elevation consideration across all modes
- **Directional Wall Support**: Walls with direction properties properly block cover only from intended sides using cross-product calculations
- **Wall Cover Status Display**: Alt+hover displays cover status labels

#### 🎯 Enhanced UI Components

- **Cover Override Management**: Comprehensive override system with ceiling behavior
- **Enhanced Dialogs**: Hide and Sneak dialogs now show cover information by default
- **Token Quick Panel**: Streamlined interface for rapid visibility state changes
- **Wall Management**: Enhanced wall tools with type indicators and quick toggles

### 🚀 Enhanced Features

#### Chat Automation Enhancements

- **Cover Integration**: Actions now consider cover prerequisites and bonuses

### 🐛 Fixed

- **Directional Wall Coverage**: Fixed issue where directional walls weren't properly respected due to Foundry's built-in collision detection bypassing custom logic
- **Tooltip System**: All tooltips now use proper data-tooltip properties instead of deprecated title attributes
- **Action Button Behavior**: Fixed "Apply All" and individual action buttons across all dialog types
- **State Persistence**: Improved flag management and state synchronization
- **Memory Management**: Enhanced cleanup of visual effects and temporary states
- **Token Filtering**: Fixed encounter filtering and ally detection across all actions
- **Cover Calculation**: Resolved edge cases in cover detection algorithms
- **UI Responsiveness**: Fixed dialog sizing and scrolling behavior
- **Socket Communication**: Improved reliability of multiplayer operations
- **Memory Optimization**: Reduced heap usage through efficient data structures

### 📋 Migration Notes

Users upgrading from 2.x should be aware that:

- Settings may need to be reconfigured due to reorganization
- Custom macros using the old API may need updates
- Some visual effects behavior may differ due to the new system
- Performance should be significantly improved, especially for large scenes

This release represents the most significant update to PF2E Visioner since its inception, providing a solid foundation for future enhancements while dramatically improving performance, reliability, and user experience.

## [2.7.1] - 2025-08-28

### Added

- Ability to hide quick edit button @camrun91

### Fixed

- Attack consequences displaying on non attack @camrun91
- Hide results showing on various checks @camrun91
- Sneak results could show on other checks @camrun91

## [2.7.0] - 2025-08-23

### Added

- Auto-cover: 3d sampling mode (experimental) will take creature elevation and size into consideration for both auto cover and visualization
- Visioner tools: add option to hide them

### Fixed

- Seek showing for messages with 'seek' text in them
- Colorblind support for tooltips
- Take cover showing for current conditions message
- Allow players to change client settings

## [2.6.9] - 2025-08-23

### Fixed

- Tests

## [2.6.8] - 2025-08-23

### Improved

- **Cover Visualization Performance**: Limit computation to the current viewport (with small padding) instead of scanning large scene areas. Significantly reduces work when zoomed/panned.

### Fixed

- **Viewport Conversion Reliability**: Use `canvas.stage.worldTransform.applyInverse` for screen→world mapping in `getViewportWorldRect()` to ensure correct results across PIXI versions. Removed earlier manual inverse math.
- Removed the overly restrictive GM-only wall-blocking prefilter from visualization iteration; viewport limiting now applies to all users while existing fog-of-war/visibility checks remain.

- Auto cover: no roll dialog will use off guard when applicable too

## [2.6.7] - 2025-08-21

### Fixed

- Color blind modes

### Added

- Quick edit - added party and enemies selectors
- Auto cover - show to gms if cover was overridden by any method

## [2.6.6] - 2025-08-21

### Fixed

- Ignore allies in visibility manager
- Auto cover for non roll dialog
- Per row rever will not revert all now

### Added

- MANY tests

## [2.6.5] - 2025-08-20

### Added

- **Cover Visualization**: Implemented fog of war awareness for cover grid
  - Players only see cover squares in areas they can currently see (respects fog of war)
  - Hidden/fogged areas show no cover visualization squares at all
  - Integrates with Foundry VTT's vision system to check grid position visibility
  - Prevents tactical information leakage in unexplored or currently invisible areas

- **Cover Visualization**: Enhanced token filtering to exclude non-blocking entities
  - Loot tokens no longer create gray "holes" in cover visualization
  - Hazard tokens no longer interfere with cover grid display
  - Only actual creatures and NPCs count for position occupation checks

- **Cover Visualization**: Implemented wall-based line-of-sight blocking for cover grid
  - Players see black squares instead of cover information for positions blocked by walls
  - Aggressive LOS blocking algorithm ensures clean visual separation at wall boundaries
  - Added comprehensive test coverage for wall blocking functionality

### Improved

- **Cover Visualization**: Enhanced drawing logic to completely hide squares in fogged areas
- **Cover Visualization**: More accurate token occupation detection for cover calculations

## [2.6.4] - 2025-08-19

### Fixed

- **Attack Consequences Dialog**: Fixed "Apply All" button showing "No visibility changes to apply" when there are actionable changes
  - Added test coverage to prevent similar bugs in the future

- **Seek Dialog**: Fixed "Error reverting change" when using per-row revert after apply-all
  - Revert operations now work correctly in the "Apply All → Per-Row Revert" sequence
  - Added test coverage to prevent similar bugs in the future

## [2.6.3] - 2025-08-19

### Fixed

- Tests

## [2.6.2] - 2025-08-19

### Fixed

- **Critical Bug Fixes - All Major Action System Issues Resolved**:
  - **Sneak Action**: "Apply Changes" button now correctly applies Undetected instead of Hidden on critical success
  - **Consequences Action**: "Apply All" now works correctly with Ignore Allies setting
  - **Create a Diversion Action**: "Apply All" now properly applies effects and respects Ignore Allies setting
  - **Seek Action**: "Apply Changes" now properly respects the Ignore Allies setting
  - **Individual Revert Buttons**: Now only revert the specific creature's outcome instead of all outcomes
  - **Ignore Allies Filter Logic**: Fixed inconsistencies across all actions when toggling Ignore Allies in dialogs
  - **Parameter Passing**: Fixed inconsistent parameter passing between dialogs and action handlers
  - **State Management**: Fixed dialog state tracking for bulk actions

- **Auto cover visualization**: undetected or foundry hidden will show as no cover

- **Enhanced Purge Functionality**:
  - Purge tool now intelligently detects selected tokens
  - Any tokens selected: Offers to clear all selected tokens' Visioner data with comprehensive cleanup (same as scene purge)
  - No tokens selected: Offers to clear entire scene data
  - More targeted cleanup options for better workflow efficiency

- **Comprehensive Testing Coverage Added**:
  - Added 586 comprehensive tests across 26 test suites
  - Real HTML5 canvas integration testing with actual drawing operations
  - Complete bug regression prevention testing
  - All action types thoroughly tested (Sneak, Hide, Seek, Point Out, Take Cover, Create a Diversion, Consequences)
  - All UI interactions tested (Apply Changes, Apply All, Revert All, Individual buttons)
  - Performance testing for large token sets and wall operations
  - Error handling and edge case coverage

### Changed

- Enhanced test infrastructure with Jest testing framework
- Added real canvas testing capabilities with `canvas` npm package
- Improved mock system for Foundry VTT globals in testing environment

## [2.6.1] - 2025-08-19

### Fixed

- AZERTY keyboard support (maybe??)
- Dont show attack consequences on damage taken messages
- Cover Visualization:
  - Allow hover and then hold keybind and not just keybind and then hover, also change default to Y

## [2.6.0] - 2025-08-19

### Added

- Toolbars reorganization:
  - Moved Visioner controls into native Foundry tool groups:
    - Tokens: Quick Edit, Provide Auto‑Cover toggle, Purge Scene Data
    - Walls: Wall Manager, Provide Auto‑Cover toggle, Hidden Wall toggle
  - Removed the standalone Visioner tool
- Wall Manager QoL:
  - Row highlight sync when selecting walls on the canvas
  - New Type column with icons/images for Wall, Door, Secret Door
- Consistent wall imagery via shared `getWallImage(doorType)` used across Visibility Manager and Wall Manager (Secret Door now distinct)

- **Cover Visualization System**: Interactive tactical positioning aid for cover analysis
  - Hold configurable keybind (default: Shift) while hovering over targets to activate
  - Shows colored grid overlay indicating cover levels at each position against hovered token
  - Color coding: Green (No Cover), Yellow (Lesser +1 AC), Orange (Standard +2 AC), Red (Greater +4 AC)
  - White square highlights selected token's current position
  - Dynamic range calculation automatically expands to cover all tokens on scene
  - Works for all auto-cover intersection modes (Any, 10%, Coverage, Tactical)
  - Client-specific rendering - each player sees only their own visualization
  - Player-configurable keybindings via FoundryVTT's native Controls settings
  - Optional encounter-only restriction setting
  - Smart occupation filtering - excludes squares occupied by other tokens (except tiny creatures sharing space)

- **Enhanced Auto-Cover Modes**: Refined intersection algorithms and added tactical for better tactical accuracy (NOT as pf2e rules)
  - **Tactical Mode**: Corner-to-corner line-of-sight calculations using "best attacker corner" rule
  - **Coverage Mode**: Side coverage algorithm with fixed 50% (Standard) and 70% (Greater) thresholds
  - **Any Mode**: Attack ray passes through blocker with any %
  - **10% Mode**: Grid-square-based intersection threshold - default mode

### Changed

- Token and Wall toggles semantics unified to “Provide Auto‑Cover” (ON = provides cover):
  - Tokens: invert `ignoreAutoCover` flag handling; active shows shield icon
  - Walls: `provideCover` true when active; shield icon when ON
- Increased Type icon size in Wall Manager for readability
- Hide auto cover dc reduction now also applies for manual cover (if the setting is on)
- Damage consequences changed to Attack consequences
- Aligned outcome for concealed and some action states

### Fixed

- Removed deprecated PerceptionManager.refresh calls; visuals update without deprecation warnings
- Encounter filter: ensured token‑ID matching to prevent non encounter copies of the same token filtered correctly
- **Tiny Creature Handling**: Improved calculations for tiny creatures auto cover
- Seek templates on rerolls now behave better

## [2.5.3] - 2025-08-17

### Fixed

- Tooltips: some more optimizations
- API: make sure auto cover skips blockers that have the same id as the controlled token

## [2.5.2] - 2025-08-17

### Added

- Take cover: support converting system effect to visioner one(for people that use the macro and dont just post the action in chat)
  - will bypass visioner take cover automation and will set to the effect selected by the system effect (basicaly will not increment the cover based on the current cover state)

### Fixed

- Tooltips: fixed all hover tooltips state and keyboard tooltips states (should be much more stable)
- Familiars will not be filtered when the encounter filter is turned on

## [2.5.1] - 2025-08-17

### Fixed

- Seek Action: when changing system condition to visioner, change it also to any player that doesnt have it's own visioner flag with the target

## [2.5.0] - 2025-08-17

### Added

- Quick panel:
  - Compacted the design a bit
  - Added minimize button to keep it handy when you need it
  - Added a keybind to open and close quick panel (default Ctrl-Shift-Q)
- Hidden walls:
  - Per scene wall indicator width slider
- Seek Action:
  - Support system conditions -> if a token has been set with a system condition (hidden\undetected) and the seek dialog is opened
    visioner will replace the system condition with it's own flags and reflect that in the results
- API:
  - Add getAutoCoverState function between a token and a target
- Enforce RAW:
  - Will now utilize auto cover(if turned on) to pass the prequisite for hide
- Hide:
  - New setting to add auto cover to the dialog (it will reduce dc instead of adding modifiers to the roll , default off)

### Fixed

- Seek Action: Hidden walls now properly appear in Seek template results
  - Template filtering now works correctly for both tokens and walls

### Changed

- Quick panel:
  - removed refresh button, now refreshes automatically when adding\removing selected tokens and adding\removing targeted tokens

## [2.4.0] - 2025-08-16

### Added

- Hidden walls support:
  - Turn on in the settings
  - Wall config -> under visioner settings turn on hidden wall checkbox
    - This will make the wall appear in the visibility manager and seek dialog
  - Set DC if you want
  - Walls auto start as hidden for tokens
  - Seek to discover wall
  - Hidden walls will light up purple and hidden doors and secret doors will light up yellow
  - EXPERIMENTAL: See through hidden walls you can observe!
- Quick panel in visioner tool -> accepts selected tokens and targets an able to set visioner relationship changes quickly between them
- Hidden wall toggle in visioner tool

### Fixed

- Added abunch of apply changes buttons that were missing in actions
- Diversion outcome column populated again

### Changed

- Removed button title, was not needed honestly

## [2.3.1] - 2025-08-16

### Changed

- Settings menu: saving now preserves values from unvisited tabs. Only submitted or previously edited fields are persisted; untouched settings are no longer reset.
- Added opt in for enable all tokens vision

### Fixed

- Dialogs: fixed apply changes missing for sneak.

## [2.3.0] - 2025-08-15

### Added

- Proficiency rank requirement for Seeking hazards and loot (token config). Seek will show "No proficiency" when the seeker's rank is too low and keep DC/override controls.
- Keybind to show current calculated Auto‑Cover from all tokens (default G). Press to display cover‑only badges; release to clear.
- Mystler Sneak RAW setting (default off) to enforce RAW outcome for Sneak.
- New settings structure with category tabs and an emphasized Auto‑Cover section.
- Add keybind to open token manager in the opposite mode (@Eligarf)
- polish translation (@Lioheart)

### Changed

- Ignore Allies is now per‑dialog (Seek/Hide/Sneak); the global setting only defines the default checkbox state.

### Fixed

- Hide dialog: restored missing "Apply Changes" button.
- Token Manager: fixed scrolling to the bottom when selecting a token; selected row stays in view.
- Now scrolls to bottom after injecting buttons in chat

## [2.2.0] - 2025-08-15

### Added

- Auto cover:
  - New `Token Intersection Mode: Coverage` that maps ray coverage across a blocking token to cover tiers using configurable thresholds.
    - Standard at ≥ `Auto-Cover: Standard Cover at ≥ %` (default 50)
    - Greater at ≥ `Auto-Cover: Greater Cover at ≥ %` (default 80)
  - Visioner tool: Consolidated GM controls to Ignore/Restore Auto-Cover on selected walls and tokens (highlighted when active).
    - Clear Cover (Target/Observer mode)
    - Make Observed (Target/Observer mode)
  - Hazard/Loot: Minimum Perception Proficiency (token config) required to detect (Untrained–Legendary). Enforced in live detection and Seek.
  - Seek results now always include hazards/loot (subject to template/distance filters). Below-rank entries show outcome "No proficiency", display the correct DC, and still provide override buttons.
  - Auto-cover dependents are hidden unless Auto-cover is enabled.
  - Coverage thresholds only shown when mode = Coverage.
  - Seek: hides both limit checkboxes and distance fields when “Use Template” is enabled; distance fields only shown when their respective limit toggles are on.
  - Tooltips: hides “Block Player Target Tooltips” unless “Allow Player Tooltips” is enabled; hides “Tooltip Font Size” unless “Enable Hover Tooltips” is enabled.

### Changed

- Auto-cover internals refactored into strategy helpers for readability and maintainability.
- Check roll integration now uses a libWrapper WRAPPER when available to avoid conflicts with PF2E Ranged Combat.
- Token and Wall toolbar in visioner tool toggles now reflect the currently selected documents and stay in sync on selection changes.

## [2.1.3] - 2025-08-13

### Fixed

- Auto cover:
  - respect metagaming ac reveals
  - Walls sidebar tool: added GM toggle to Ignore/Restore Auto-Cover for selected walls
  - new settings: coverage thresholds to map ray coverage across a blocking token to lesser/standard/greater

## [2.1.2] - 2025-08-12

### Fixed

- Auto cover:
  - allow players to set keybinds

## [2.1.1] - 2025-08-12

### Fixed

- Auto cover:
  - players could not see override controls
  - dialog height was weird

## [2.1.0] - 2025-08-12

### Added

- Auto cover:
  - now lets you override the cover applied to a roll in the roll dialog
  - now lets you set keybind that if held will let you override cover for the roll (for people that dont use roll dialog, you maniacs)

## [2.0.1] - 2025-08-12

### Fixed

- Auto cover:
  - now works with and without roll dialog
  - now gets reevaluated on token movement
  - walls intersection algorithm tuned to better check
  - removed any and cross modes

## [2.0.0] - 2025-08-12

### Breaking - Full Internal Rewrite and Module Restructure

- Project reorganized and rewritten for clarity and performance.

### Added

- Auto Cover (reworked):
  - Applies cover only if the line from attacker to target passes through a blocking token’s space.
  - Lesser vs Standard cover determined by relative size (blocking token ≥ 2 size categories larger => Standard).
  - Applies pre-roll via modifiers dialog or strike click capture; clears cover immediately after the roll’s message renders.
  - Multi-side evaluation: checks all token sides for walls; tokens use center-to-center line for accurate blocking.
  - Intersection mode for token blockers: new setting “Auto-Cover: Token Intersection Mode” with choices:
    - Any (default): center line intersecting any token edge counts.
    - Cross: center line must cross both opposite edges (top+bottom or left+right).
  - Ignore undetected blockers: new setting “Auto-Cover: Ignore Undetected Tokens” (skip blockers undetected to the attacker per Visioner map).
  - Respect token flag: new setting “Auto-Cover: Respect Token Ignore Flag”; if enabled, tokens with `flags.pf2e-visioner.ignoreAutoCover = true` will be ignored.
  - New token setting in vision tab: ignore as auto cover blocker.
  - Wall-level toggle: per-wall flag `flags.pf2e-visioner.provideCover` (when false) makes that wall not contribute to cover. Default set to true.
  - New wall setting: ignore as auto cover.
  - Prone blockers toggle: new setting “Auto-Cover: Prone Tokens Can Block” (default on). If disabled, tokens with a Prone condition won’t provide cover.
  - Ally/dead filters: existing settings integrated into auto-cover token filtering (ignore allies, ignore 0-HP tokens).
  - Gated by setting and enabled GM-only to avoid duplicates.
  - Auto-Cover live recompute: cover now recalculates when attacker or target moves/resizes during an active roll flow.
  - Auto-Cover blocker options:
    - Any (default)
    - Cross (ray must cross both opposite edges)
    - Ray through token center
    - Ray inside ≥10% of blocking token square
    - Ray inside ≥20% of blocking token square
  - Wall-level toggle: per-wall flag `flags.pf2e-visioner.provideCover` to exclude walls from cover.
  - Token UI: Ignore as Auto-Cover Blocker flag in Token Config Vision tab.
- Take cover action support
- Grouped Settings menu (ApplicationV2), scrollable, localized labels, and reliable select persistence.

- Seek Template and Range Improvements (stabilized from 1.x):
  - Strict filtering by player template (no generic fallback template).

- Chat Automation Quality of Life:
  - Point Out excludes loot, pings target on Apply.
  - Sneak lists only enemies (no allies).
  - Hide prerequisites enforced (concealed or standard/greater cover) and “No changes to apply” notification when relevant.
  - Players don’t see Apply buttons in panels.

- API:
  - Bulk visibility setter to apply many observer→target updates efficiently.

### Changed

- No more world reloads for several settings; they are now applied at runtime:
  - Ignore Allies, Seek template toggle, Seek range toggles, player tooltip toggles, auto cover.
- Hook registration centralized under `scripts/hooks/` with small registrars; heavy logic moved to feature folders.
- Imports largely hoisted to top-of-file for maintainability; kept dynamic imports only where lazy-loading is beneficial (dialogs, heavy batches).

### Fixed

- Hide action now respects the Ignore Allies setting (allied observers are filtered out).
- Auto Cover reliably applies to the current roll and then cleans up; prevents lingering effects.
- Template-based Seek respects only targets inside the player’s template and opens faster via sockets.
- Token Manager batch operations reconciled effects reliably and reduced redundant document operations.
- Sneak integration showing up on sneak attack damage rolls.

### Removed

- Legacy/unused files and integration paths related to the old effects coordinator code.

## [1.9.0] - 2025-08-11

### Added

- Stealth for loot tokens: Added possibility to hide loot from specific tokens and finding them with seek!
- Stealth DC override for loot tokens in Token Config:
  - Injected a Stealth DC number field into the Vision tab for loot actors.
  - Added a dedicated “PF2E Visioner” tab fallback for loot tokens when available.

### Changed

- Seek and Token Manager now respect the token-level Stealth DC override for loot tokens, falling back to the world default when unset.
- Removed Cover and visibility integration, rules will now explicitly follor enforce RAW setting

## [1.8.0] - 2025-08-11

### Added

- API: `api.clearAllSceneData()` to clear all per-token visibility/cover maps and all module-created effects across the scene, then rebuild and refresh visuals.
- Macros added:
  - Clear All Scene Data (calls `api.clearAllSceneData()`)
  - Open Token Manager(calls `api.openTokenManager()`)

### Improved

- Effects handling: will now use batching for better performance

## [1.7.1] - 2025-08-11

### Changed

- Enhanced tooltip size customization: Improved implementation of tooltip font size setting
- Added proper scaling of tooltip icons based on font size
- Added CSS variables for consistent tooltip sizing across all components
- Better responsiveness for tooltip elements at different font sizes

### Fixed

- Tooltips should now stick and not move with the canvas

## [1.7.0] - 2025-08-10

### Added

- Enforce RAW Setting: When disabled (default) will skip some conditions checks
- Multiple rules per effect: Instead of multiple effects, the module will now handle one effect with multiple rules per state

### Improved

- Memory optimization: Batch processing for visibility changes to reduce heap usage
- Token deletion cleanup: Automatically remove deleted tokens from visibility maps, visibility effects, and cover effects
- Performance: Optimized effect creation and updates to use bulk operations instead of individual promises
- Efficiency: Replaced Promise.all loops with direct bulk document operations for better memory usage
- Performance: Completely redesigned effect updates to batch all operations by state and effect type
- Performance: Implemented batched visibility and cover updates in token manager to drastically reduce individual updates
- UI Improvement: "Apply Current" now applies the current type (visibility or cover) for both observer and target modes
- UI Improvement: "Apply Both" now applies both types (visibility and cover) for both observer and target modes
- UI Improvement: Visibility Manager now closes immediately when applying changes and shows a progress bar
- Performance: Optimized cover effects system with bulk operations for better memory usage

### Fixed

- Chat Automation: Fixed encounter filtering not working properly for all actions (Seek, Point Out, Sneak, Hide, Create a Diversion, Consequences)
- Chat Automation: Fixed issue where players couldn't see the Seek template setup button when no valid targets were detected

## [1.6.1] - 2025-08-10

### Fixed

- Token Manager: Cover should now support highlight and go to row as well

## [1.6.0] - 2025-08-10

### Added

- Chat Automation: Added Apply Changes / Revert Changes to the automation panel for all actions

## [1.5.1] - 2025-08-10

### Changed

- Matching color for dialog theme on highlight row

## [1.5.0] - 2025-08-10

### Added

- Token Manager: Replaced Effects column with DC column in the Visibility tab.
  - Target mode shows Perception DC; Observer mode shows Stealth DC.
- New world setting: "Integrate roll outcome in the token manager".
  - Optional Outcome column compares the last relevant roll to the DC and displays degree-of-success (Success, Failure, Critical Success/Failure).
- Selection-based row highlighting across Token Manager and all action dialogs (Seek, Hide, Sneak, Create a Diversion, Point Out, Consequences):
  - Selecting tokens on the canvas highlights matching rows and auto-scrolls them into view.

### Changed

- Moved effects descriptions into the Current State tooltip.
- Unified PC and NPC table widths; responsive colgroups when Outcome is on/off.
- Outcome chip style matches action dialogs.
- If Outcome is enabled, the manager widens on open to ensure the column is visible.
- Removed hover-based row→token and token→row behavior to avoid conflicts; selection now drives row highlighting.

### Fixed

- Correct DC tooltip text and header alignment.
- Layout glitches when Outcome is disabled.

## [1.4.0] - 2025-08-09

### Added

- Hover tooltips now show Font Awesome icon badges aligned above tokens:
  - Left badge: visibility state icon
  - Right badge: cover icon when applicable
- PF2e hud support for tooltip position

### Changed

- Hover tooltips no longer render text labels; icons are used for a cleaner, compact look.
- Badge positioning uses world-to-screen transforms, keeping alignment stable under zoom/pan.
- Create a Diversion discovery now considers both observed and concealed creatures as valid observers, and outcomes display only those who can currently see the diverter.
- Hide possible when token got observers and is concealed OR (has standard OR great cover)
- Effects will show token name rather than actor

### Fixed

- Token Manager: resolved ReferenceError for `pairs2` in target-mode apply flows.
- Tooltip cleanup reliably removes DOM badges to prevent lingering elements after hover/Alt/O.

## [1.3.3] - 2025-08-09

### Fixed

- Damage Consequences: Only list targets that explicitly have the attacker as Hidden/Undetected; removed global condition fallback.
- Damage Consequences button is hidden when no outcomes exist and shown when at least one target qualifies.
- Token Manager/Visibility Manager: Reworked layout to a single outer scroll container; inner tables no longer create nested scrollbars.
- Sticky footer no longer overlaps content; center area flexes and scrolls correctly.

## [1.3.2] - 2025-08-09

## Fixed

- CSS class overrding default system one (sorry!)

## [1.3.1] - 2025-08-08

### Added

- New world setting: Integrate Cover with Visibility Rules (`integrateCoverVisibility`). When enabled, certain actions obey cover prerequisites. Specifically, Hide is only available if the acting token has at least Standard Cover from an observer.

### Changed

- Chat automation now hides the “Open Hide Results” button when no actionable changes are possible after applying visibility and cover checks (and the actual roll outcome when present).
- Hide observer discovery uses the same cover gating as the UI check to ensure consistency.

---

## [1.3.0] - 2025-08-08

### Visioner Token Manager (Visibility & Cover)

- Reworked Apply actions:
  - Apply Current now applies the active type (Visibility or Cover) for BOTH modes (Observer → Targets and Targets → Observer).
  - Apply Both now applies BOTH types for BOTH modes in one click.
- States persist reliably after changing type:
  - All map writes now merge into existing maps instead of overwriting.
  - Writes use `document.update({ flags... })` for stability.
  - Dialog refresh re-reads maps from flags on each render.
- Corrected table sorting per type (ally\npc):
  - Visibility order: Observed → Concealed → Hidden → Undetected.
  - Cover order: None → Lesser → Standard → Greater.

All notable changes to the PF2E Visioner module will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.2] - 2025-08-08

### Fixed

- **Hide/Sneak/Create a diversion/Consequences Buttons**: Restored functionality of "Open Hide Results" and "Open Sneak Results" buttons in chat. Clicking now opens their preview dialogs as expected.
- **Generic Open Actions**: Added unified handling for other `open-*` actions (e.g., Create a Diversion, Consequences) for improved resilience.

## [1.2.1] - 2025-08-08

### Changed

- **Seek Template Player Logic**: Players will now be able to put their own seek templates, letting GMs open the results nicely
- **Point out Player Logic**: Players are now able to point out themselves, letting the GM open the results nicely, added ping on the pointed out token

## [1.2.0] - 2025-08-08

### Added

- **Seek via Template (30 ft Burst)**: Optional template-based Seek targeting
  - New setting to enable template mode for Seek
  - “Setup Seek Template” button in chat lets you place a 30 ft burst anywhere with live preview
  - Tokens inside the template are considered for Seek; edge intersections count
  - Button toggles to “Remove Seek Template” after placement

### Changed

- **Range Limitation Logic**: When using a template, combat/non-combat Seek distance limits are fully ignored
- **Colors**: Template colors use the current player's color; fallback to themed defaults

---

## [1.1.0] - 2025-08-08

### Added

- **Out of Combat Seek Distance Limitation**: Implemented distance limitations for Seek actions outside of combat
  - GMs can now configure maximum distance for out-of-combat Seek attempts
  - Distance is calculated automatically between seeker and potential targets
  - Setting can be adjusted in module configuration

## [1.0.2] - 2025-08-07

### Fixed

- **Visibility Manager Actor Image**: Fixed an issue with actor images

## [1.0.1] - 2025-08-07

### Fixed

- **Visibility Manager Mode Switching**: Fixed issue where toggling between observer and target mode would reset changes made in the previous mode
  - Changes in both modes are now preserved when toggling between modes
  - Apply Changes button now applies changes from both observer and target modes
- **Point Out Action**: Improved Point Out action to work when the pointer can see the target in any visibility state (observed, concealed, or hidden)

## [0.8.0] - 2025-08-10

### Added

- **Rule Element Initial Support**: Added custom rule element for controlling visibility states
  - Implemented PF2eVisionerVisibility rule element with direction control (TO/FROM)
  - Added schema with configurable options for subject, observers, mode, and status
  - Supports multiple observer types: all, allies, enemies, selected, targeted
  - Includes various modes: set, increase, decrease, remove
  - Provides duration control and range limitations
  - Effects are placed on the subject token for consistent behavior
  - Added comprehensive documentation and example items

### Fixed

- **Unification**: Matching colors through all dialogs for the visibility states

## [0.7.0] - 2025-08-08

### Added

- **Colorblind Mode**: Added accessibility option for different types of colorblindness
  - Multiple colorblind modes: Protanopia, Deuteranopia, Tritanopia, and Achromatopsia
  - Client-side setting that can be set individually by each user
  - Adds visual indicators and alternative color schemes for better visibility
  - Includes pattern indicators to help differentiate visibility states beyond color

### Fixed

- **Create a Diversion Button**: Fixed issue where the Create a Diversion button would appear even when there were no valid targets (creatures that can see the actor)
- **Create a Diversion Dialog**: Fixed issue where the Create a Diversion dialog would not open when clicking the button
- Added notification when attempting to use Create a Diversion with no valid targets
- Added detailed logging for Create a Diversion actions to help with troubleshooting

## [0.6.1] - 2025-08-07

### Changed

- **Improved Dialog Visibility Logic**: Dialog buttons now only appear when there are valid targets for actions, avoiding unnecessary notifications for all dialog types (Seek, Point Out, Hide, Sneak, Create a Diversion, and Consequences)

## [0.6.0] - 2025-08-07

### Added

- **Damage Consequences Dialog**: Added red-themed dialog that appears when a hidden or undetected token makes a damage roll, allowing the GM to update visibility states of affected targets

## [0.5.0] - 2025-08-07

### Added

- **Block Target Tooltips for Players**: Added setting to prevent players from seeing target tooltips when hovering over tokens, while still allowing them to see tooltips when holding O key or pressing Alt

## [0.4.0] - 2025-08-07

### Added

- **Custom Tooltip Size**: Added slider control for adjusting tooltip font size
- **Client-side Setting**: Font size preference is stored per-user rather than globally
- **Responsive Sizing**: Tooltip components scale proportionally with font size changes

## [0.3.0] - 2025-08-07

### Added

- **Custom Seek Distance**: Added configurable distance setting for Seek range limitation
- **Settings Organization**: Improved settings layout with logical grouping for better usability
- **Enhanced Notifications**: Updated range limit messages to show the custom distance

## [0.2.18] - 2025-08-06

### Improved

- **Dialog Layout**: Added scrollable table with fixed footer to action dialogs for better usability with many tokens
- **Dialog Sizing**: Fixed dialog height and scrolling behavior to ensure proper display of large result sets
- **Table Scrolling**: Enhanced table container to properly handle overflow with fixed headers and footers
- **Cross-Browser Compatibility**: Added JavaScript-based scrolling fixes for better cross-browser support
- **Direct DOM Manipulation**: Added dedicated scroll fix module that applies direct DOM styling to ensure consistent scrolling behavior across all browsers and Foundry versions
- **Themed Scrollbars**: Added color-matched scrollbars for each action dialog type (Hide, Seek, Point Out, Sneak, Create a Diversion) to enhance visual consistency

## [0.2.17] - 2025-08-06

### Fixed

- **Point out dialog wrong application**: fixed condition(hidden\undetected) change for wrong token

## [0.2.15] - 2025-08-06

### Fixed

- **Major bug**: Had an issue that effect would go on the defender when attacking a condition(hidden\undetected) attacker, this is now fixed

## [0.2.14] - 2025-08-06

### Added

- **Combat Seek Range Limitation**: New setting to limit Seek actions to 30 feet range in combat, following PF2e rules
- **Range Feedback**: Clear notifications when range limitation is active and targets are out of range

## [0.2.13] - 2025-08-06

### Improved

- **Consolidated DC Extraction**: Centralized perception and stealth DC extraction functions in shared utilities for consistent access paths across all automation dialogs
- **Simplified Data Access**: Optimized DC extraction to use definitive paths for both PC and NPC actors, removing complex fallback logic
- **Code Maintainability**: Standardized DC access patterns across all visibility-related dialogs (Hide, Seek, Sneak, Create a Diversion, Point Out)

## [0.2.7] - 2025-08-06

### Added

- **Player Tooltip Setting**: New "Allow Player Tooltips" setting enables non-GM players to see visibility indication tooltips from their controlled tokens' perspective
- **Ignore Allies Setting**: New "Ignore Allies" setting filters visibility dialogs so NPCs only see players and players only see NPCs, streamlining visibility management
- **Shared Utility Functions**: Extracted common ally filtering logic into reusable utility functions for better code maintainability

### Fixed

- **Hide Dialog Encounter Filter**: Fixed bug where "Apply All" button in Hide dialog ignored encounter filter and applied changes to all tokens instead of only encounter tokens
- **Encounter Filter Logic**: Encounter filter now properly maintains its state and shows empty results when no encounter tokens match, instead of automatically disabling the filter

### Improved

- **Code Organization**: Refactored all chat automation modules to use shared ally filtering utility, eliminating code duplication and ensuring consistency
- **Player Access Control**: Players can only see tooltips for their own controlled tokens when player tooltips are enabled, preventing information leakage
- **Setting Integration**: Both new settings require world restart and are properly integrated with the module's configuration system

## [0.2.5] - 2025-08-06

### Fixed

- **API**: Fixed API function with options

## [0.2.4] - 2025-08-06

### Added

- **API**: Added API function to update ephemeral effects for visibility changes

## [0.2.3] - 2025-08-05

### Fixed

- **Sneak visibility**: Fixed Sneak visibility logic to use effective new state instead of hardcoding 'undetected'

## [0.2.2] - 2025-08-05

### Fixed

- **CSS Syntax**: Fixed CSS syntax error in chat-automation-styles.js

## [0.2.1] - 2025-08-05

### Fixed

- **Sneak perception DC calculation**: Enhanced Sneak dialog perception DC retrieval with multiple fallback paths for different PF2e system versions, matching Create a Diversion's robust implementation

## [0.2.0] - 2025-08-05

### Added

- **Sneak Action Dialog**: Complete automation for PF2E Sneak actions with preview and outcome management
- **Create a Diversion Dialog**: Complete automation for PF2E Create a Diversion actions with preview and outcome management
- **Token hover highlighting**: Hover over token rows in dialogs to highlight tokens on canvas
- **Enhanced error handling**: Graceful handling of ephemeral effect cleanup errors
- **Initiative-based effects**: Support for ephemeral effects that track combat initiative

### Improved

- **Dialog styling consistency**: Unified text sizes, spacing, and layout across all action dialogs
- **Token image presentation**: Removed unnecessary tooltips and borders from token images in tables
- **UI responsiveness**: Optimized dialog width and column sizing for better proportions
- **Button state management**: Dynamic enabling/disabling based on actual changes from original state
- **Visual feedback**: Enhanced state icons and selection indicators for better user experience
- **Create a Diversion outcomes**: Fixed token images, centered action buttons, and added proper outcome text coloring
- **Perception DC calculation**: Improved DC retrieval with multiple fallback paths for different PF2e system versions

### Technical

- **ApplicationV2 compliance**: Proper use of built-in action system instead of manual event binding
- **Error resilience**: Try-catch blocks around visibility operations to prevent dialog crashes
- **Code organization**: Improved separation of concerns between dialog logic and template rendering

## [0.1.x] - 2025-01-31

### Fixed

- Resolved circular dependency issue causing "Cannot use import statement outside a module" error
- Fixed manifest warning about unknown "system" key by using correct v13 relationships format
- Implemented lazy loading for API components to prevent initialization conflicts

### Added

- Complete rewrite for FoundryVTT v13 compatibility
- Modern ApplicationV2-based visibility manager interface
- ESModule architecture for better performance and maintainability
- Comprehensive localization support (English included)
- Bulk actions for setting multiple tokens at once
- Visual indicators with animated effects
- Keyboard shortcut support (`Ctrl+Shift+V`)
- Token HUD integration for quick access
- Context menu integration
- Modern responsive CSS design with v13 theme support
- Auto-apply PF2E conditions option
- Socket support for future multiplayer features
- Hot reload support for development
- Comprehensive API for module developers
- Full TypeScript-style JSDoc documentation

### Changed

- Upgraded from ApplicationV1 to ApplicationV2 framework
- Improved data storage using modern flag system
- Enhanced visual effects system with better performance
- Redesigned UI with modern FoundryVTT v13 styling
- Better error handling and user feedback
- Optimized token visibility update logic

### Technical

- Minimum FoundryVTT version: v13.341
- Verified compatibility: v13.346
- PF2E system compatibility: v6.0.0+
- ESModule entry point instead of legacy scripts
- CSS Layer implementation for better module compatibility

## [0.1.0] - Previous Version

### Added

- Basic per-token visibility functionality
- Simple table-based interface
- Core visibility states (Observed, Hidden, Undetected, Concealed)
- Token appearance modification
- Flag-based data storage

### Compatibility

- FoundryVTT v12 and earlier
- Basic ApplicationV1 framework
- Basic ApplicationV1 framework
