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

Implement Search as ARIA spec compliant* dialog and combobox pattern #2831

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c53e480
Add css variables for dimensions, and use svh units
phoneticallySAARTHaK Jan 18, 2025
79a9b56
Fix excess/absent margins and padding.
phoneticallySAARTHaK Jan 18, 2025
1df9967
Fix tab order of toolbar and remove unused selectors. **Breaks search**
phoneticallySAARTHaK Jan 19, 2025
3548d14
Add more search related 118n strings, and inject more strings in js s…
phoneticallySAARTHaK Jan 19, 2025
55c0576
Implement search component as combobox, with minimal functionality
phoneticallySAARTHaK Jan 19, 2025
28320e1
Add global keyboard listeners for opening modal
phoneticallySAARTHaK Jan 19, 2025
b0f75ef
rename `setCurrentResult` to `setNextResult`
phoneticallySAARTHaK Jan 19, 2025
f4d4fbd
Use semantic element `mark` for highlighting search matches
phoneticallySAARTHaK Jan 19, 2025
0b58bf5
Add exit animation for modals, using custom overlay
phoneticallySAARTHaK Jan 19, 2025
b2f79de
Remove unused keyframes. Merge `body` selectors
phoneticallySAARTHaK Jan 19, 2025
d687ef6
Adjust max-height with virtual keyboard, in mobiles
phoneticallySAARTHaK Jan 19, 2025
548df5c
fix placeholder text color on focus search input
phoneticallySAARTHaK Jan 19, 2025
a606615
Remove min-height from search dialog and set it to `.state`
phoneticallySAARTHaK Jan 20, 2025
ec6b774
fix single element edge case in `setNextResult`
phoneticallySAARTHaK Jan 20, 2025
1beacfa
Show recent searches when the search query is empty
phoneticallySAARTHaK Jan 20, 2025
4fd690e
Completely revert "recent searches" feature.
phoneticallySAARTHaK Jan 25, 2025
b49240a
Fix typo and refactor search.ts code
phoneticallySAARTHaK Jan 25, 2025
43d91d6
Fix invalid search message implementation
phoneticallySAARTHaK Jan 26, 2025
8a4b5e3
Add placeholder for no_results i18n string
phoneticallySAARTHaK Jan 26, 2025
cccf2d4
remove global button styles and add it to tsd-widget
phoneticallySAARTHaK Jan 26, 2025
28e49c6
Improve text contrast, satisfying WCAG level AA
phoneticallySAARTHaK Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/internationalization/locales/en.cts
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ export = {
theme_generated_using_typedoc: "Generated using TypeDoc", // If this includes "TypeDoc", theme will insert a link at that location.
// Search
theme_preparing_search_index: "Preparing search index...",
theme_search_index_not_available: "The search index is not available",
// Left nav bar
theme_loading: "Loading...",
// Right nav bar
Expand All @@ -522,4 +521,7 @@ export = {
"This member is normally hidden due to your filter settings.",
theme_hierarchy_expand: "Expand",
theme_hierarchy_collapse: "Collapse",
theme_search_index_not_available: "The search index is not available",
theme_search_no_results_found_for_0: "No results found for {0}",
theme_search_placeholder: "Search the docs",
} as const;
6 changes: 6 additions & 0 deletions src/lib/output/plugins/AssetsPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ export class AssetsPlugin extends RendererComponent {
hierarchy_expand: this.application.i18n.theme_hierarchy_expand(),
hierarchy_collapse:
this.application.i18n.theme_hierarchy_collapse(),
theme_search_index_not_available:
this.application.i18n.theme_search_index_not_available(),
theme_search_no_results_found_for_0:
this.application.i18n.theme_search_no_results_found_for_0(
"{0}",
),
};
}

Expand Down
5 changes: 5 additions & 0 deletions src/lib/output/themes/default/assets/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ Object.defineProperty(window, "app", { value: app });
initSearch();
initNav();
initHierarchy();

if ("virtualKeyboard" in navigator) {
// @ts-ignore
Gerrit0 marked this conversation as resolved.
Show resolved Hide resolved
phoneticallySAARTHaK marked this conversation as resolved.
Show resolved Hide resolved
navigator.virtualKeyboard.overlaysContent = true;
}
4 changes: 4 additions & 0 deletions src/lib/output/themes/default/assets/typedoc/Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ declare global {
normally_hidden: string;
hierarchy_expand: string;
hierarchy_collapse: string;
theme_search_index_not_available: string;
theme_search_no_results_found_for_0: string;
};
}
}
Expand All @@ -20,6 +22,8 @@ window.translations ||= {
"This member is normally hidden due to your filter settings.",
hierarchy_expand: "Expand",
hierarchy_collapse: "Collapse",
theme_search_index_not_available: "The search index is not available",
theme_search_no_results_found_for_0: "No results found for {0}",
};

/**
Expand Down
Loading
Loading