PowerShell.tiPS icon indicating copy to clipboard operation
PowerShell.tiPS copied to clipboard

Add AllTipsShownBehaviours to control tip display behavior when all tips have been shown

Open Copilot opened this issue 4 months ago • 10 comments

Adds a new AllTipsShownBehaviours enum that allows users to configure what happens when all tips have been shown - either clear the shown tips list and continue cycling, or stop showing tips automatically.

Changes

C# Enums and Configuration

  • Created new AllTipsShownBehaviours enum in Configuration.cs with values:
    • ClearShownTipsList = 0 (default) - Clears the shown tips list and continues showing all tips in rotation
    • DoNotShowTips = 1 - Stops showing tips automatically when all tips have been shown
  • Added AllTipsShownBehaviour property to the Configuration class

PowerShell Logic

  • Added TestIfUnseenTipsExist function that compares all tip IDs against TipIdsAlreadyShown.txt
  • Updated WriteAutomaticPowerShellTipIfNeeded to check AllTipsShownBehaviour after cadence evaluation
  • Added AllTipsShownBehaviour parameter to Set-TiPSConfiguration with updated help text and examples

Documentation

  • Updated ReadMe.md with a new "Show only unseen tips" subsection under "🤖 Automatic tip on PowerShell startup"
  • Added example showing how to configure the DoNotShowTips option
  • Documented available parameter values and behavior

Tests

  • Added tests for DoNotShowTips option behavior (shows tip when unseen tips exist, skips when all shown)
  • Added tests for TestIfUnseenTipsExist helper function

Design

This approach separates two orthogonal concerns:

  • Cadence (Never, EverySession, Daily, Weekly, Biweekly, Monthly) controls when to show tips
  • Behaviour (ClearShownTipsList, DoNotShowTips) controls what happens when all tips have been shown

This allows users to combine any cadence with the all-tips-shown behavior for maximum flexibility.

Usage

# Show tips daily, but stop showing them when all tips have been shown
Set-TiPSConfiguration -AutomaticallyWritePowerShellTip Daily -AllTipsShownBehaviour DoNotShowTips

# Show tips every session, clearing the shown tips list when all have been shown (default behavior)
Set-TiPSConfiguration -AutomaticallyWritePowerShellTip EverySession -AllTipsShownBehaviour ClearShownTipsList
  • Fixes deadlydog/PowerShell.tiPS#152
Original prompt

This section details on the original issue you should resolve

<issue_title>Feature Request: Only display tip automatically when there is an unseen tip</issue_title> <issue_description>We currently track all of the tips that have been shown in the TipIdsAlreadyShown.txt file. We want to add a new 'NewTipsOnlyvalue to theWritePowerShellTipCadenceenum, and when configured to use this setting, have the module only automatically display a tip if it is not already in the TipIdsAlreadyShown.txt` file.</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes deadlydog/PowerShell.tiPS#152

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

Copilot avatar Oct 25 '25 00:10 Copilot

Overall Project 91.35% :green_apple:

There is no coverage information present for the Files changed

github-actions[bot] avatar Oct 27 '25 20:10 github-actions[bot]

Overall Project 91.35% :green_apple:

There is no coverage information present for the Files changed

github-actions[bot] avatar Oct 27 '25 20:10 github-actions[bot]

@copilot Also update the ReadMe.md to show an example of setting the AutoWritePowerShellTipOptions to OnlyShowUnseenTips.

deadlydog avatar Oct 28 '25 00:10 deadlydog

Overall Project 91.21% :green_apple:

There is no coverage information present for the Files changed

github-actions[bot] avatar Oct 28 '25 00:10 github-actions[bot]

Overall Project 91.21% :green_apple:

There is no coverage information present for the Files changed

github-actions[bot] avatar Oct 28 '25 00:10 github-actions[bot]

@copilot Also update the ReadMe.md to show an example of setting the AutoWritePowerShellTipOptions to OnlyShowUnseenTips.

Added in commit 3a7dbf2.

Created a new subsection "Show only unseen tips" under the "🤖 Automatic tip on PowerShell startup" section with an example showing how to use the OnlyWriteUnseenTips option:

Set-TiPSConfiguration -AutomaticallyWritePowerShellTip Daily -AutomaticallyWritePowerShellTipOption OnlyWriteUnseenTips

The section also explains the available values and behavior of the option.

Copilot avatar Oct 28 '25 00:10 Copilot

Overall Project 91.21% :green_apple:

There is no coverage information present for the Files changed

github-actions[bot] avatar Oct 28 '25 00:10 github-actions[bot]

Overall Project 91.21% :green_apple:

There is no coverage information present for the Files changed

github-actions[bot] avatar Oct 28 '25 00:10 github-actions[bot]

Overall Project 91.21% :green_apple:

There is no coverage information present for the Files changed

github-actions[bot] avatar Oct 28 '25 01:10 github-actions[bot]

Overall Project 91.21% :green_apple:

There is no coverage information present for the Files changed

github-actions[bot] avatar Oct 28 '25 01:10 github-actions[bot]