Skip to content

Commit f8c427d

Browse files
gtryusGreg Trihus
authored andcommitted
TT-7152 Implement Graphic Image Filter and Picker components (#219)
This PR introduces a Bible Image Library Graphic Picker feature that allows users to search, filter, and select graphic images from an external API, alongside custom uploads and viewing the current graphic. It refactors the compression logic out of GraphicUploader into a reusable useCompression hook and adds new utilities for URL parsing, file conversion, and reference filtering. Changes: - New GraphicPicker dialog component with three tabs (Library/Custom/Current) integrating search, filter (by style/keyword/scripture reference), and image selection from a Bible Image Library API. - Refactored image compression logic from GraphicUploader into a shared useCompression hook, with supporting utilities (blobToBase64, urlToFile, getUrlNameAndExt, getRefFilter). - Updated ScriptureTable to use the new GraphicPicker instead of GraphicUploader directly, with enhanced reference string computation for different passage types.
1 parent ffc1710 commit f8c427d

33 files changed

+2292
-167
lines changed

localization/TranscriberAdmin-en-1.2.xliff

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,6 +2964,76 @@
29642964
<context context-type="sourcefile">findResource.tsx</context>
29652965
</context-group>
29662966
</trans-unit>
2967+
<trans-unit id="graphic.graphicSearch">
2968+
<source>Search graphics</source>
2969+
<target/>
2970+
<context-group>
2971+
<context context-type="sourcefile">GraphicPicker.tsx</context>
2972+
</context-group>
2973+
</trans-unit>
2974+
<trans-unit id="graphic.graphicSource">
2975+
<source>graphic source tabs</source>
2976+
<target/>
2977+
<context-group>
2978+
<context context-type="sourcefile">GraphicPicker.tsx</context>
2979+
</context-group>
2980+
</trans-unit>
2981+
<trans-unit id="graphic.loadFailure">
2982+
<source>Failed to load</source>
2983+
<target/>
2984+
<context-group>
2985+
<context context-type="sourcefile">GraphicPicker.tsx</context>
2986+
</context-group>
2987+
</trans-unit>
2988+
<trans-unit id="graphic.noSelection">
2989+
<source>no {0} selected.</source>
2990+
<target/>
2991+
<context-group>
2992+
<context context-type="sourcefile">GraphicPicker.tsx</context>
2993+
</context-group>
2994+
</trans-unit>
2995+
<trans-unit id="graphic.placeHolder">
2996+
<source>title and keyword search words</source>
2997+
<target/>
2998+
<context-group>
2999+
<context context-type="sourcefile">shapingTable.tsx</context>
3000+
</context-group>
3001+
</trans-unit>
3002+
<trans-unit id="graphic.setGraphic">
3003+
<source>Set as Graphic</source>
3004+
<target/>
3005+
<context-group>
3006+
<context context-type="sourcefile">shapingTable.tsx</context>
3007+
</context-group>
3008+
</trans-unit>
3009+
<trans-unit id="graphic.tabCurrent">
3010+
<source>Current</source>
3011+
<target/>
3012+
<context-group>
3013+
<context context-type="sourcefile">shapingTable.tsx</context>
3014+
</context-group>
3015+
</trans-unit>
3016+
<trans-unit id="graphic.tabCustom">
3017+
<source>Custom</source>
3018+
<target/>
3019+
<context-group>
3020+
<context context-type="sourcefile">shapingTable.tsx</context>
3021+
</context-group>
3022+
</trans-unit>
3023+
<trans-unit id="graphic.tabBible">
3024+
<source>Library</source>
3025+
<target/>
3026+
<context-group>
3027+
<context context-type="sourcefile">shapingTable.tsx</context>
3028+
</context-group>
3029+
</trans-unit>
3030+
<trans-unit id="graphic.title">
3031+
<source>Graphic Picker</source>
3032+
<target/>
3033+
<context-group>
3034+
<context context-type="sourcefile">shapingTable.tsx</context>
3035+
</context-group>
3036+
</trans-unit>
29673037
<trans-unit id="grid.all">
29683038
<source>All</source>
29693039
<target/>

localization/TranscriberAdmin-en.xlf

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,6 +2542,66 @@
25422542
<target/>
25432543
</segment>
25442544
</unit>
2545+
<unit id="graphic.graphicSearch">
2546+
<segment>
2547+
<source>Search graphics</source>
2548+
<target/>
2549+
</segment>
2550+
</unit>
2551+
<unit id="graphic.graphicSource">
2552+
<segment>
2553+
<source>graphic source tabs</source>
2554+
<target/>
2555+
</segment>
2556+
</unit>
2557+
<unit id="graphic.loadFailure">
2558+
<segment>
2559+
<source>Failed to load</source>
2560+
<target/>
2561+
</segment>
2562+
</unit>
2563+
<unit id="graphic.noSelection">
2564+
<segment>
2565+
<source>no {0} selected.</source>
2566+
<target/>
2567+
</segment>
2568+
</unit>
2569+
<unit id="graphic.placeHolder">
2570+
<segment>
2571+
<source>title and keyword search words</source>
2572+
<target/>
2573+
</segment>
2574+
</unit>
2575+
<unit id="graphic.setGraphic">
2576+
<segment>
2577+
<source>Set as Graphic</source>
2578+
<target/>
2579+
</segment>
2580+
</unit>
2581+
<unit id="graphic.tabCurrent">
2582+
<segment>
2583+
<source>Current</source>
2584+
<target/>
2585+
</segment>
2586+
</unit>
2587+
<unit id="graphic.tabCustom">
2588+
<segment>
2589+
<source>Custom</source>
2590+
<target/>
2591+
</segment>
2592+
</unit>
2593+
<unit id="graphic.tabBible">
2594+
<segment>
2595+
<source>Library</source>
2596+
<target/>
2597+
</segment>
2598+
</unit>
2599+
<unit id="graphic.title">
2600+
<segment>
2601+
<source>Graphic Picker</source>
2602+
<target/>
2603+
</segment>
2604+
</unit>
25452605
<unit id="grid.all">
25462606
<segment>
25472607
<source>All</source>

src/renderer/api-variable.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ export const API_CONFIG = {
3636
snagId: import.meta.env.VITE_SNAGID ?? '',
3737
videoTraining: import.meta.env.VITE_VIDEO_TRAINING ?? '',
3838
walkThru: import.meta.env.VITE_WALK_THRU ?? '',
39+
graphicApiBase: import.meta.env.VITE_GRAPHIC_API_BASE ?? '',
3940
};

src/renderer/public/localization/strings55edbf96.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/renderer/public/localization/stringsdc512b29.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

src/renderer/src/burrito/useBurritoNavigation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
ApmDim,
2929
CompressedImages,
3030
IGraphicInfo,
31-
} from '../components/GraphicUploader';
31+
} from '../utils/useCompression';
3232
import { MainAPI } from '@model/main-api';
3333
import { RecordKeyMap } from '@orbit/records';
3434
import {

0 commit comments

Comments
 (0)