-
Notifications
You must be signed in to change notification settings - Fork 5
feat: find symbols by searching the gloss, and enter symbols using svg builder strings #44
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
base: main
Are you sure you want to change the base?
Conversation
Also, add `stream` (`true` or `false`) parameter to `queryChat()` function.
- `CommandTeletgraphicCompletions` is component that calls ollama with a "bag of words" and a prompt to provide sentence completions - Introduced `sentenceCompletionsSignal` that will eventually handle changes to the completions.
- removed all `console.debug()` statements
The palette of found symbols is a collection of cells that permit: - ediingt a label for each symbol - adding the symbol and its label to the input area
…ay decomposition svg builder string
…by-gloss-plus-modifiers
…in the searched-for bci-av id
…e added modifier" - based on suggestion at UX/UI meeting 02-Dec-2025 NOTE: this is hand copied from a commit on the feat/modifiers branch and should ultimately be merged here: affb445
- ISAAC demo branch: feat/find-by-gloss-plus-modifiers
- compromise was part of the ISAAC demo branch: - feat/find-by-gloss-plus-modifiers
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright 2024 Inclusive Design Research Centre, OCAD University | |||
| * Copyright 2024-2025 Inclusive Design Research Centre, OCAD University | |||
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.
Copyright can use 2026 now. :)
| options: BlissSymbolInfoType & LayoutInfoType | ||
| }; | ||
|
|
||
| export function ActionGlossSearchCell (props: ActionGlossSearchCellPropsType): VNode { |
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 just noticed this component doesn't seem to be used anywhere except in its test. Can you double check? Thanks.
| */ | ||
| function indexOfIndicatorSuffix (gloss: string): number { | ||
| let index = -1; | ||
| for (let i = 0; i < INDICATOR_SUFFIXES.length; i++) { |
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.
Regex might be more efficient than a loop:
const suffix_regex = new RegExp(`(${INDICATOR_SUFFIXES.join('|')})$`, 'i');
const match = gloss.match(suffix_regex);
return match ? match.index : -1;
|
|
||
| return html` | ||
| <form onSubmit=${searchGloss} class="actionSearchGloss"> | ||
| <label for=${GLOSS_ENTRY_FIELD_ID} style="color: white;">Search gloss: </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.
The inline style should go into .scss. Moreover, setting color explicitly may affect the auto-adaptation on various browser color theme settings.
|
|
||
| .actionSvgEntryField { | ||
| width: 25rem; | ||
| background: white |
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.
Again, setting background color explicitly may affect the adaptation to browser color theme settings.
| else { | ||
| // If removing a verb indicator, try turning the word back into a "noun" | ||
| // (gerund), e.g. "walk" -> "walking". | ||
| result = doc.verbs().toGerund().text(); |
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.
Why does removing a verb indicator turning the word back to a noun? Shouldn't "to walk" be "walk" now rather than "walking"?
|
|
||
| // Update rows, columns, etc. | ||
| colIndex++; | ||
| if (colIndex > numCols) { |
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.
If numCols is 4, this allows colIndex to be 0, 1, 2, 3, 4. Probably use if (colIndex >= numCols - 1).
| columnSpan: 1 | ||
| } | ||
| }; | ||
| jsonPalette.cells[`${match.label}-${uuidv4()}`] = cell; |
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.
If makeMatchesPalette is called during a re-render, every cell will get a brand new ID with the use of uuidv4(). Every re-render will recreate the cell palette from scratch. What do you think about using bciAvId instead of calling uuidv4() so every cell palette will have a fixed key.
| return html``; | ||
| } | ||
| else if (matches.length === 0) { | ||
| return html`<p style="color: white;">No matches found</p>`; |
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.
Move the inline style into scss. Add a aria-live="polite" and an aria status to announce "No matches found."
| * Create a JsonPaletteType from an array of matches based on a gloss search. | ||
| * | ||
| * @param {Array} glossMatches - Array of Bliss symbol information objects whose | ||
| * glass matches the search term. |
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.
Typo: "glass" -> "gloss".
|
The same issue with the color contrast issue in the browser dark theme as mentioned in the pull request #42. |
|
One concern is about pushing the binary |
npm testwithout errorsnpm run devwithout errorsDescription
This pull request adds two dialogs to the adaptive-palette:
In addition, a palette of matches found is produced for each successful search:
Steps to test
See the "Description" above for how to use the dialogs.