Enhances 'spo page header set' with showTimeToRead#7098
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the spo page header set command by adding a new --showTimeToRead option that allows users to display the estimated reading time on SharePoint pages. Additionally, it improves error handling to provide clearer messages when a page is not found.
Key Changes
- Added
showTimeToReadboolean option to the command interface and implementation - Improved error handling for 404 responses to provide user-friendly error messages
- Updated existing boolean options (
showTopicHeader,showPublishDate) to accept explicit true/false values instead of being presence-only flags - Refactored code style (quote consistency, simplified validation using
includes())
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/m365/spo/commands/page/page-header-set.ts | Added showTimeToRead option, improved error handling for page not found, code style improvements (quotes, array includes), and proper TypeScript typing |
| src/m365/spo/commands/page/page-header-set.spec.ts | Added test coverage for showTimeToRead option, updated all mock data to include the new property, added test for 404 error handling |
| src/m365/spo/commands/page/PageHeader.ts | Added showTimeToRead property to PageHeaderProperties interface |
| docs/docs/cmd/spo/page/page-header-set.mdx | Updated documentation to describe the new showTimeToRead option, improved descriptions for showTopicHeader and showPublishDate to clarify they accept boolean values, added Permissions section, updated example to demonstrate new option |
MartinM85
requested changes
Jan 8, 2026
Contributor
MartinM85
left a comment
There was a problem hiding this comment.
Great work. Only one small comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7097
Remarks
Also updated the code to display a proper error message when the page is not found. The current error was not clear at all.