mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
fix: remove value history cooldown hack, dismiss popup on clear
The cooldown suppressed tracking for ~1s but the popup persisted showing stale "1h ago" values because applyDocument skips popup dismissal. Replaced with explicit dismissHistoryPopup() after clear+refresh so the popup is gone immediately. Value tracking resumes on the next async cycle with a clean baseline (m_refreshGen++ discards in-flight reads, m_prevPages.clear() prevents phantom diffs).
This commit is contained in:
@@ -602,8 +602,7 @@ void RcxController::refresh() {
|
||||
else if (m_doc->provider && m_doc->provider->isValid() && m_doc->provider->isLive())
|
||||
prov = m_doc->provider.get();
|
||||
|
||||
if (m_valueTrackCooldown > 0) --m_valueTrackCooldown;
|
||||
if (m_trackValues && prov && m_valueTrackCooldown <= 0) {
|
||||
if (m_trackValues && prov) {
|
||||
for (auto& lm : m_lastResult.meta) {
|
||||
if (lm.nodeIdx < 0 || lm.nodeIdx >= m_doc->tree.nodes.size()) continue;
|
||||
if (isSyntheticLine(lm) || lm.isContinuation) continue;
|
||||
@@ -1711,8 +1710,9 @@ void RcxController::showContextMenu(RcxEditor* editor, int line, int nodeIdx,
|
||||
m_refreshGen++; // discard in-flight async reads
|
||||
m_prevPages.clear(); // clean baseline for next read cycle
|
||||
m_changedOffsets.clear(); // no phantom change indicators
|
||||
m_valueTrackCooldown = 5; // suppress tracking for ~1s
|
||||
refresh();
|
||||
for (auto* editor : m_editors)
|
||||
editor->dismissHistoryPopup();
|
||||
});
|
||||
}
|
||||
menu.addSeparator();
|
||||
@@ -1935,8 +1935,9 @@ void RcxController::showContextMenu(RcxEditor* editor, int line, int nodeIdx,
|
||||
m_refreshGen++; // discard in-flight async reads
|
||||
m_prevPages.clear(); // clean baseline for next read cycle
|
||||
m_changedOffsets.clear(); // no phantom change indicators
|
||||
m_valueTrackCooldown = 5; // suppress tracking for ~1s
|
||||
refresh();
|
||||
for (auto* editor : m_editors)
|
||||
editor->dismissHistoryPopup();
|
||||
});
|
||||
}
|
||||
menu.addSeparator();
|
||||
|
||||
@@ -183,7 +183,6 @@ private:
|
||||
QSet<int64_t> m_changedOffsets;
|
||||
QHash<uint64_t, ValueHistory> m_valueHistory;
|
||||
bool m_trackValues = true;
|
||||
int m_valueTrackCooldown = 0;
|
||||
uint64_t m_refreshGen = 0;
|
||||
uint64_t m_readGen = 0;
|
||||
bool m_readInFlight = false;
|
||||
|
||||
@@ -1387,6 +1387,11 @@ void RcxEditor::showFindBar() {
|
||||
m_findPos = 0;
|
||||
}
|
||||
|
||||
void RcxEditor::dismissHistoryPopup() {
|
||||
if (m_historyPopup)
|
||||
static_cast<ValueHistoryPopup*>(m_historyPopup)->dismiss();
|
||||
}
|
||||
|
||||
void RcxEditor::hideFindBar() {
|
||||
m_findBarContainer->setVisible(false);
|
||||
long docLen = m_sci->SendScintilla(QsciScintillaBase::SCI_GETLENGTH);
|
||||
|
||||
@@ -34,6 +34,7 @@ public:
|
||||
int currentNodeIndex() const;
|
||||
void scrollToNodeId(uint64_t nodeId);
|
||||
void showFindBar();
|
||||
void dismissHistoryPopup();
|
||||
|
||||
// ── Column span computation ──
|
||||
static ColumnSpan typeSpan(const LineMeta& lm, int typeW = kColType);
|
||||
|
||||
Reference in New Issue
Block a user