Compare commits

...
5 Commits
Author SHA1 Message Date
tao.chenandClaude 72fd363600 ci: move bark-notify.sh to .github/scripts, add Gitea release asset upload
Two changes:

1. Move scripts/bark-notify.sh -> .github/scripts/bark-notify.sh
   (CI helper belongs next to the workflow that calls it). History
   preserved via git mv.

2. Add a 'Upload release assets via Gitea API' step that runs only
   on tag pushes (if: startsWith(github.ref, 'refs/tags/v')). It:
     - POSTs /releases to create a Gitea release bound to the tag
     - extracts the release id from the response (with explicit error
       path if the API call fails)
     - loops over dist/snapshot-*.whl and dist/snapshot-*.tar.gz and
       uploads each as a release asset
   Uses ${{ secrets.GITHUB_TOKEN }} exposed as the GITEA_TOKEN env
   var (the Gitea convention for the repo token secret). The
   Notify Bark step still runs last with if: always() so a release
   upload failure is reported via the phone.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-21 18:51:57 +08:00
tao.chenandClaude 044c83cd22 ci: bark notification on build success / failure
Adds scripts/bark-notify.sh (deployment detail, hardcoded
device_key + endpoint — per the script header it's a deployment
constant, not a secret) and a final workflow step that pushes
a / notification on every job result.

The notify step:
- runs unconditionally (if: always()) so failures also notify
- is a side-effect — if Bark itself is unreachable, the
  curl failure is swallowed so CI does not turn red on a
  notification outage
- uses portable context vars (github.repository / ref_name /
  sha / actor / job.status) which work on Gitea Actions

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-21 18:50:25 +08:00
tao.chenandClaude 121b835494 ci: rewrite workflows for Gitea, use astral-uv runner, uv build only
Replaces the previous five JupyterLab-template workflows
(build / check-release / enforce-label / prep-release /
publish-release / update-integration-tests) with a single minimal
CI workflow tuned for a self-hosted Gitea runner.

What's in the new build.yml:
- Triggers: push to main, push of v* tag, pull_request
- runs-on: astral-uv (self-hosted runner with uv pre-installed;
  we skip the setup-uv step)
- Steps: checkout -> uv build -> upload-artifact
- uv build alone is enough because pyproject.toml's
  [tool.hatch.build.hooks.jupyter-builder] drives jlpm install
  and jlpm build:prod before wheel assembly, and uv caches the
  build environment between runs.

What's removed: all jupyter-server/jupyter_releaser steps and the
check-links / update-snapshots / test_isolated / integration-tests
jobs from the template — they depended on jupyterlab/maintainer-tools
and GitHub-specific secrets (GITHUB_TOKEN, APP_PRIVATE_KEY, NPM_TOKEN)
that don't apply to a Gitea deployment.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-21 18:48:15 +08:00
tao.chenandClaude 5ae9f94023 docs: add TODO.md (pending items, prioritized by user value)
Captures the open work items raised across earlier sessions:
- S3 consistency fix (return list in commit response — the real
  workaround behind the 'refresh button' shim)
- POST /notebook-version/restore endpoint (deferred in design.md)
- Settings schema (schema/plugin.json is currently empty)
- jest + pnpm linker incompatibility (blocks jlpm test)
- Frontend diff.ts unit tests (blocked on the jest fix)
- ui-tests (Playwright + Galata)
- CI pytest step
- v0.0.1 tag + PyPI release

Each item is labeled with trigger conditions (what real user need
would justify doing it) so we don't gold-plate features.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-21 18:44:03 +08:00
tao.chenandClaude 263232bea4 feat: replace text buttons with icons (tooltip on hover)
Replaces the two visible 'button-like' affordances with LabIcon glyphs
so the sidebar and toolbar stay compact; the explanatory text moves
to the hover tooltip.

Changes:
- Toolbar 'Save Snapshot' button: text label -> saveIcon (floppy),
  tooltip '保存当前 notebook 为快照'
