Skip to content

Exploration reset per AreaHash / Loot labels in the entity list / Inspector actions#173

Merged
imm0r merged 3 commits into
masterfrom
PoEfdev/map-exploration-reset-1a9cc1
Jul 8, 2026
Merged

Exploration reset per AreaHash / Loot labels in the entity list / Inspector actions#173
imm0r merged 3 commits into
masterfrom
PoEfdev/map-exploration-reset-1a9cc1

Conversation

@imm0r

@imm0r imm0r commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Per-area exploration-coverage cache — survive a town round-trip

Summary — The on-map explored-% no longer resets to 0 when you leave an in-progress map for town and return; coverage is now cached per area-instance hash and restored on re-entry.

Changes

  • ahk/ExplorationModule.ahk:115 — new statics _areaKey/_areaCache/_areaOrder/_AREA_CACHE_CAP (per-area coverage cache).
  • ahk/ExplorationModule.ahk:126 — area identity now keyed by area["currentAreaHash"] ("h"-prefixed; falls back to "sz"<dataSize>), replacing the raw dataSize change trigger.
  • ahk/ExplorationModule.ahk:133 — on area change: bank the leaving area's state (visited buffer, _totalWalkable/_visitedWalkable, full region-flood state, coarse dims), then RESTORE the entered area's cached state when its terrainSz matches, else fresh-init (original logic unchanged). Cache capped at 24, insertion-order evicted.
  • InGameStateMonitor.ahk:59, CLAUDE.md:4, README.md:7 — version 0.45.13.2860.45.13.287.

Advices

  • Navigation still re-plans on re-entry (from the restored visited map), so it continues rather than re-covering explored cells.
  • Keying by hash also fixes a latent bug: two different runs of the same map layout no longer share stale visited state.
  • A transient currentAreaHash == 0 (with valid terrain) briefly flips the key to "sz…" and re-inits for one tick, then restores next tick — self-correcting, safe.

Entities list: ground-item loot labels

Summary — The Entities tab now shows each ground drop's real, rarity-colored loot label (e.g. "Cannonade Crossbow") in the Name column instead of the generic "WorldItem".

Changes

  • ahk/LootRadarValue.ahk — new LrvWorldItemLabel(wrapperAddr, areaHash, &rarityId): resolves the wrapper's inner item and composes the name via the inventory tooltip's ComposeItemDisplayName (base + affixes / unique via IVI); currency classified rarity 5 by /Currency/ path. Per-wrapper cache reset on area change (g_lrvNameCache/g_lrvNameCacheHash, seeded in LoadLootRadarValue).
  • ahk/SnapshotSerializers.ahk:_BuildEntitiesJson — captures namesAreaHash; for WorldItem rows overrides the Name + rarity via LrvWorldItemLabel and emits "loot":true/false; new itemRarityNames map (item ids, 5=Currency).
  • ui/index.html.ei-c-name-txt.loot-0..6 in-game color classes; eiCard colors the name span only for loot rows (e.loot).
  • InGameStateMonitor.ahk / CLAUDE.md / README.md — version 0.45.13.287 → 0.45.13.288.

Advices

  • Independent of the Loot Value Radar toggle — resolution runs whenever the Entities tab is pushed.
  • Name follows the inventory-tooltip composer, which drops the tier adjective — magic/rare names can differ slightly from the exact in-game string; base + affix words + color match.
  • Cached per area; a recycled wrapper address in a new zone can't return a stale name.

Open / Next steps

  • In-game: open Entities on a map with loot — WorldItem rows should show item names in rarity colors and reset on zone change; verify far (off-screen) drops resolve too.

Entity Inspector actions + user-extensible Junk Filter

Summary — Four Entity-Inspector conveniences: copy path, open a component's address in the Memory Dissector, add the full path to global junk terms, and add an entity's meta-group to a junk category (auto-targeting/creating a category named after its meta-category).

Changes

  • ahk/EntityJunkFilter.ahk — user-extensible model: g_junkCatCustom (per-category custom patterns) + g_junkUserCats (user categories); new _ApplyJunkSetting keys catadd/catpatdel/newcat/catdel (|-delimited value); cat: also flips custom patterns; BuildJunkFilterHeaderJson+_JunkCatJson emit custom[]+user; persistence via [JunkFilter] catPatterns (RS/US).
  • ui/index.html — inspector: Path 📋 copy (eiCopyText), Category junk picker (eiJunkPickerHtml/eiJunkAdd/eiJunkSelChange), actions "🚫 Junk (full path)" (eiAddPathCustom), per-component 🔬 dissector button (eiOpenDissect); junk box: custom pills + ✕ (junkDelCatPat), user-category delete (junkDelCat); applyJunkFromHeader exposes _junkCatList + counts custom patterns; new CSS.
  • InGameStateMonitor.ahk / CLAUDE.md / README.md — version 0.45.13.288 → 0.45.13.289.

Advices

  • The Category picker adds the meta-group (broad match); the target category key is the lowercased meta-category, auto-created if new. Bridge delimiter is | (safe in paths/keys/labels); user-typed names are |-stripped.
  • Built-in categories are permanent; only user-created categories are deletable (and an emptied user category is auto-removed when its last pattern is deleted).
  • IsJunkEntity matching is unchanged (case-insensitive substring), so added patterns hide entities across radar/list/trees/exports/AutoPilot.

imm0r and others added 3 commits July 8, 2026 10:16
The on-map explored-% reset to 0 on every terrain change, so leaving an
in-progress Atlas map for town and returning wiped the progress. Coverage
state (visited buffer, counters, reachability-region flood, coarse dims) is
now cached keyed by the area instance hash (area["currentAreaHash"]) and
restored on re-entry; navigation re-plans from the restored visited map.
Keying by hash instead of dataSize also fixes a latent bug where two runs of
the same map layout shared stale visited state. Cache is capped at 24 areas
with insertion-order eviction.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
WorldItem rows (Metadata/MiscellaneousObjects/WorldItem) now display the
drop's real, rarity-colored loot label (e.g. "Cannonade Crossbow", "Gold
Circlet") in the Name column instead of the generic "WorldItem".

New LrvWorldItemLabel() resolves the wrapper's inner item and composes the
name via the same ComposeItemDisplayName the inventory tooltip uses (base +
affixes for magic/rare, unique name via ItemVisualIdentity); currency is
classified rarity 5 by the /Currency/ path. Results are cached per wrapper
address and reset on area change. _BuildEntitiesJson overrides displayName +
rarity for WorldItems and emits a "loot" flag; the UI colors the name span
by rarity (loot-0..6) like the in-game label. Path/Type columns unchanged.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Four Entity-Inspector conveniences:
- Copy the metadata path to the clipboard (📋 next to Path).
- Open a component's memory address in the RE → Memory Dissector (🔬 per
  component, via switchTab + DissectGoto).
- Add the entity's full metadata path to the global junk Custom terms
  (🚫 next to Copy JSON).
- Add the entity's meta-group as a junk pattern under a category picked
  from the Category row: auto-targets a category named after the
  meta-category (created if new), or the user picks an existing one /
  creates a new one.

Junk Filter is now user-extensible: g_junkCatCustom holds per-category
custom patterns (built-in OR user categories), g_junkUserCats holds
user-created categories. New SetJunk keys catadd/catpatdel/newcat/catdel
(pipe-delimited value — no control char crosses the WebView bridge);
cat: enable/disable-all also flips custom patterns. Header emits
custom[]+user per category; custom pills render with a delete button and
user categories with a "delete category" button. Persisted in
[JunkFilter] catPatterns (RS/US), same scheme as StashMover.

Verified: browser-preview drive-through (rendering + catadd payloads) and
an offline AHK harness (parse, IsJunkEntity match, header JSON, Save/Load
round-trip of the user category + per-category patterns).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Copilot AI review requested due to automatic review settings July 8, 2026 12:44
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances PoEformance’s in-game UI and AHK backend by (1) persisting exploration coverage per area instance, (2) improving entity list fidelity for ground loot, and (3) adding Entity Inspector actions plus a user-extensible Junk Filter model/UI, with accompanying version bumps.

