Skip to content

Tile stats: remove "Rank" and "Fresh", reorder to Last, Visits, Trend #13

Description

@perdrizat

What

Trim the per-tile stat-type options and change their display order to: Last, Visits, Trend (dropping Rank and Fresh).

Where

The statType radiogroup in webextension/newTab.html:167-174:

<div class="ntt-segmented" role="radiogroup" data-pref="statType">
	<button type="button" role="radio" data-value="none" data-message="options_stat_none"></button>
	<button type="button" role="radio" data-value="visits" data-message="options_stat_visits"></button>
	<button type="button" role="radio" data-value="last" data-message="options_stat_last"></button>
	<button type="button" role="radio" data-value="trend" data-message="options_stat_trend"></button>
	<button type="button" role="radio" data-value="rank" data-message="options_stat_rank"></button>
	<button type="button" role="radio" data-value="fresh" data-message="options_stat_fresh"></button>
</div>

New order: none, last, visits, trend (remove the rank and fresh buttons).

Corresponding logic in webextension/stats.js: TileStats.compute()'s 'rank' (line 50-52) and 'fresh' (lines 88-95) branches become dead once no UI can select those values — remove them along with the rank parameter if nothing else calls compute() with a rank value.

Fix shape

  • Reorder/remove the buttons in newTab.html.
  • Drop the now-unreachable rank/fresh cases in TileStats.compute() (webextension/stats.js).
  • Existing statType prefs on upgrade: users currently set to rank or fresh need a migration fallback (e.g. to none or last) — check webextension/prefs.js for how pref migrations are handled elsewhere.
  • Remove/update the corresponding options_stat_rank/options_stat_fresh message strings and any tests asserting the old order/values (tests/integration/stats.test.ts covers TileStats.compute()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions