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

[Chore] Review theme colors #131

Merged
merged 44 commits into from
Dec 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
921bec0
chore: update onSecondaryContainer color - add shadow color,
a-ghorbani Dec 7, 2024
1411c73
chore: update SwipeableRow style
a-ghorbani Dec 7, 2024
c95f84d
chore: clean up SidebarContent code
a-ghorbani Dec 7, 2024
8b4c935
chore: add inverseSecondary to theme color
a-ghorbani Dec 7, 2024
943f86c
chore: update mem usage stat plot color (use red)
a-ghorbani Dec 7, 2024
db718d3
chore: update ModelNotLoadedMessage action color
a-ghorbani Dec 7, 2024
77a3f72
chore: update pleaseLoadModel text
a-ghorbani Dec 7, 2024
c0a1b52
chore: replace empty message text with pocketpal's icon
a-ghorbani Dec 7, 2024
5dd8daf
chore: add divider component
a-ghorbani Dec 8, 2024
d9fe1b6
chore: refactor the style of models screen
a-ghorbani Dec 8, 2024
680be2b
feat: group models by ready to use and available to download (when un…
a-ghorbani Dec 8, 2024
60ea57c
feat: add description to Available to download group in models screen
a-ghorbani Dec 8, 2024
7c9001a
feat: refactoring generation/model settings ui - incomplete
a-ghorbani Dec 8, 2024
c687611
chore: add chevron to settings button
a-ghorbani Dec 8, 2024
4dab483
chore: adjust model settings view actions buttons
a-ghorbani Dec 8, 2024
49571c3
chore: refactor model settings styles
a-ghorbani Dec 8, 2024
e6d376f
chore: update generation settings style
a-ghorbani Dec 8, 2024
598e94f
chore: update generation settings' style
a-ghorbani Dec 8, 2024
21859c8
fix: correct ref forwarding for TextInput
a-ghorbani Dec 9, 2024
c487315
chore: update ChatTemplatePicker style
a-ghorbani Dec 9, 2024
30313cc
chore: update chat template picker style
a-ghorbani Dec 9, 2024
402e378
feat: model and generation settings are changed only if saved
a-ghorbani Dec 9, 2024
68ad1bf
chore: update TextInput to support error messages
a-ghorbani Dec 9, 2024
010b5ee
feat: add completion settings validation
a-ghorbani Dec 9, 2024
70fb91c
fix: use textSeconday for dateHeader in the chat bubble
a-ghorbani Dec 9, 2024
9b09138
chore: refactor completion settings
a-ghorbani Dec 9, 2024
f70eeb9
chore: remove n_probs from the ui
a-ghorbani Dec 9, 2024
7236aa7
chore: update completion settings desc
a-ghorbani Dec 9, 2024
c95fb1b
fix: increase temp max value
a-ghorbani Dec 9, 2024
4f8d0b4
chore: update tests
a-ghorbani Dec 10, 2024
af859b4
chore: add scrollable param to dialog
a-ghorbani Dec 10, 2024
49c3732
chore: use scrollable in modelcard re settings dialog
a-ghorbani Dec 10, 2024
a38b94a
fix: adjust heights for the chat template picker
a-ghorbani Dec 10, 2024
c24ac66
fix: align settings button chevron in android devices
a-ghorbani Dec 10, 2024
c04b8c1
fix: dialog keyboard avoiding: only adjust if input is actually cover…
a-ghorbani Dec 10, 2024
873d08a
fix: dialog: apply bottom for keyboard avoding to the content
a-ghorbani Dec 10, 2024
a975878
fix: make settings modal also keyboard avoiding
a-ghorbani Dec 10, 2024
ee182f6
fix: make chat template dialog keyboard avoiding
a-ghorbani Dec 10, 2024
1fd8ac1
fix: moveScrollToDown in models screen is no longer needed
a-ghorbani Dec 10, 2024
fd9aa5a
chore: add inverseTextSecondary to the theme
a-ghorbani Dec 10, 2024
7e412a7
chore: update settings screen theme
a-ghorbani Dec 10, 2024
57e374c
chore: skip "opens and closes the template dialog" as it fails in ci
a-ghorbani Dec 10, 2024
da266fd
fix: update background and surface for dark mode
a-ghorbani Dec 10, 2024
e7022c3
chore: update background and surface for the dark mode
a-ghorbani Dec 10, 2024
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
Prev Previous commit
Next Next commit
feat: add description to Available to download group in models screen
  • Loading branch information
a-ghorbani committed Dec 8, 2024
commit 60ea57ced27253a27bfc8d40164ce3a4b89d8724
5 changes: 4 additions & 1 deletion src/screens/ModelsScreen/ModelAccordion/ModelAccordion.tsx
Original file line number Diff line number Diff line change
@@ -15,10 +15,11 @@ interface ModelAccordionProps {
expanded: boolean;
onPress: () => void;
children: React.ReactNode;
description?: string;
}

export const ModelAccordion: React.FC<ModelAccordionProps> = observer(
({group, expanded, onPress, children}) => {
({group, expanded, onPress, children, description}) => {
const {colors} = useTheme();
const activeModel = modelStore.activeModel;
const activeGroup = activeModel && activeModel.type === group.type;
@@ -39,6 +40,8 @@ export const ModelAccordion: React.FC<ModelAccordionProps> = observer(
styles.accordionTitle,
{color: colors.secondary},
])}
description={description}
descriptionStyle={styles.accordionDescription}
expanded={expanded}
onPress={onPress}
style={accordionStyles}>
4 changes: 4 additions & 0 deletions src/screens/ModelsScreen/ModelAccordion/styles.ts
Original file line number Diff line number Diff line change
@@ -8,4 +8,8 @@ export const styles = StyleSheet.create({
accordionTitle: {
fontSize: 14,
},
accordionDescription: {
fontSize: 12,
paddingBottom: 10,
},
});
6 changes: 6 additions & 0 deletions src/screens/ModelsScreen/ModelsScreen.tsx
Original file line number Diff line number Diff line change
@@ -195,10 +195,16 @@ export const ModelsScreen: React.FC = observer(() => {
const displayName = filters.includes('grouped')
? group.type
: getGroupDisplayName(group.type);
const description =
!filters.includes('grouped') &&
group.type === UIStore.GROUP_KEYS.AVAILABLE_TO_DOWNLOAD
? l10n.useAddButtonForMore
: undefined;
return (
<ModelAccordion
group={{...group, type: displayName}}
expanded={isExpanded}
description={description}
onPress={() => toggleGroup(group.type)}>
<FlatList
data={group.items}
2 changes: 1 addition & 1 deletion src/store/UIStore.ts
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ export class UIStore {

pageStates = {
modelsScreen: {
filters: ['grouped'],
filters: [] as string[],
expandedGroups: {
[UIStore.GROUP_KEYS.READY_TO_USE]: true,
},
10 changes: 6 additions & 4 deletions src/store/__tests__/UIStore.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {uiStore} from '../UIStore';
import {UIStore, uiStore} from '../UIStore';

jest.mock('react-native/Libraries/Utilities/Appearance', () => ({
getColorScheme: jest.fn(() => 'light'),
@@ -9,14 +9,16 @@ describe('UIStore', () => {
uiStore.setColorScheme('light');
uiStore.setAutoNavigateToChat(true);
uiStore.setDisplayMemUsage(false);
uiStore.setValue('modelsScreen', 'filters', ['grouped']);
uiStore.setValue('modelsScreen', 'filters', []);
});

it('should initialize with default values', () => {
expect(uiStore.pageStates).toEqual({
modelsScreen: {
filters: ['grouped'],
expandedGroups: {},
filters: [],
expandedGroups: {
[UIStore.GROUP_KEYS.READY_TO_USE]: true,
},
},
});
expect(uiStore.autoNavigatetoChat).toBe(true);
11 changes: 10 additions & 1 deletion src/utils/l10n.ts
Original file line number Diff line number Diff line change
@@ -70,6 +70,7 @@ export const l10n = {
'Allow downloads to continue in the background (it will be slower).',
availableToUse: 'Ready to Use',
availableToDownload: 'Available to Download',
useAddButtonForMore: 'Use + button to find more models',
},
es: {
attachmentButtonAccessibilityLabel: 'Enviar multimedia',
@@ -146,6 +147,7 @@ export const l10n = {
'Permitir que las descargas continúen en segundo plano (será más lento).',
availableToUse: 'Listo para Usar',
availableToDownload: 'Disponible para Descargar',
useAddButtonForMore: 'Use el botón + para encontrar más modelos',
},
ko: {
attachmentButtonAccessibilityLabel: '미디어 보내기',
@@ -218,6 +220,7 @@ export const l10n = {
'백그라운드에서 다운로드가 계속되도록 허용합니다 (속도가 느려질 수 있습니다).',
availableToUse: '사용 준비 완료',
availableToDownload: '다운로드 가능',
useAddButtonForMore: '+ 버튼을 사용하여 더 많은 모델 찾기',
},
pl: {
attachmentButtonAccessibilityLabel: 'Wyślij multimedia',
@@ -290,6 +293,7 @@ export const l10n = {
'Zezwól na kontynuowanie pobierania w tle (będzie wolniejsze).',
availableToUse: 'Gotowy do Użycia',
availableToDownload: 'Dostępny do Pobrania',
useAddButtonForMore: 'Użyj przycisku +, aby znaleźć więcej modeli',
},
pt: {
attachmentButtonAccessibilityLabel: 'Envia mídia',
@@ -362,6 +366,7 @@ export const l10n = {
'Permitir que os downloads continuem em segundo plano (será mais lento).',
availableToUse: 'Pronto para Usar',
availableToDownload: 'Disponível para Baixar',
useAddButtonForMore: 'Use o botão + para encontrar mais modelos',
},
ru: {
attachmentButtonAccessibilityLabel: 'Отправить медиа',
@@ -403,7 +408,7 @@ export const l10n = {
proceedWithReset: 'Продолжить сброс',
confirmReset: 'Подтвердить сброс',
modelSettingsTitle: 'Конфигурация модели',
autoOffloadLoad: 'Автомати��еское выгрузка/загрузка',
autoOffloadLoad: 'Автоматическое выгрузка/загрузка',
autoOffloadLoadDescription:
'Выгрузить модель, когда приложение находится в фоне.',
metal: 'Metal',
@@ -438,6 +443,7 @@ export const l10n = {
'Разрешить загрузки в фоновом режиме (это будет медленнее).',
availableToUse: 'Готов к Использованию',
availableToDownload: 'Доступен для Скачивания',
useAddButtonForMore: 'Используйте кнопку + для поиска моделей',
},
tr: {
attachmentButtonAccessibilityLabel: 'Medya gönder',
@@ -510,6 +516,7 @@ export const l10n = {
'İndirmelerin arka planda devam etmesine izin verin (daha yavaş olacaktır).',
availableToUse: 'Kullanıma Hazır',
availableToDownload: 'İndirilebilir',
useAddButtonForMore: 'Daha fazla model bulmak için + düğmesini kullanın',
},
uk: {
attachmentButtonAccessibilityLabel: 'Надіслати медіа',
@@ -586,6 +593,7 @@ export const l10n = {
'Дозволити завантаження у фоновому режимі (це буде повільніше).',
availableToUse: 'Готовий до Використання',
availableToDownload: 'Доступний для Завантаження',
useAddButtonForMore: 'Використовуйте кнопку + для пошуку моделей',
},
ca: {
attachmentButtonAccessibilityLabel: 'Enviar multimèdia',
@@ -661,5 +669,6 @@ export const l10n = {
'Permet que les descàrregues continuïn en segon pla (serà més lent).',
availableToUse: 'Llest per Usar',
availableToDownload: 'Disponible per Descarregar',
useAddButtonForMore: 'Utilitzeu el botó + per trobar més models',
},
};