Skip to content

feat: add date-based achievement filtering and lock visible button#604

Open
ImBIOS wants to merge 1 commit into
gibbed:masterfrom
ImBIOS:feature/date-filter-lock-visible
Open

feat: add date-based achievement filtering and lock visible button#604
ImBIOS wants to merge 1 commit into
gibbed:masterfrom
ImBIOS:feature/date-filter-lock-visible

Conversation

@ImBIOS
Copy link
Copy Markdown

@ImBIOS ImBIOS commented May 13, 2026

Summary

Add date-based achievement filtering and a "Lock Visible" button to enable bulk un-achieving of all achievements unlocked on a specific date.

Context

Currently, SAM has no way to filter achievements by their unlock date. Users who want to un-achieve all achievements unlocked on a specific date must manually scroll through the list, identify them by the "Unlock Time" column, and uncheck each one individually. This is tedious and error-prone, especially for games with many achievements.

Closes #603

Changes

New UI Controls (Achievement Toolbar)

  • "Lock Visible" button (lock icon) — unchecks all currently visible achievements in one click
  • "Date" label + "filter on" toggle + date picker — enables date-based filtering of achievements

Logic Changes

  • Added date filtering in GetAchievements() that compares each achievement's unlockTime (Unix timestamp) against the selected date (converted to local date)
  • Date filter works in combination with existing text filter and locked/unlocked display filters
  • OnLockVisible handler unchecks all visible items
  • OnDateFilterToggle enables/disables the date picker and refreshes the list
  • OnDateFilterChanged refreshes the list when the date changes (only when filter is active)

Build Fixes

  • Added GenerateResourceUsePreserializedResources property and System.Resources.Extensions NuGet package to both SAM.Game and SAM.Picker csproj files to fix building with .NET 8 SDK

Use Cases

  1. Undo accidental batch unlock: Filter by the date achievements were incorrectly unlocked, then lock all visible and commit
  2. Clean up specific day's progress: Select a date, see only that day's achievements, lock them all
  3. Combined with existing filters: Use date filter + text filter + locked/unlocked filter together for precise control

Testing

  1. Build the solution: dotnet build SAM.sln -c Debug
  2. Run SAM and select a game with unlocked achievements
  3. Click "filter on" next to "Date" in the toolbar
  4. Select a date — only achievements unlocked on that date should appear
  5. Click the "Lock Visible" button — all visible achievements should be unchecked
  6. Click "Commit Changes" — changes should be stored

Files Changed

  • SAM.Game/Manager.Designer.cs — New UI controls in toolbar
  • SAM.Game/Manager.cs — Date filtering logic + event handlers
  • SAM.Game/SAM.Game.csproj — Build fix for .NET 8 SDK
  • SAM.Picker/SAM.Picker.csproj — Build fix for .NET 8 SDK

Copilot AI review requested due to automatic review settings May 13, 2026 11:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds achievement-list tooling in SAM’s game manager UI to support filtering achievements by unlock date and quickly locking all currently displayed achievements, plus build changes aimed at .NET 8 SDK compatibility for net48 WinForms projects.

Changes:

  • Adds a “Lock Visible” toolbar button to bulk-uncheck the currently displayed achievements.
  • Adds a date filter toggle + date picker, and applies date-based filtering during achievement list population.
  • Updates SAM.Game and SAM.Picker project files with resource-generation settings and a resources extension package reference.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
SAM.Picker/SAM.Picker.csproj Adds preserialized resource generation property and System.Resources.Extensions package reference.
SAM.Game/SAM.Game.csproj Adds preserialized resource generation property and System.Resources.Extensions package reference.
SAM.Game/Manager.Designer.cs Adds WinForms toolbar controls for “Lock Visible” and date filtering (toggle + picker).
SAM.Game/Manager.cs Implements date filtering in GetAchievements() and adds event handlers for the new toolbar controls.
Files not reviewed (1)
  • SAM.Game/Manager.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)

SAM.Game/Manager.Designer.cs:77

  • _ToolStripSeparator2 is instantiated twice (once before _MatchingStringLabel and again later with the other separators). The first instantiation is immediately overwritten and never used; remove the redundant assignment to avoid confusing / fragile designer code.

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

Comment thread SAM.Game/Manager.cs
Comment on lines +490 to +499
// Date filtering
if (this._DateFilterCheckBox.Checked)
{
var innerPicker = (System.Windows.Forms.DateTimePicker)this._DateFilterPicker.Control;
var filterDate = innerPicker.Value.Date;

// Only show achievements that were unlocked on the selected date
if (isAchieved == false || unlockTime <= 0 ||
DateTimeOffset.FromUnixTimeSeconds(unlockTime).LocalDateTime.Date != filterDate)
{
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.

Feature: Date-based achievement filtering and lock visible

2 participants