Skip to content

Commit

Permalink
Merge pull request #121 from PasteBar/exclude-apps-copy-to-history
Browse files Browse the repository at this point in the history
Exclude source app list for copied item in clipboard history
  • Loading branch information
kurdin authored Aug 4, 2024
2 parents 2b981dd + 0cb482d commit 55d1ca3
Show file tree
Hide file tree
Showing 31 changed files with 717 additions and 179 deletions.
9 changes: 9 additions & 0 deletions .changeset/four-emus-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'pastebar-app-ui': patch
---

Added excluded apps list in clipboard settings
Added copied item source app hover indicator on history item
Added "Exclude Source App and Delete" option in history item context menu
Added "Add to Filter by Source App" option in history item context menu
Added new source app filter in history filters
3 changes: 3 additions & 0 deletions migrations/2023-08-05-230732_seeds/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ VALUES ('historyDetectLanguagesEnabledList', 'javascript,css,jsx,json,rust,html,
INSERT INTO settings (name, value_text, value_bool, value_int)
VALUES ('isExclusionListEnabled', NULL, false, NULL);

INSERT INTO settings (name, value_text, value_bool, value_int)
VALUES ('isExclusionAppListEnabled', NULL, false, NULL);

INSERT INTO settings (name, value_text, value_bool, value_int)
VALUES ('historyExclusionList', '', NULL, NULL);

Expand Down
1 change: 0 additions & 1 deletion migrations/2024-06-29-010924_add_history_options/down.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-- Rollback for clipboard_history table
CREATE TABLE clipboard_history_new (
history_id VARCHAR(50) PRIMARY KEY NOT NULL,
title VARCHAR(255),
Expand Down
2 changes: 1 addition & 1 deletion migrations/2024-06-29-010924_add_history_options/up.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-- Adding new column to items table
-- Adding new column to clipboard_history table
ALTER TABLE clipboard_history ADD COLUMN history_options TEXT;
49 changes: 49 additions & 0 deletions migrations/2024-07-30-220029_adding_copied_from_app/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
-- down.sql
CREATE TABLE clipboard_history_new (
history_id VARCHAR(50) PRIMARY KEY NOT NULL,
title VARCHAR(255),
value VARCHAR(255),
value_preview VARCHAR(150),
value_more_preview_lines INT DEFAULT 0,
value_more_preview_chars INT DEFAULT 0,
value_hash VARCHAR(255),
is_image BOOLEAN DEFAULT FALSE,
image_path_full_res VARCHAR(255),
image_data_low_res BLOB,
image_preview_height INT DEFAULT 0,
image_height INT DEFAULT 0,
image_width INT DEFAULT 0,
image_data_url VARCHAR(255),
image_hash VARCHAR(255),
is_image_data BOOLEAN DEFAULT FALSE,
is_masked BOOLEAN DEFAULT FALSE,
is_text BOOLEAN DEFAULT FALSE,
is_code BOOLEAN DEFAULT FALSE,
is_link BOOLEAN DEFAULT FALSE,
is_video BOOLEAN DEFAULT FALSE,
has_emoji BOOLEAN DEFAULT FALSE,
has_masked_words BOOLEAN DEFAULT FALSE,
is_pinned BOOLEAN DEFAULT FALSE,
is_favorite BOOLEAN DEFAULT FALSE,
links TEXT,
detected_language VARCHAR(20),
pinned_order_number INT DEFAULT 0,
created_at BIGINT NOT NULL,
updated_at BIGINT NOT NULL,
created_date TIMESTAMP NOT NULL,
updated_date TIMESTAMP NOT NULL,
history_options TEXT
);

INSERT INTO clipboard_history_new SELECT
history_id, title, value, value_preview, value_more_preview_lines,
value_more_preview_chars, value_hash, is_image, image_path_full_res,
image_data_low_res, image_preview_height, image_height, image_width,
image_data_url, image_hash, is_image_data, is_masked, is_text, is_code,
is_link, is_video, has_emoji, has_masked_words, is_pinned, is_favorite,
links, detected_language, pinned_order_number, created_at, updated_at,
created_date, updated_date, history_options
FROM clipboard_history;

DROP TABLE clipboard_history;
ALTER TABLE clipboard_history_new RENAME TO clipboard_history;
3 changes: 3 additions & 0 deletions migrations/2024-07-30-220029_adding_copied_from_app/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

-- Adding new column to clipboard_history table
ALTER TABLE clipboard_history ADD COLUMN copied_from_app VARCHAR(255);
2 changes: 2 additions & 0 deletions packages/pastebar-app-ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ function App() {
settings.isHistoryDetectLanguageEnabled?.valueBool,
historyDetectLanguageMinLines: settings.historyDetectLanguageMinLines?.valueInt,
historyExclusionList: settings.historyExclusionList?.valueText,
historyExclusionAppList: settings.historyExclusionAppList?.valueText,
isExclusionListEnabled: settings.isExclusionListEnabled?.valueBool,
isExclusionAppListEnabled: settings.isExclusionAppListEnabled?.valueBool,
isAutoMaskWordsListEnabled: settings.isAutoMaskWordsListEnabled?.valueBool,
autoMaskWordsList: settings.autoMaskWordsList?.valueText,
historyDetectLanguagesPrioritizedList:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,12 @@ export function useFindClipboardHistory({
query = '',
filters = [],
codeFilters = [],
appFilters = [],
}: {
query?: string
filters?: string[]
codeFilters?: string[]
appFilters?: string[]
}) {
const queryClient = useQueryClient()
const {
Expand All @@ -253,6 +255,7 @@ export function useFindClipboardHistory({
query,
filters,
codeFilters,
appFilters,
useQueryOptions: {
enabled: false,
refetchOnWindowFocus: false,
Expand Down
1 change: 1 addition & 0 deletions packages/pastebar-app-ui/src/locales/lang/en/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ Set: Set
Set Password: Set Password
Show Large View: Show Large View
Show all: Show all
Source: Source
Split History Window: Split History Window
Star: Star
Star Selected: Star Selected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Add Tab: Add Tab
Add to: Add to
Add to Menu: Add to Menu
AddTo:
Add to Exclude and Delete: Add to Exclude and Delete
Add to Filter by Source: Add to Filter by Source
Add to Ignore: Add to Ignore
Clip on Board: Clip on Board
Paste Menu: Paste Menu
After: After
Expand Down
4 changes: 4 additions & 0 deletions packages/pastebar-app-ui/src/locales/lang/en/history.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Do you really want to remove ALL clipboard history items?: Do you really want to
Do you want to remove clipboard history items older than {{olderThen}} {{durationType}}: Do you want to remove clipboard history items older than {{olderThen}} {{durationType}}
Enable Capture History: Enable Capture History
Filters:
App Filters: App Filters
Audio: Audio
Clear Filters: Clear Filters
Code: Code
Expand All @@ -25,6 +26,9 @@ Filters:
Pinned: Pinned
Secret: Secret
Select Filters: Select Filters
Source: Source
Source Application: Source Application
Source Filters: Source Filters
Starred: Starred
Text: Text
Video: Video
Expand Down
3 changes: 3 additions & 0 deletions packages/pastebar-app-ui/src/locales/lang/en/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Application Color Theme: Application Color Theme
Application UI Color Theme: Application UI Color Theme
Application UI Fonts Scale: Application UI Fonts Scale
Application UI Language: Application UI Language
Applications listed below will not have their copy to clipboard action captured in clipboard history. Case insensitive.: Applications listed below will not have their copy to clipboard action captured in clipboard history. Case insensitive.
Auto Disable History Capture when Screen Unlocked: Auto Disable History Capture when Screen Unlocked
Auto Lock Application Screen on User Inactivity: Auto Lock Application Screen on User Inactivity
Auto Lock Screen on User Inactivity: Auto Lock Screen on User Inactivity
Expand Down Expand Up @@ -65,6 +66,7 @@ Enter Passcode length: Enter Passcode length
Enter recovery password to reset passcode.: Enter recovery password to reset passcode.
Enter your <strong>{{screenLockPassCodeLength}} digits</strong> passcode: Enter your <strong>{{screenLockPassCodeLength}} digits</strong> passcode
Entered Passcode is invalid: Entered Passcode is invalid
Excluded Apps List: Excluded Apps List
Execute Web Requests: Execute Web Requests
Execute terminal or shell commands directly from PasteBar clip and copy the results to the clipboard.: Execute terminal or shell commands directly from PasteBar clip and copy the results to the clipboard.
'Expires:': 'Expires:'
Expand All @@ -78,6 +80,7 @@ Incorrect passcode.: Incorrect passcode.
Increase UI Font Size: Increase UI Font Size
Issued: Issued
Large: Large
List each application name or window identifier on a new line.: List each application name or window identifier on a new line.
List each word or sentence on a new line.: List each word or sentence on a new line.
Lock Screen Clipboard History Capture Control: Lock Screen Clipboard History Capture Control
Lock Screen PassCode: Lock Screen PassCode
Expand Down
1 change: 1 addition & 0 deletions packages/pastebar-app-ui/src/locales/lang/ru/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ Set Password: Установить пароль
Show Large View: Увеличенный вид
Show all: Показать все
Something goes wrong! Please try again.: Что-то пошло не так! Пожалуйста, попробуйте еще раз.
Source: Источник
Split History Window: Разделить окно с историей буфера
Star: Избранное
Star Selected: Добавить в избранное
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Add Tab: Добавить вкладку
Add to: Добавить в
Add to Menu: Добавить в меню
AddTo:
Add to Exclude and Delete: Добавить в исключения и удалить
Add to Filter by Source: Добавить в фильтр по источнику
Clip on Board: Клипы
Paste Menu: Меню
After: После
Expand Down
4 changes: 3 additions & 1 deletion packages/pastebar-app-ui/src/locales/lang/ru/history.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ Clear All History: Очистить всю историю
Clear History: Очистить историю
Confirm Clear All History: Подтвердить очистку всей истории
Do you really want to remove ALL clipboard history items?: Вы действительно хотите удалить ВСЕ элементы истории буфера обмена?
Do you want to remove clipboard history items older than {{olderThen}} {{durationType}}: Вы хотите удалить историю буфера обмена старше чем {{olderThen}} {{durationType}}
Do you want to remove all recent clipboard history older than {{olderThen}} {{durationType}}: Вы хотите удалить всю недавнюю историю буфера обмена за период {{olderThen}} {{durationType}}
Do you want to remove clipboard history items older than {{olderThen}} {{durationType}}: Вы хотите удалить историю буфера обмена старше чем {{olderThen}} {{durationType}}
Enable Capture History: Включить захват истории
Filters:
App Filters: Фильтры приложений
Audio: Аудио
Clear Filters: Очистить фильтры
Code: Код
Expand All @@ -26,6 +27,7 @@ Filters:
Pinned: Закрепленные
Secret: Секретные
Select Filters: Выбрать фильтры
Source: Источник
Starred: Избранные
Text: Текст
Video: Видео
Expand Down
3 changes: 3 additions & 0 deletions packages/pastebar-app-ui/src/locales/lang/ru/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Application Color Theme: Цветовая тема приложения
Application UI Color Theme: Цветовая тема интерфейса приложения
Application UI Fonts Scale: Масштаб шрифтов интерфейса приложения
Application UI Language: Язык интерфейса приложения
Applications listed below will not have their copy to clipboard action captured in clipboard history. Case insensitive.: Приложения, перечисленные ниже, не будут фиксировать действия копирования в историю буфера обмена. Регистр не учитывается.
Auto Disable History Capture when Screen Unlocked: Автоматически отключать захват истории при разблокировке экрана
Auto Lock Screen on User Inactivity: Автоматическая блокировка экрана при бездействии пользователя
Auto Lock the Screen on User Inactivity: Автоматическая блокировка экрана при бездействии пользователя
Expand Down Expand Up @@ -64,6 +65,7 @@ Enter Passcode length: Введите длину кода доступа
Enter recovery password to reset passcode.: Введите пароль восстановления для сброса кода доступа.
Enter your <strong>{{screenLockPassCodeLength}} digits</strong> passcode: Введите ваш <strong>{{screenLockPassCodeLength}}-значный</strong> код доступа
Entered Passcode is invalid: Введенный код доступа недействителен
Excluded Apps List: Список Исключенных Приложений
Execute Web Requests: Выполнять веб-запросы
Execute terminal or shell commands directly from PasteBar clip and copy the results to the clipboard.: Выполняйте терминальные или shell-команды непосредственно из клипа PasteBar и копируйте результаты в буфер обмена.
'Expires:': 'Истекает:'
Expand All @@ -76,6 +78,7 @@ Incorrect passcode.: Неверный код доступа.
Increase UI Font Size: Увеличить шрифт интерфейса
Issued: Выдана
Large: Большой
List each application name or window identifier on a new line.: Каждое название приложения или идентификатор окна на новой строке.
List each word or sentence on a new line.: Каждое слово или предложение списка должно быть на новой строке.
Lock Screen Clipboard History Capture Control: Управление захватом истории буфера обмена на экране блокировки
Lock Screen Passcode: Код доступа экрана блокировки
Expand Down
Loading

0 comments on commit 55d1ca3

Please sign in to comment.