Keep both drawing-visibility rules when hiding manual levels
Resolves a conflict between hide_finer_trendlines and upstream's drawingVisible helper. They gate on different prefs — hideLowerTfDrawings versus hide_finer_trendlines — so both apply rather than one replacing the other.
This commit is contained in:
parent
1c06ae370a
commit
e94bd3d3d2
2 changed files with 11 additions and 2 deletions
|
|
@ -71,6 +71,7 @@ const defaultPrefs = {
|
||||||
base_tf: '1m',
|
base_tf: '1m',
|
||||||
enabled: { ma: { '1d': [10, 20, 50, 100, 200] }, drawings: true, manual: true, auto: false, horizontal: true, vwap: true, rth: true },
|
enabled: { ma: { '1d': [10, 20, 50, 100, 200] }, drawings: true, manual: true, auto: false, horizontal: true, vwap: true, rth: true },
|
||||||
hidden_levels_score: false,
|
hidden_levels_score: false,
|
||||||
|
hide_finer_trendlines: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Stored preferences outlive the shape they were written in. Anything added to
|
// Stored preferences outlive the shape they were written in. Anything added to
|
||||||
|
|
@ -1384,8 +1385,15 @@ createApp({
|
||||||
function enabled(level) {
|
function enabled(level) {
|
||||||
if (level.kind === 'ma') return (prefs.value.enabled.ma[level.tf] || []).includes(level.period);
|
if (level.kind === 'ma') return (prefs.value.enabled.ma[level.tf] || []).includes(level.period);
|
||||||
if (level.kind === 'manual') {
|
if (level.kind === 'manual') {
|
||||||
return prefs.value.enabled.drawings && prefs.value.enabled.manual
|
if (!(prefs.value.enabled.drawings && prefs.value.enabled.manual)) return false;
|
||||||
&& drawingVisible(level);
|
// Two independent hiding rules, so both apply: drawingVisible covers
|
||||||
|
// hideLowerTfDrawings, and hide_finer_trendlines hides sloped lines
|
||||||
|
// drawn on a finer timeframe than the one being viewed.
|
||||||
|
if (!drawingVisible(level)) return false;
|
||||||
|
if (prefs.value.hide_finer_trendlines && !ConfluenceChart.isFlat(level)) {
|
||||||
|
return timeframes.indexOf(level.tf) >= timeframes.indexOf(timeframe.value);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
if (level.kind === 'horizontal') return prefs.value.enabled.horizontal;
|
if (level.kind === 'horizontal') return prefs.value.enabled.horizontal;
|
||||||
if (level.kind === 'vwap') return prefs.value.enabled.vwap;
|
if (level.kind === 'vwap') return prefs.value.enabled.vwap;
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@
|
||||||
<label><input type="checkbox" v-model="autoScrollLivePrice"> Autoscroll to live price</label>
|
<label><input type="checkbox" v-model="autoScrollLivePrice"> Autoscroll to live price</label>
|
||||||
<label><input type="checkbox" v-model="hideLowerTfDrawings"> Hide lower-TF drawings</label>
|
<label><input type="checkbox" v-model="hideLowerTfDrawings"> Hide lower-TF drawings</label>
|
||||||
<label><input type="checkbox" v-model="extraDetail"> Extra detail</label>
|
<label><input type="checkbox" v-model="extraDetail"> Extra detail</label>
|
||||||
|
<label title="Daily and hourly trendlines still show on 1m; 1m trendlines stay off 1h and 1d"><input type="checkbox" v-model="prefs.hide_finer_trendlines"> Hide finer-timeframe trendlines</label>
|
||||||
</details>
|
</details>
|
||||||
<details class="sidebar-section tools-section" open>
|
<details class="sidebar-section tools-section" open>
|
||||||
<summary>Tools</summary>
|
<summary>Tools</summary>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue