Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 11, 2026

Post-grab actions (Fix GUIDs, Trim lines, Remove duplicates, Web Search, Insert text, Translate) always started unchecked. Users can now configure each action to start as: Off (always unchecked), On (always checked), or Last Used (remember state across sessions).

Changes

  • Enum: Added PostGrabActionDefault with Off/LastUsed/On values
  • Settings: Added 12 properties (2 per action: default mode + last used state)
    • FsgGuidFixDefault / FsgGuidFixLastUsed
    • FsgTrimEachLineDefault / FsgTrimEachLineLastUsed
    • FsgRemoveDuplicatesDefault / FsgRemoveDuplicatesLastUsed
    • FsgWebSearchDefault / FsgWebSearchLastUsed
    • FsgInsertTextDefault / FsgInsertTextLastUsed
    • FsgTranslateDefault / FsgTranslateLastUsed
  • UI: Added "Post-grab action defaults" section in Fullscreen Grab Settings with radio button groups for each action
  • Logic:
    • Window_Loaded() initializes menu items based on configured defaults
    • PostActionMenuItem_Click() persists state when in Last Used mode
    • Single Save() call per toggle to minimize I/O

Implementation

// Initialize menu item state on window load
private void InitializePostGrabAction(MenuItem menuItem, string defaultSetting, bool lastUsedState)
{
    PostGrabActionDefault mode = Enum.Parse<PostGrabActionDefault>(defaultSetting);
    menuItem.IsChecked = mode switch
    {
        PostGrabActionDefault.Off => false,
        PostGrabActionDefault.LastUsed => lastUsedState,
        PostGrabActionDefault.On => true
    };
}

// Persist state when toggled
private bool TrySaveLastUsedState(string defaultSetting, bool isChecked, Action<bool> setLastUsed)
{
    if (Enum.Parse<PostGrabActionDefault>(defaultSetting) == PostGrabActionDefault.LastUsed)
    {
        setLastUsed(isChecked);
        return true; // Signal caller to save
    }
    return false;
}

All actions default to "Off" to maintain existing behavior.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • az667904.vo.msecnd.net
    • Triggering command: /usr/bin/dotnet dotnet build Text-Grab/Text-Grab.csproj -c Release -p:EnableWindowsTargeting=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Extend the Fullscreen grab settings page to be able to set the options for each post grab action default as: off, last used, on


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Extend fullscreen grab settings for post grab actions Add configurable defaults for post-grab actions in Fullscreen Grab Jan 11, 2026
Copilot AI requested a review from TheJoeFin January 11, 2026 06:24
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