Changes:

  • Cache exploration coverage per currentAreaHash (with bounded eviction) so town/hideout round-trips restore progress.
  • Resolve and display real ground-loot item labels (with rarity coloring) in the Entities list.
  • Add Entity Inspector actions (copy path, open dissector, junk helpers) and extend Junk Filter to support per-category custom patterns and user-created categories.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
ui/index.html Adds loot-name coloring, inspector action buttons, and Junk Filter UI for custom patterns/user categories.
ahk/ExplorationModule.ahk Implements per-area exploration state caching keyed by area instance hash.
ahk/LootRadarValue.ahk Adds WorldItem label resolution + per-area cache for Entities list display names/rarities.
ahk/SnapshotSerializers.ahk Emits loot-specific name/rarity fields for WorldItem rows and a loot flag.
ahk/EntityJunkFilter.ahk Extends Junk Filter model/settings/persistence to support user categories and per-category custom patterns.
InGameStateMonitor.ahk Bumps POEFORMANCE_VERSION to 0.45.13.289.
README.md Updates version badge to v0.45.13.289.
CLAUDE.md Updates documented version and adds detailed notes for the shipped features.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui/index.html
function eiCopyText(ev, text) {
ev.stopPropagation();
if (!text) return;
try { navigator.clipboard.writeText(text); } catch (e) {}
Comment thread ui/index.html
Comment on lines +12676 to +12679
// Strip the delimiter from a user-typed name so it can't split the field.
label = ((inp && inp.value.trim()) || '').split('|').join('');
if (!label) { if (inp) inp.focus(); return; }
key = label.toLowerCase();
Comment thread ui/index.html
// User categories are deletable as a whole (built-ins are permanent).
const delCatBtn = isUser ? `<button class="filter-pill junk-catdel" data-tip="Delete this whole category" onclick="junkDelCat('${escAttr(ck)}')">🗑 delete category</button>` : "";
const emptyNote = (!hasAny && isUser) ? `<span class="junk-cat-empty">No patterns yet — add one from an entity's Category row.</span>` : "";
return `<details class="junk-cat"${_junkOpenCats.has(ck) ? " open" : ""} ontoggle="junkCatToggle('${ck}', this.open)">`
Comment thread ahk/EntityJunkFilter.ahk
Comment on lines +64 to +71
; Resolves a built-in category's display label, or "" when unknown.
_JunkBuiltinLabel(key)
{
for _, cat in _JunkFilterCategoryDefs()
if (cat["key"] = key)
return cat["label"]
return ""
}
Comment thread ahk/EntityJunkFilter.ahk
Comment on lines +177 to +183
g_junkCatCustom[ck] := kept
(g_junkPatDisabled.Has(pat) && g_junkPatDisabled.Delete(pat))
if (kept.Length = 0 && g_junkUserCats.Has(ck))
{
g_junkUserCats.Delete(ck)
g_junkCatCustom.Delete(ck)
}
@imm0r imm0r merged commit a6d8fd9 into master Jul 8, 2026
5 checks passed
imm0r added a commit that referenced this pull request Jul 8, 2026
- ui: derive a strictly-safe slug key ([a-z0-9_-]) from user-typed junk
  category names and sanitize the label (drop the | " ' \ angle-bracket
  chars), so a name can neither split the catadd fields nor break out of
  the inline event-handler strings the category renders into.
- ui: junkCatRow renders its category key through a render-layer safeCk
  sanitizer, so a hand-edited INI / API-set key can't inject into ontoggle
  or onclick either (defense-in-depth).
- ui: eiCopyText attaches a .catch() to clipboard.writeText so a rejected
  write can't surface as an unhandled promise rejection.
- EntityJunkFilter: catpatdel now deletes the g_junkCatCustom entry when its
  last custom pattern is removed (built-in AND user categories), so no empty
  catPatterns record is persisted (fixes slow INI growth).
- EntityJunkFilter: remove the unused _JunkBuiltinLabel helper.

Verified: AHK /validate + UI node --check clean; offline harness confirms the
emptied built-in category persists no INI record and user categories still
round-trip; JS harness confirms slug/label sanitization neutralizes injection.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants