-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add localized user guide links to popup and inline helper #85
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
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
0c61496
feat: add localized user guide labels
hoangsvit 96789a6
feat: add tracked user guide link
hoangsvit e156a8a
feat: add localized user guide action to popup header
hoangsvit c01b230
test: cover localized user guide labels
hoangsvit 73bb4a6
test: cover user guide tab navigation
hoangsvit 527fba0
chore: prepare inline guide link patch
hoangsvit ef95855
feat: add user guide link to inline popup
github-actions[bot] c40d80d
fix: guard browser locale resolution for user guide
hoangsvit bb89f81
fix: handle user guide navigation failures
hoangsvit 7cb836a
fix: handle popup guide navigation errors
hoangsvit 38f72aa
test: cover user guide navigation fallbacks
hoangsvit 9ba3333
test: cover browser locale resolution for user guide
hoangsvit 9c69c7e
chore: prepare inline guide CSS cleanup
hoangsvit 7387184
style: align inline popup guide action
github-actions[bot] 7bf49f4
chore: add one-shot WXT locale migration
hoangsvit 4e471c2
fix: simplify generated locale coverage test
hoangsvit 73ce83a
chore: prepare WXT locale migration trigger
hoangsvit 88f95c9
chore: keep WXT locale migration ready
hoangsvit 99c4c2d
chore: add one-shot WXT locale migration script
hoangsvit 825c707
fix: simplify WXT locale migration workflow
hoangsvit 5b36146
refactor: use WXT locales for user guide labels
github-actions[bot] 0b81a66
test: document WXT locale coverage callbacks
hoangsvit 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
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
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
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
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 |
|---|---|---|
|
|
@@ -770,5 +770,8 @@ | |
| }, | ||
| "storageError": { | ||
| "message": "기록을 로드할 수 없습니다. 저장소 접근을 확인하세요." | ||
| }, | ||
| "userGuide": { | ||
| "message": "사용자 가이드" | ||
| } | ||
| } | ||
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
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
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 |
|---|---|---|
|
|
@@ -770,5 +770,8 @@ | |
| }, | ||
| "storageError": { | ||
| "message": "无法加载历史记录。请检查存储访问权限。" | ||
| }, | ||
| "userGuide": { | ||
| "message": "用户指南" | ||
| } | ||
| } | ||
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,27 @@ | ||
| export const USER_GUIDE_URL = | ||
| "https://ext.eplus.dev/gmail-alias-toolkit/introduction?utm_source=gmail-alias-toolkit&utm_medium=extension&utm_campaign=user-guide"; | ||
|
|
||
| /** Opens the guide through a regular window when the tabs API is unavailable. */ | ||
| function openUserGuideWindow(): boolean { | ||
| try { | ||
| const openedWindow = globalThis.open?.( | ||
| USER_GUIDE_URL, | ||
| "_blank", | ||
| "noopener,noreferrer", | ||
| ); | ||
| if (openedWindow) openedWindow.opener = null; | ||
| return Boolean(openedWindow); | ||
| } catch { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| /** Opens the public Gmail Alias Toolkit guide with a safe browser fallback. */ | ||
| export async function openUserGuide(): Promise<boolean> { | ||
| try { | ||
| await browser.tabs.create({ url: USER_GUIDE_URL }); | ||
| return true; | ||
| } catch { | ||
| return openUserGuideWindow(); | ||
| } | ||
| } |
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,48 @@ | ||
| import { type Dirent, readdirSync, readFileSync } from "node:fs"; | ||
| import { resolve } from "node:path"; | ||
| import { describe, expect, it } from "vitest"; | ||
|
|
||
| /** Returns whether a locale directory entry is a directory. */ | ||
| function isLocaleDirectory(entry: Dirent): boolean { | ||
| return entry.isDirectory(); | ||
| } | ||
|
|
||
| /** Verifies that every WXT locale defines a non-empty user guide label. */ | ||
| function assertUserGuideMessages(): void { | ||
| const localesRoot = resolve(process.cwd(), "public/_locales"); | ||
| const localeDirectories = readdirSync(localesRoot, { | ||
| withFileTypes: true, | ||
| }).filter(isLocaleDirectory); | ||
|
|
||
| expect(localeDirectories.length).toBeGreaterThan(0); | ||
|
|
||
| for (const locale of localeDirectories) { | ||
| const messagesPath = resolve( | ||
| localesRoot, | ||
| locale.name, | ||
| "messages.json", | ||
| ); | ||
| const messages = JSON.parse(readFileSync(messagesPath, "utf8")) as Record< | ||
| string, | ||
| { message?: unknown } | undefined | ||
| >; | ||
| const userGuideMessage = messages.userGuide?.message; | ||
|
|
||
| expect(messages.userGuide, locale.name).toBeDefined(); | ||
| expect(userGuideMessage, locale.name).toEqual(expect.any(String)); | ||
| expect( | ||
| typeof userGuideMessage === "string" ? userGuideMessage.trim() : "", | ||
| locale.name, | ||
| ).not.toBe(""); | ||
| } | ||
| } | ||
|
|
||
| /** Registers the WXT user guide localization regression test. */ | ||
| function defineUserGuideLocaleSuite(): void { | ||
| it( | ||
| "defines a non-empty userGuide message for every locale", | ||
| assertUserGuideMessages, | ||
| ); | ||
| } | ||
|
|
||
| describe("WXT user guide translations", defineUserGuideLocaleSuite); |
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.
Uh oh!
There was an error while loading. Please reload this page.