Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1c6015772 | ||
| d7d7d183c5 | |||
|
|
a5ddd10ff4 | ||
|
|
2921d3a547 | ||
|
|
2be4c66b4a | ||
|
|
f180f4ab7c | ||
|
|
b1167c3eb6 | ||
|
|
16bdf92f77 | ||
|
|
2ebe97c5a4 | ||
|
|
1aef7812a1 | ||
|
|
4f61a31f28 | ||
| 491a5845f0 | |||
|
|
bd25ce8e1d | ||
| a5d44e191b | |||
| 5f4bf191fc | |||
|
|
cfcec87cd9 | ||
| 2c9bcca344 |
@@ -7,6 +7,7 @@ on:
|
||||
- dev
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
increment-version:
|
||||
|
||||
95
.gitea/workflows/update-submodule.yml
Normal file
95
.gitea/workflows/update-submodule.yml
Normal file
@@ -0,0 +1,95 @@
|
||||
name: Update cinny submodule
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
cinny_sha:
|
||||
description: "cinny commit SHA to pin (defaults to origin/main)"
|
||||
required: false
|
||||
type: string
|
||||
|
||||
concurrency:
|
||||
group: update-cinny-submodule
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
bump:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: false
|
||||
# PAT so the submodule bump push can trigger build.yml
|
||||
# (GITHUB_TOKEN pushes do not start new workflows).
|
||||
token: ${{ secrets.ACTIONS_TOKEN }}
|
||||
ref: master
|
||||
|
||||
- name: Update cinny submodule
|
||||
id: bump
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
ORIGIN_URL=$(git remote get-url origin)
|
||||
ORIGIN_URL=${ORIGIN_URL%/}
|
||||
ORIGIN_URL=${ORIGIN_URL%.git}
|
||||
BASE_URL=${ORIGIN_URL%/*}
|
||||
CINNY_URL="${BASE_URL}/cinny.git"
|
||||
echo "Rewriting submodule URL to ${CINNY_URL}"
|
||||
git config submodule.cinny.url "${CINNY_URL}"
|
||||
git submodule sync --recursive
|
||||
git submodule update --init --recursive
|
||||
|
||||
TARGET_SHA="${{ inputs.cinny_sha }}"
|
||||
git -C cinny fetch origin main
|
||||
|
||||
if [ -n "${TARGET_SHA}" ]; then
|
||||
git -C cinny checkout --detach "${TARGET_SHA}"
|
||||
else
|
||||
git -C cinny checkout --detach origin/main
|
||||
fi
|
||||
|
||||
NEW_SHA=$(git -C cinny rev-parse HEAD)
|
||||
OLD_SHA=$(git rev-parse HEAD:cinny)
|
||||
SUBJECT=$(git -C cinny log -1 --pretty=%s)
|
||||
|
||||
echo "old=${OLD_SHA}"
|
||||
echo "new=${NEW_SHA}"
|
||||
echo "subject=${SUBJECT}"
|
||||
|
||||
if [ "${OLD_SHA}" = "${NEW_SHA}" ]; then
|
||||
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||
echo "cinny already at ${NEW_SHA}; nothing to do"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git add cinny
|
||||
git config user.name "GitHub Actions"
|
||||
git config user.email "actions@github.com"
|
||||
git commit -m "Bump cinny: ${SUBJECT}"
|
||||
|
||||
{
|
||||
echo "changed=true"
|
||||
echo "sha=${NEW_SHA}"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Push submodule bump
|
||||
if: steps.bump.outputs.changed == 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
for attempt in 1 2 3; do
|
||||
git fetch origin master
|
||||
git rebase origin/master || {
|
||||
git rebase --abort || true
|
||||
echo "Failed to rebase submodule bump onto latest master"
|
||||
exit 1
|
||||
}
|
||||
if git push origin HEAD:master; then
|
||||
echo "Pushed cinny bump (${{ steps.bump.outputs.sha }})"
|
||||
exit 0
|
||||
fi
|
||||
echo "Push rejected on attempt ${attempt}, retrying"
|
||||
done
|
||||
echo "Failed to push submodule bump after 3 attempts"
|
||||
exit 1
|
||||
2
cinny
2
cinny
Submodule cinny updated: ea7642f0bb...898d217451
@@ -1,107 +0,0 @@
|
||||
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Box, Chip, Header, IconButton, Text, as } from 'folds';
|
||||
import { Icon, Icons } from '../icons';
|
||||
import * as css from './ImageViewer.css';
|
||||
import { useZoom } from '../../hooks/useZoom';
|
||||
import { usePan } from '../../hooks/usePan';
|
||||
import { downloadAndSaveMedia } from '../../utils/saveMedia';
|
||||
import { getCurrentAccessToken } from '../../utils/auth';
|
||||
|
||||
export type ImageViewerProps = {
|
||||
alt: string;
|
||||
src: string;
|
||||
requestClose: () => void;
|
||||
};
|
||||
|
||||
export const ImageViewer = as<'div', ImageViewerProps>(
|
||||
({ className, alt, src, requestClose, ...props }, ref) => {
|
||||
const { zoom, zoomIn, zoomOut, setZoom } = useZoom(0.2);
|
||||
const { pan, cursor, onMouseDown } = usePan(zoom !== 1);
|
||||
|
||||
const handleDownload = async () => {
|
||||
try {
|
||||
await downloadAndSaveMedia(src, alt, getCurrentAccessToken());
|
||||
} catch (error) {
|
||||
console.warn('[ImageViewer] Failed to download media:', error);
|
||||
try {
|
||||
window.open(src, '_blank');
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Box
|
||||
className={classNames(css.ImageViewer, className)}
|
||||
direction="Column"
|
||||
{...props}
|
||||
ref={ref}
|
||||
>
|
||||
<Header className={css.ImageViewerHeader} size="400">
|
||||
<Box grow="Yes" alignItems="Center" gap="200">
|
||||
<IconButton size="300" radii="300" onClick={requestClose}>
|
||||
<Icon size="50" src={Icons.ArrowLeft} />
|
||||
</IconButton>
|
||||
<Text size="T300" truncate>
|
||||
{alt}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box shrink="No" alignItems="Center" gap="200">
|
||||
<IconButton
|
||||
variant={zoom < 1 ? 'Success' : 'SurfaceVariant'}
|
||||
outlined={zoom < 1}
|
||||
size="300"
|
||||
radii="Pill"
|
||||
onClick={zoomOut}
|
||||
aria-label="Zoom Out"
|
||||
>
|
||||
<Icon size="50" src={Icons.Minus} />
|
||||
</IconButton>
|
||||
<Chip variant="SurfaceVariant" radii="Pill" onClick={() => setZoom(zoom === 1 ? 2 : 1)}>
|
||||
<Text size="B300">{Math.round(zoom * 100)}%</Text>
|
||||
</Chip>
|
||||
<IconButton
|
||||
variant={zoom > 1 ? 'Success' : 'SurfaceVariant'}
|
||||
outlined={zoom > 1}
|
||||
size="300"
|
||||
radii="Pill"
|
||||
onClick={zoomIn}
|
||||
aria-label="Zoom In"
|
||||
>
|
||||
<Icon size="50" src={Icons.Plus} />
|
||||
</IconButton>
|
||||
<Chip
|
||||
variant="Primary"
|
||||
onClick={handleDownload}
|
||||
radii="300"
|
||||
before={<Icon size="50" src={Icons.Download} />}
|
||||
>
|
||||
<Text size="B300">Download</Text>
|
||||
</Chip>
|
||||
</Box>
|
||||
</Header>
|
||||
<Box
|
||||
grow="Yes"
|
||||
className={css.ImageViewerContent}
|
||||
justifyContent="Center"
|
||||
alignItems="Center"
|
||||
>
|
||||
<img
|
||||
className={css.ImageViewerImg}
|
||||
style={{
|
||||
cursor,
|
||||
transform: `scale(${zoom}) translate(${pan.translateX}px, ${pan.translateY}px)`,
|
||||
}}
|
||||
src={src}
|
||||
alt={alt}
|
||||
draggable={false}
|
||||
onMouseDown={onMouseDown}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
);
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "paarrot",
|
||||
"version": "4.11.144",
|
||||
"version": "4.11.151",
|
||||
"description": "Paarrot - A Matrix client based on Cinny",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
|
||||
Reference in New Issue
Block a user