- Sidebar panel '快照历史' text label -> saveIcon + caption='快照历史'
  (the panel tab is now icon-only)
- Sidebar refresh button: text -> refreshIcon with a 1s rotate animation
  while loading

Dependencies:
- Adds @jupyterlab/ui-components to package.json (source of the
  standard LabIcon set: saveIcon, refreshIcon, historyIcon)

Style:
- New .jp-snapshot-panel-refresh-button sizing (28x24 fixed box,
  centered icon) and .is-loading spin keyframes
- @keyframes jp-snapshot-spin applied to the icon's .jp-Icon element

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-21 18:41:01 +08:00
14 changed files with 237 additions and 346 deletions
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# bark-notify.sh — push a notification to the local Bark server.
#
# Usage: bark-notify.sh <title> <body>
#
# The Bark endpoint, device_key, and group are pinned in this script
# (it is a deployment detail, not a secret). The group is "Gitea" —
# change it here if you want to sort notifications by category.
set -euo pipefail
if [ "$#" -ne 2 ]; then
echo "usage: $0 <title> <body>" >&2
exit 1
fi
TITLE="$1"
BODY="$2"
PAYLOAD=$(cat <<EOF
{
"device_key": "6ZFVsxM95cuAjYoNLWSWaN",
"title": "${TITLE}",
"body": "${BODY}",
"group": "Gitea",
"isArchive": 1,
"ttl": 3600
}
EOF
)
curl -s \
-X POST http://101.43.40.124:81/push \
-H "Content-Type: application/json; charset=utf-8" \
-d "${PAYLOAD}"
echo "bark notified: ${TITLE}"
+81 -147
View File
@@ -1,162 +1,96 @@
name: Build
name: CI
on:
push:
branches: main
branches:
- main
tags:
- 'v*'
pull_request:
branches: '*'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
ci:
name: CI
# `astral-uv` is a self-hosted runner with uv pre-installed, so we can
# skip the setup-uv step entirely. pyproject.toml's
# [tool.hatch.build.hooks.jupyter-builder] handles jlpm install +
# jlpm build:prod before wheel assembly.
runs-on: astral-uv
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Build package
run: uv build
- name: Install dependencies
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
- name: Upload wheel artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: snapshot-dist
path: dist/snapshot-*
if-no-files-found: error
- name: Lint the extension
run: |
set -eux
jlpm
jlpm run lint:check
# Only create a release + attach dist/ assets when pushing a v* tag.
# On branch pushes / pull requests this step is skipped entirely.
- name: Upload release assets via Gitea API
if: startsWith(github.ref, 'refs/tags/v')
env:
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
TAG_NAME="${{ github.ref_name }}"
- name: Test the extension
run: |
set -eux
jlpm run test
echo "Creating Gitea release for tag ${TAG_NAME}..."
- name: Build the extension
run: |
set -eux
python -m pip install .[test]
RELEASE_RESPONSE=$(curl -fsS -X POST "${{ github.api_url }}/repos/${{ github.repository }}/releases" \
-H "accept: application/json" \
-H "authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "$(cat <<EOF
{
"tag_name": "${TAG_NAME}",
"target_commitish": "${{ github.sha }}",
"name": "Release ${TAG_NAME}",
"body": "Auto-generated release assets.",
"draft": false,
"prerelease": false
}
EOF
)")
pytest -vv -r ap --cov snapshot
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "snapshot.*OK"
RELEASE_ID=$(printf '%s' "${RELEASE_RESPONSE}" | grep -oP '"id":\s*\K[0-9]+' | head -n 1)
if [ -z "${RELEASE_ID}" ]; then
echo "ERROR: failed to create release. Response:"
echo "${RELEASE_RESPONSE}"
exit 1
fi
echo "Release created with ID ${RELEASE_ID}"
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "snapshot.*OK"
python -m jupyterlab.browser_check
for asset in dist/snapshot-*.whl dist/snapshot-*.tar.gz; do
if [ -f "${asset}" ]; then
echo "Uploading ${asset}..."
curl -fsS -X POST "${{ github.api_url }}/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets" \
-H "accept: application/json" \
-H "authorization: token ${GITEA_TOKEN}" \
-F "attachment=@${asset}"
echo
else
echo "Skipping ${asset} (not found)"
fi
done
- name: Package the extension
run: |
set -eux
pip install build
python -m build
pip uninstall -y "snapshot" jupyterlab
- name: Upload extension packages
uses: actions/upload-artifact@v4
with:
name: extension-artifacts
path: dist/snapshot*
if-no-files-found: error
test_isolated:
needs: build
runs-on: ubuntu-latest
steps:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
- uses: actions/download-artifact@v4
with:
name: extension-artifacts
- name: Install and Test
run: |
set -eux
# Remove NodeJS, twice to take care of system and locally installed node versions.
sudo rm -rf $(which node)
sudo rm -rf $(which node)
pip install "jupyterlab>=4.0.0,<5" snapshot*.whl
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "snapshot.*OK"
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "snapshot.*OK"
python -m jupyterlab.browser_check --no-browser-test
integration-tests:
name: Integration tests
needs: build
runs-on: ubuntu-latest
env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Download extension package
uses: actions/download-artifact@v4
with:
name: extension-artifacts
- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab>=4.0.0,<5" snapshot*.whl
- name: Install dependencies
working-directory: ui-tests
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install
- name: Set up browser cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
- name: Install browser
run: |
set -eux
jlpm playwright install chromium --only-shell
working-directory: ui-tests
- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm playwright test
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v4
with:
name: snapshot-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report
check_links:
name: Check Links
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
# Always run, regardless of job status. The script is a side-effect;
# if the notification itself fails we swallow the error so CI does
# not turn red on a Bark outage.
- name: Notify Bark
if: always()
run: |
if [ "${{ job.status }}" = "success" ]; then
TITLE="✅ CI: ${{ github.repository }}@${{ github.ref_name }}"
BODY="Build OK for ${{ github.sha }} by ${{ github.actor }}"
else
TITLE="❌ CI: ${{ github.repository }}@${{ github.ref_name }}"
BODY="Build FAILED for ${{ github.sha }} by ${{ github.actor }}"
fi
./.github/scripts/bark-notify.sh "$TITLE" "$BODY" || echo "Bark notify failed (non-fatal)"
-30
View File
@@ -1,30 +0,0 @@
name: Check Release
on:
push:
branches: ["main"]
pull_request:
branches: ["*"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Check Release
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Distributions
uses: actions/upload-artifact@v4
with:
name: snapshot-releaser-dist-${{ github.run_number }}
path: .jupyter_releaser_checkout/dist
-13
View File
@@ -1,13 +0,0 @@
name: Enforce PR label
on:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize]
jobs:
enforce-label:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: enforce-triage-label
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1
-48
View File
@@ -1,48 +0,0 @@
name: "Step 1: Prep Release"
on:
workflow_dispatch:
inputs:
version_spec:
description: "New Version Specifier"
default: "next"
required: false
branch:
description: "The branch to target"
required: false
post_version_spec:
description: "Post Version Specifier"
required: false
# silent:
# description: "Set a placeholder in the changelog and don't publish the release."
# required: false
# type: boolean
since:
description: "Use PRs with activity since this date or git reference"
required: false
since_last_stable:
description: "Use PRs with activity since the last stable git tag"
required: false
type: boolean
jobs:
prep_release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Prep Release
id: prep-release
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
version_spec: ${{ github.event.inputs.version_spec }}
# silent: ${{ github.event.inputs.silent }}
post_version_spec: ${{ github.event.inputs.post_version_spec }}
branch: ${{ github.event.inputs.branch }}
since: ${{ github.event.inputs.since }}
since_last_stable: ${{ github.event.inputs.since_last_stable }}
- name: "** Next Step **"
run: |
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"
-58
View File
@@ -1,58 +0,0 @@
name: "Step 2: Publish Release"
on:
workflow_dispatch:
inputs:
branch:
description: "The target branch"
required: false
release_url:
description: "The URL of the draft GitHub release"
required: false
steps_to_skip:
description: "Comma separated list of steps to skip"
required: false
jobs:
publish_release:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Populate Release
id: populate-release
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
with:
token: ${{ steps.app-token.outputs.token }}
branch: ${{ github.event.inputs.branch }}
release_url: ${{ github.event.inputs.release_url }}
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
- name: Finalize Release
id: finalize-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2
with:
token: ${{ steps.app-token.outputs.token }}
release_url: ${{ steps.populate-release.outputs.release_url }}
- name: "** Next Step **"
if: ${{ success() }}
run: |
echo "Verify the final release"
echo ${{ steps.finalize-release.outputs.release_url }}
- name: "** Failure Message **"
if: ${{ failure() }}
run: |
echo "Failed to Publish the Draft Release Url:"
echo ${{ steps.populate-release.outputs.release_url }}
@@ -1,39 +0,0 @@
name: Update Playwright Snapshots
on:
issue_comment:
types: [created, edited]
permissions:
contents: write
pull-requests: write
jobs:
update-snapshots:
runs-on: ubuntu-latest
if: github.event.issue.pull_request && contains(github.event.comment.body, 'please update snapshots')
steps:
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots-checkout@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
- name: Install extension
run: |
set -eux
jlpm
python -m pip install .
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Playwright knows how to start JupyterLab server
start_server_script: 'null'
test_folder: ui-tests
npm_client: jlpm
+74
View File
@@ -0,0 +1,74 @@
# TODO
待办项,**按用户需求驱动**——别凭空虚构。完成一项后:勾选 + 改 CHANGELOG + 在 commit message 引用本节。
> 用户视角(配置 / 安装)见 [README.md](README.md)。设计目标见 [design.md](design.md)。工程手册见 [DEVELOPER.md](DEVELOPER.md)。
## 后端
- [ ] **`POST /notebook-version/restore` 端点**design.md 里标"暂缓"
- 现状:restore 走纯前端 `model.fromJSON()` + `context.save()`,只能恢复**当前打开的** notebook
- 端点能力:脚本/CLI 调 API 恢复任意路径的 notebook;删了的 notebook 从 S3 拉回
- 必须走 `ContentsManager.write`(不能直接写文件),要处理权限 / 文件锁 / 并发
- 估计:~50 行 Python + ~30 行测试
- 触发条件:团队有 CI 灾备 / 批量恢复需求
- [ ] **修复 S3 提交后 list 偶发返回旧 manifest**
- 根因:commit 写 manifest 后前端独立发 list;某些 S3 兼容服务(MinIO / Ceph RGW / 阿里云 OSS 等)实现各异,强一致性不保证
- 方案:把 list 塞进 commit 响应(commit 写完立刻在同进程内 list 一定是最新),省掉独立 GET
- 估计:~30 行(改 commit 响应 + 前端 `setVersions` 直写 + 测试)
- 临时缓解:侧边栏「刷新」按钮(已加)
## 前端
- [ ] **`schema/plugin.json` settings schema**
- 现状:空 schema,插件激活时只 `console.log` settings,无任何可配置项
- 候选配置:`confirmRestore` / `defaultDescription` / `maxVersionsToShow` / `commitShortcut` / `skipDuplicate`
- 估计:~100 行(schema.json + 前端读 settings + 一个真用上的配置项)
- 触发条件:真有用户想调参再加
- [ ] **修复 jest 在 pnpm 链接器下跑不起来**
- 根因:`.yarnrc.yml``yarnLinker: pnpm`,虚拟存储把 `ts-jest``jest-util` 隔开
- 当前绕过:`jlpm build`tsc 严格 + rspack)验证前端
- 方案 A:改 `.yarnrc.yml``nodeLinker: node-modules`(影响整个 monorepo 解析)
- 方案 B:完全重写 `jest.config.js` 不依赖 `@jupyterlab/testing` 的 baseConfig
- 估计:A 1 行;B 半日
- [ ] **前端 diff 逻辑单测**
- `src/diff.ts` 是纯函数,最值得测;目前没有单测跑(受上面 jest 故障牵连)
- 估计:跟 jest 修复一起做,~50 行测试
## 测试 / CI
- [ ] **ui-testsPlaywright + Galata)跑通**
- 当前:`ui-tests/` 目录有但 README 里有 yarn.lock 是空的,从未跑过
- 前置:先把 jest 修通,CI 工作流 `.github/workflows/build.yml` 跑通
- 估计:跟 CI 一起做,~2-3 天
- [ ] **CI 流水线加后端 pytest**
- 当前 `.github/workflows/build.yml` 没看到 pytest 步骤
- 估计:~10 行 yaml
## 发布
- [ ] **v0.0.1 tag + 推送到 origin**
```bash
git tag v0.0.1
git push origin main --tags
```
- [ ] **v0.0.1 wheel 发布到 PyPI**(如需)
- `python -m build` 出 wheelhatch 自动嵌前端)
- `twine upload dist/*`
- 触发条件:要让别人 `pip install snapshot` 装上
## 优先级
按"真实价值"排:
1. 修 S3 一致性(用户已报告的 bug 根因)
2. v0.0.1 tag(当前未发版)
3. jest 修复 + 前端单测(解锁 `jlpm test` 工作流)
4. CI 加 pytest
5. settings schema / restore 端点(按需)
6. ui-tests(锦上添花)
+1
View File
@@ -61,6 +61,7 @@
"@jupyterlab/notebook": "^4.0.0",
"@jupyterlab/services": "^7.0.0",
"@jupyterlab/settingregistry": "^4.0.0",
"@jupyterlab/ui-components": "^4.0.0",
"@lumino/signaling": "^2.0.0",
"@lumino/widgets": "^2.0.0",
"diff": "^5.2.0",
+9 -3
View File
@@ -5,6 +5,7 @@ import {
import { INotebookTracker, NotebookPanel } from '@jupyterlab/notebook';
import { ToolbarButton, MainAreaWidget } from '@jupyterlab/apputils';
import { ISettingRegistry } from '@jupyterlab/settingregistry';
import { saveIcon } from '@jupyterlab/ui-components';
import { requestAPI } from './request';
import { registerCommands, CommandIDs } from './commands';
@@ -59,7 +60,11 @@ const plugin: JupyterFrontEndPlugin<void> = {
onOpenDiff: openDiff
});
panel.id = 'snapshot:panel';
panel.title.label = '快照历史';
// Icon-only panel tab: the title text becomes a hover caption so the
// sidebar stays compact. saveIcon is reused for visual consistency with
// the commit toolbar button (both signal "save" semantics).
panel.title.icon = saveIcon;
panel.title.caption = '快照历史';
app.shell.add(panel, 'left', { rank: 200 });
// Keep the model in sync with the current notebook.
@@ -73,13 +78,14 @@ const plugin: JupyterFrontEndPlugin<void> = {
registerCommands(app, tracker, model);
// Add a "保存快照" button to every notebook panel's toolbar.
// Add an icon-only "保存快照" button to every notebook panel's toolbar.
// The tooltip on hover carries the full description.
// NOTE: docRegistry.addWidgetExtension('Notebook', ...) places its
// returned widget in the *main area* (a new tab), not on the toolbar.
// The toolbar wants panel.toolbar.addItem directly.
const addCommitButton = (panelHost: NotebookPanel) => {
const button = new ToolbarButton({
label: '保存快照',
icon: saveIcon,
tooltip: '保存当前 notebook 为快照',
onClick: () => {
void app.commands.execute(CommandIDs.commit);
+7 -2
View File
@@ -1,6 +1,7 @@
import * as React from 'react';
import { ReactWidget } from '@jupyterlab/apputils';
import { ServerConnection } from '@jupyterlab/services';
import { refreshIcon } from '@jupyterlab/ui-components';
import { getSnapshotContent } from '../api';
import { INotebook } from '../diff';
@@ -50,14 +51,18 @@ const Panel: React.FC<PanelProps> = ({ model, app, tracker, serverSettings, onOp
<div className="jp-snapshot-panel-container">
<div className="jp-snapshot-panel-toolbar">
<button
className="jp-snapshot-panel-refresh-button"
className={
'jp-snapshot-panel-refresh-button' +
(model.loading ? ' is-loading' : '')
}
onClick={() => {
void model.refresh();
}}
disabled={model.loading}
title="重新拉取版本列表"
aria-label="刷新"
>
{model.loading ? '刷新中…' : '刷新'}
<refreshIcon.react className="jp-Icon jp-Icon-16" tag="span" />
</button>
</div>
{model.loading && model.versions.length === 0 ? (
+21 -2
View File
@@ -26,13 +26,18 @@
}
.jp-snapshot-panel-refresh-button {
font-size: 0.8em;
padding: 2px 8px;
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 24px;
padding: 0;
border: 1px solid var(--jp-border-color2, #ccc);
border-radius: 3px;
background: var(--jp-layout-color2, #f5f5f5);
color: var(--jp-ui-font-color1, #333);
cursor: pointer;
line-height: 0;
}
.jp-snapshot-panel-refresh-button:hover:not(:disabled) {
@@ -44,6 +49,20 @@
cursor: not-allowed;
}
.jp-snapshot-panel-refresh-button.is-loading svg,
.jp-snapshot-panel-refresh-button.is-loading .jp-Icon {
animation: jp-snapshot-spin 1s linear infinite;
}
@keyframes jp-snapshot-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.jp-snapshot-panel-empty {
color: var(--jp-ui-font-color2, #555);
padding: 12px;
Generated
+5 -3
View File
@@ -1969,7 +1969,6 @@ wheels = [
name = "snapshot"
source = { editable = "." }
dependencies = [
{ name = "boto3" },
{ name = "jupyter-server" },
]
@@ -1978,6 +1977,9 @@ dev = [
{ name = "jupyter-builder" },
{ name = "jupyterlab" },
]
s3 = [
{ name = "boto3" },
]
test = [
{ name = "coverage" },
{ name = "pytest" },
@@ -1988,7 +1990,7 @@ test = [
[package.metadata]
requires-dist = [
{ name = "boto3", specifier = ">=1.43.52" },
{ name = "boto3", marker = "extra == 's3'", specifier = ">=1.34.0" },
{ name = "coverage", marker = "extra == 'test'" },
{ name = "jupyter-builder", marker = "extra == 'dev'", specifier = ">=1.0.0" },
{ name = "jupyter-server", specifier = ">=2.4.0,<3" },
@@ -1998,7 +2000,7 @@ requires-dist = [
{ name = "pytest-cov", marker = "extra == 'test'" },
{ name = "pytest-jupyter", extras = ["server"], marker = "extra == 'test'", specifier = ">=0.6.0" },
]
provides-extras = ["dev", "test"]
provides-extras = ["dev", "s3", "test"]
[[package]]
name = "soupsieve"
+2 -1
View File
@@ -2785,7 +2785,7 @@ __metadata:
languageName: node
linkType: hard
"@jupyterlab/ui-components@npm:^4.6.1":
"@jupyterlab/ui-components@npm:^4.0.0, @jupyterlab/ui-components@npm:^4.6.1":
version: 4.6.1
resolution: "@jupyterlab/ui-components@npm:4.6.1"
dependencies:
@@ -9222,6 +9222,7 @@ __metadata:
"@jupyterlab/settingregistry": ^4.0.0
"@jupyterlab/testing": ^4.6.1
"@jupyterlab/testutils": ^4.0.0
"@jupyterlab/ui-components": ^4.0.0
"@lumino/signaling": ^2.0.0
"@lumino/widgets": ^2.0.0
"@module-federation/runtime-tools": ^2.0.0