Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(developer): introduce WelcomeFile property to packages 🎺 #9709

Merged

Conversation

mcdurdin
Copy link
Member

@mcdurdin mcdurdin commented Oct 8, 2023

Fixes #9478.

This adds a property WelcomeFile to .kps and kmp.json, which allows us to move away from the hardcoded welcome.htm filename in the future, and makes transform from Markdown (#9477) a simpler operation, and just generally starts the cleanup of the messiness of hard-coded filenames.

The package compiler will fallback to injecting welcome.htm into this property if (a) welcome.htm is present, and (b) the property does not already have a value. This doesn't buy us much because we still need to support welcome.htm for existing legacy packages, but does mean that our .kmp package metadata will be more consistent for packages compiled with 17.0+ compilers.

User Testing

Note: Keyman itself on all platforms still only supports the welcome.htm filename at this time, so do not expect documentation with arbitrary filenames to be visible in the client apps.

TEST_WELCOME_FILE: In the package editor in Keyman Developer, select a welcome.htm file in the new Documentation file field. Compile the package and verify that there are no errors. Add and remove the reference to the documentation file and verify that the field behaves as you would expect.

Fixes #9478.

This adds a property WelcomeFile to .kps and kmp.json, which allows us
to move away from the hardcoded welcome.htm filename in the future, and
makes transform from Markdown (#9477) a simpler operation, and just
generally starts the cleanup of the messiness of hard-coded filenames.

The package compiler will fallback to injecting welcome.htm into this
property if (a) welcome.htm is present, and (b) the property does not
already have a value. This doesn't buy us much because we still need to
support welcome.htm for existing legacy packages, but does mean that
our .kmp package metadata will be more consistent for packages compiled
with 17.0+ compilers.
@keymanapp-test-bot keymanapp-test-bot bot added has-user-test user-test-required User tests have not been completed labels Oct 8, 2023
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Oct 8, 2023

User Test Results

Test specification and instructions

  • TEST_WELCOME_FILE (PASSED): Retested as per Marc's suggestion and here is my observation: 1. Opened Khmer_Angkor keyboard project. 2. Opened the Package Editor. Run compile keyboard. Verified that there were no errors in the console window. 3. Added Welcome.htm file in the 'Welcome file' documentation field. Run compile keyboard. Did not find any error message. 4. Removed the Welcome.htm file from the documentation field. Run compile keyboard. Did not see any error message. Seems to be working as expected. (notes)

Test Artifacts

@keymanapp-test-bot keymanapp-test-bot bot changed the title feat(developer): introduce WelcomeFile property to packages feat(developer): introduce WelcomeFile property to packages 🎺 Oct 8, 2023
@keymanapp-test-bot keymanapp-test-bot bot added this to the A17S23 milestone Oct 8, 2023
@mcdurdin mcdurdin marked this pull request as ready for review October 8, 2023 07:19
@@ -697,16 +708,23 @@ procedure TPackageOptions.LicenseRemoved(Sender: TObject; EventType: TPackageNot
FLicenseFile := nil;
end;

procedure TPackageOptions.WelcomeRemoved(Sender: TObject; EventType: TPackageNotifyEventType; var FAllow: Boolean);
Copy link
Contributor

Choose a reason for hiding this comment

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

How doe the FAllow boolean fit in with these procedures?

Copy link
Member Author

Choose a reason for hiding this comment

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

The FAllow var parameter is an output parameter, allowing the function to prevent the removal of the item, which we never need to do, so it's safely ignored.

@bharanidharanj
Copy link

Test Results

  • TEST_WELCOME_FILE (PASSED): Tested with the attached Keyman Developer 17.0.187-alpha-test-9709 in Windows 10 OS and here is my observation: 1. Opened khmer_angkor keyboard project. 2. Opened the welcome.htm file in the documentation file field. In the package editor, compiled the package and verified that there were no errors. 3. Removed the reference to the documentation file and verified that there were no errors after the compilation. Seems to be working as expected.

..with reference file in welcome.htm after compiling the package

..without reference file in welcome.htm after compiling the package

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Oct 9, 2023
@mcdurdin
Copy link
Member Author

mcdurdin commented Oct 9, 2023

@bharanidharanj I think perhaps my test steps were not very clear, sorry!

There is a new field in the Package Editor, called "Documentation File", in the Details tab, which we need to test. I don't have an image handy sorry as my machine is on a different branch, but it should be at the top of the "Optional Information" section of the tab, above the "Readme file" entry.

Would you mind re-testing? Thanks so much!

@keymanapp-test-bot retest

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-required User tests have not been completed label Oct 9, 2023
@bharanidharanj
Copy link

@bharanidharanj I think perhaps my test steps were not very clear, sorry!

There is a new field in the Package Editor, called "Documentation File", in the Details tab, which we need to test. I don't have an image handy sorry as my machine is on a different branch, but it should be at the top of the "Optional Information" section of the tab, above the "Readme file" entry.

Would you mind re-testing? Thanks so much!

@keymanapp-test-bot retest

@mcdurdin Thank you so much for your clarification! I will retest and add my post my results.

@bharanidharanj
Copy link

Test Results

  • TEST_WELCOME_FILE (PASSED): Retested as per Marc's suggestion and here is my observation: 1. Opened Khmer_Angkor keyboard project. 2. Opened the Package Editor. Run compile keyboard. Verified that there were no errors in the console window. 3. Added Welcome.htm file in the 'Welcome file' documentation field. Run compile keyboard. Did not find any error message. 4. Removed the Welcome.htm file from the documentation field. Run compile keyboard. Did not see any error message. Seems to be working as expected.

..Added welcome.htm file in the 'Welcome file' documentation field

..Removed welcome.htm file in the 'Welcome file' documentation field

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Oct 9, 2023
Copy link
Contributor

@rc-swag rc-swag left a comment

Choose a reason for hiding this comment

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

lgtm

Base automatically changed from chore/common/types-for-schemas to epic/package-metadata October 11, 2023 00:18
@mcdurdin mcdurdin merged commit 7585a11 into epic/package-metadata Oct 11, 2023
3 checks passed
@mcdurdin mcdurdin deleted the feat/developer/9478-welcome-file-property branch October 11, 2023 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(developer): package file format should include Options.WelcomeFile 🎺
3 participants