Skip to content

Commit

Permalink
Merge branch 'main' into style/action-buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsojramos committed Jun 16, 2024
2 parents 2a7b12e + caff503 commit bdbc072
Show file tree
Hide file tree
Showing 21 changed files with 1,846 additions and 1,971 deletions.
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ body:
label: Gitify Version
description: What version of Gitify are you using?
options:
- 5.8.1
- 5.8.0
- 5.7.0
- 5.6.0
Expand Down Expand Up @@ -71,8 +72,8 @@ body:
label: GitHub Account
description: What GitHub account type are you using?
options:
- GitHub.com
- GitHub Enterprise
- GitHub Cloud
- GitHub Enterprise Server
- Combination
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
build-macos:
name: Build macOS (electron-builder)
runs-on: macos-14
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Linting

on:
push:
branches:
- main
pull_request:

jobs:
lint:
name: biomejs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint:check
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
release-macos:
name: Publish macOS (electron-builder)
runs-on: macos-14
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
run-unit-tests:
name: Run Tests
runs-on: ubuntu-latest
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -19,7 +19,6 @@ jobs:
node-version-file: '.nvmrc'
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint:check
- run: pnpm tsc --noEmit
- run: pnpm test -- --coverage --runInBand --verbose
- name: Coveralls
Expand Down
32 changes: 32 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,38 @@
-webkit-user-select: none;
}

html::-webkit-scrollbar,
div.flex-grow::-webkit-scrollbar {
width: 10px;
}

html::-webkit-scrollbar-thumb,
div.flex-grow::-webkit-scrollbar-thumb {
background-color: #c1c1c1;
border-radius: 10px;
}

html::-webkit-scrollbar-thumb:hover,
div.flex-grow::-webkit-scrollbar-thumb:hover {
background-color: #a8a8a8;
border-radius: 10px;
}

html.dark::-webkit-scrollbar-track,
html.dark div.flex-grow::-webkit-scrollbar-track {
background-color: #090E15;
}

html.dark::-webkit-scrollbar-thumb,
html.dark div.flex-grow::-webkit-scrollbar-thumb {
background-color: #24292e;
}

html.dark::-webkit-scrollbar-thumb:hover,
html.dark div.flex-grow::-webkit-scrollbar-thumb:hover {
background-color: #3a3f44;
}

body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
Expand Down
1 change: 0 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ app.whenReady().then(async () => {
mb.on('ready', () => {
autoUpdater.checkForUpdatesAndNotify();

mb.hideWindow();
mb.app.setAppUserModelId('com.electron.gitify');

// Tray configuration
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,6 @@
},
"packageManager": "pnpm@9.3.0",
"lint-staged": {
"*.{html,js,json,ts,tsx}": "biome format --fix"
"*.{js,json,ts,tsx}": "biome format --fix"
}
}
1 change: 1 addition & 0 deletions src/components/AccountNotifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const AccountNotifications = (props: IProps) => {
type="button"
title="Open Profile"
onClick={() => openAccountProfile(account)}
className="opacity-80"
>
@{account.user.login}
</button>
Expand Down
29 changes: 29 additions & 0 deletions src/components/NotificationRow.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,35 @@ describe('components/NotificationRow.tsx', () => {
expect(removeNotificationFromState).toHaveBeenCalledTimes(1);
});

it('should open a notification in the browser - delay notification setting enabled', () => {
const removeNotificationFromState = jest.fn();

const props = {
notification: mockSingleNotification,
account: mockGitHubCloudAccount,
};

render(
<AppContext.Provider
value={{
settings: {
...mockSettings,
markAsDoneOnOpen: false,
delayNotificationState: true,
},
removeNotificationFromState,
auth: mockAuth,
}}
>
<NotificationRow {...props} />
</AppContext.Provider>,
);

fireEvent.click(screen.getByRole('main'));
expect(links.openNotification).toHaveBeenCalledTimes(1);
expect(removeNotificationFromState).toHaveBeenCalledTimes(1);
});

it('should open a notification in the browser - key down', () => {
const removeNotificationFromState = jest.fn();

Expand Down
16 changes: 11 additions & 5 deletions src/components/NotificationRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ export const NotificationRow: FC<IProps> = ({ notification }) => {
unsubscribeNotification,
} = useContext(AppContext);
const [animateExit, setAnimateExit] = useState(false);
const [showAsRead, setShowAsRead] = useState(false);

const handleNotification = useCallback(() => {
setAnimateExit(true);
setAnimateExit(!settings.delayNotificationState);
setShowAsRead(settings.delayNotificationState);

openNotification(notification);

if (settings.markAsDoneOnOpen) {
Expand Down Expand Up @@ -102,13 +105,14 @@ export const NotificationRow: FC<IProps> = ({ notification }) => {
'group flex border-b border-gray-100 bg-white px-3 py-2 hover:bg-gray-100 dark:border-gray-darker dark:bg-gray-dark dark:text-white dark:hover:bg-gray-darker',
animateExit &&
'translate-x-full opacity-0 transition duration-[350ms] ease-in-out',
showAsRead && 'opacity-50 dark:opacity-50',
)}
>
<div
className={cn('mr-3 flex w-5 items-center justify-center', iconColor)}
title={notificationTitle}
>
<NotificationIcon size={18} aria-label={notification.subject.type} />
<NotificationIcon size={16} aria-label={notification.subject.type} />
</div>

<div
Expand Down Expand Up @@ -153,7 +157,7 @@ export const NotificationRow: FC<IProps> = ({ notification }) => {
<div title={reason.description}>{reason.title}</div>
<div title={updatedLabel}>{updatedAt}</div>
{settings.showPills && (
<div>
<div className="flex">
{notification.subject?.linkedIssues?.length > 0 && (
<PillButton
title={linkedIssuesPillDescription}
Expand Down Expand Up @@ -217,7 +221,8 @@ export const NotificationRow: FC<IProps> = ({ notification }) => {
className="h-full hover:text-green-500 focus:outline-none"
title="Mark as Done"
onClick={() => {
setAnimateExit(true);
setAnimateExit(!settings.delayNotificationState);
setShowAsRead(settings.delayNotificationState);
markNotificationDone(notification);
}}
>
Expand All @@ -229,7 +234,8 @@ export const NotificationRow: FC<IProps> = ({ notification }) => {
className="h-full hover:text-green-500 focus:outline-none"
title="Mark as Read"
onClick={() => {
setAnimateExit(true);
setAnimateExit(!settings.delayNotificationState);
setShowAsRead(settings.delayNotificationState);
markNotificationRead(notification);
}}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Repository.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const RepositoryNotifications: FC<IProps> = ({
<MarkGithubIcon size={18} />
)}
<span
className="cursor-pointer truncate"
className="cursor-pointer truncate opacity-90"
onClick={() => openRepository(repoNotifications[0].repository)}
>
{repoName}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bdbc072

Please sign in to comment.