-
Notifications
You must be signed in to change notification settings - Fork 0
OUT-4014 | Capitalize actionLabel verb usage #225
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
Merged
arpandhakal
merged 1 commit into
feature/studio-apps-action
from
arpandhakal/out-4014-capitalize-actionlabel-verb-usage
Jul 29, 2026
+61
−1
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import type { ActionableInstallDto } from '@installed-apps/installed-apps.dto' | ||
| import { capitalizeVerb, toDynamicActionDefinition } from '@installed-apps/lib/dynamic-action' | ||
| import { describe, expect, it } from 'vitest' | ||
|
|
||
| const createActionableInstall = (verb: string): ActionableInstallDto => ({ | ||
| installId: 'install_1', | ||
| appId: 'app_1', | ||
| displayName: 'Docs', | ||
| icon: 'CustomApps', | ||
| actionLabel: { verb, singularNoun: 'document', pluralNoun: 'documents' }, | ||
| }) | ||
|
|
||
| describe('capitalizeVerb', () => { | ||
| it('capitalizes a lowercase verb', () => { | ||
| expect(capitalizeVerb('review')).toBe('Review') | ||
| }) | ||
|
|
||
| it('normalizes inconsistent inner casing', () => { | ||
| expect(capitalizeVerb('reView')).toBe('Review') | ||
| }) | ||
|
|
||
| it('normalizes an all-caps verb', () => { | ||
| expect(capitalizeVerb('REVIEW')).toBe('Review') | ||
| }) | ||
|
|
||
| it('leaves an already-capitalized verb unchanged', () => { | ||
| expect(capitalizeVerb('Review')).toBe('Review') | ||
| }) | ||
|
|
||
| it('capitalizes only the first word of a multi-word verb', () => { | ||
| expect(capitalizeVerb('sign off')).toBe('Sign off') | ||
| }) | ||
|
|
||
| it('trims surrounding whitespace', () => { | ||
| expect(capitalizeVerb(' review ')).toBe('Review') | ||
| }) | ||
|
|
||
| it('returns an empty string for an empty verb', () => { | ||
| expect(capitalizeVerb(' ')).toBe('') | ||
| }) | ||
| }) | ||
|
|
||
| describe('toDynamicActionDefinition', () => { | ||
| it('capitalizes the verb and passes the nouns through verbatim', () => { | ||
| const action = toDynamicActionDefinition(createActionableInstall('reView')) | ||
|
|
||
| expect(action.verb).toBe('Review') | ||
| expect(action.label).toBe('documents') | ||
| expect(action.singularLabel).toBe('document') | ||
| }) | ||
| }) |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a Studio app registers a valid verb with meaningful internal capitalization, such as
eSign,PDF, orlogToCRM, lowercasing the entire suffix producesEsign,Pdf, orLogtocrm, whichActionItemdisplays verbatim as a misspelled action label.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think verb should not be logToCRM or eSign, it should be a valid english verb and we are enforcing it. Dont be stupid @greptile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point — if the builder side enforces valid English verbs, then inputs like
eSignorlogToCRMare invalid by contract and the normalization behavior is correct as written. I'll withdraw the concern.