Files
notebook-snapshot-extension/style/base.css
T
tao.chenandClaude bc1828bde6
Build / Check Links (push) Failing after 6s
Check Release / check_release (push) Failing after 1m1s
Build / build (push) Failing after 1m25s
Build / test_isolated (push) Skipped
Build / Integration tests (push) Skipped
fix: surface hash-duplicate warning and add manual refresh
Three issues fixed:

1. **Skipped-commit warning not visible** — When the user commits
   unchanged content (hash matches most recent version), the backend
   correctly returns {skipped: true, reason: "unchanged", message: ...}
   but the frontend Notification.warning was easy to miss (default
   4-5s autoClose, small toast at top-right). Now uses {autoClose: false}
   so the warning stays until manually dismissed, plus a console.log
   of the raw commit response for debugging. Added a fallback branch
   that warns clearly if the response shape is unexpected.

2. **No manual refresh on the panel** — In S3 setups the list call
   can occasionally lag the just-committed entry (manifest strong
   consistency is a per-implementation property). Added a "刷新"
   button at the top of the sidebar that calls model.refresh(), letting
   the user force a re-fetch when the auto-refresh misses.

3. **S3 addressing_style** — user-side config addition: S3Storage
   now uses path-style addressing (endpoint/bucket/key) which is the
   format required by MinIO and several other S3-compatible services.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-21 18:23:34 +08:00

238 lines
4.4 KiB
CSS

/*
See the JupyterLab Developer Guide for useful CSS Patterns:
https://jupyterlab.readthedocs.io/en/stable/developer/css.html
*/
/* snapshot extension */
.jp-snapshot-panel {
padding: 8px;
overflow-y: auto;
height: 100%;
box-sizing: border-box;
}
.jp-snapshot-panel-container {
display: flex;
flex-direction: column;
height: 100%;
}
.jp-snapshot-panel-toolbar {
display: flex;
justify-content: flex-end;
margin-bottom: 6px;
}
.jp-snapshot-panel-refresh-button {
font-size: 0.8em;
padding: 2px 8px;
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;
}
.jp-snapshot-panel-refresh-button:hover:not(:disabled) {
background: var(--jp-layout-color3, #e8e8e8);
}
.jp-snapshot-panel-refresh-button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.jp-snapshot-panel-empty {
color: var(--jp-ui-font-color2, #555);
padding: 12px;
text-align: center;
}
.jp-snapshot-panel-hint {
font-size: 0.85em;
margin-top: 8px;
color: var(--jp-ui-font-color2, #888);
}
.jp-snapshot-panel-list {
list-style: none;
margin: 0;
padding: 0;
}
.jp-snapshot-panel-item {
border: 1px solid var(--jp-border-color2, #ddd);
border-radius: 4px;
padding: 8px;
margin-bottom: 8px;
background: var(--jp-layout-color1, #fff);
}
.jp-snapshot-panel-item-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
}
.jp-snapshot-panel-name {
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.jp-snapshot-panel-size {
font-size: 0.8em;
color: var(--jp-ui-font-color2, #888);
white-space: nowrap;
}
.jp-snapshot-panel-desc {
font-size: 0.9em;
color: var(--jp-ui-font-color2, #555);
margin: 4px 0;
white-space: pre-wrap;
}
.jp-snapshot-panel-time {
font-size: 0.8em;
color: var(--jp-ui-font-color2, #888);
margin-bottom: 6px;
}
.jp-snapshot-panel-actions {
display: flex;
gap: 4px;
}
.jp-snapshot-panel-button {
flex: 1;
padding: 4px 8px;
font-size: 0.85em;
border: 1px solid var(--jp-border-color2, #ccc);
border-radius: 3px;
background: var(--jp-layout-color2, #f5f5f5);
cursor: pointer;
}
.jp-snapshot-panel-button:hover {
background: var(--jp-layout-color3, #e8e8e8);
}
/* commit dialog */
.jp-snapshot-commit-dialog {
display: flex;
flex-direction: column;
gap: 6px;
padding: 8px;
min-width: 320px;
}
.jp-snapshot-commit-dialog label {
font-weight: 600;
font-size: 0.9em;
}
.jp-snapshot-commit-dialog-name,
.jp-snapshot-commit-dialog-desc {
font-family: inherit;
font-size: 1em;
padding: 4px 6px;
border: 1px solid var(--jp-border-color2, #ccc);
border-radius: 3px;
box-sizing: border-box;
width: 100%;
}
.jp-snapshot-commit-dialog-desc {
resize: vertical;
}
/* diff widget */
.jp-snapshot-diff-widget {
padding: 8px;
overflow-y: auto;
height: 100%;
box-sizing: border-box;
}
.jp-snapshot-diff-container {
display: flex;
flex-direction: column;
gap: 8px;
}
.jp-snapshot-diff-row {
border: 1px solid var(--jp-border-color2, #ddd);
border-radius: 4px;
padding: 6px;
background: var(--jp-layout-color1, #fff);
}
.jp-snapshot-diff-added {
background: var(--jp-diff-added-color1, #e6ffed);
border-left: 3px solid #2cbe4e;
}
.jp-snapshot-diff-deleted {
background: var(--jp-diff-deleted-color1, #ffeef0);
border-left: 3px solid #cb2431;
}
.jp-snapshot-diff-modified {
background: var(--jp-diff-modified-color1, #fff5b1);
border-left: 3px solid #dfb700;
}
.jp-snapshot-diff-unchanged {
background: var(--jp-layout-color1, #fff);
border-left: 3px solid var(--jp-border-color2, #ddd);
}
.jp-snapshot-diff-badge {
display: inline-block;
font-size: 0.8em;
font-weight: 600;
padding: 1px 6px;
border-radius: 3px;
margin-right: 6px;
background: var(--jp-layout-color2, #eee);
}
.jp-snapshot-diff-cell-type {
display: inline-block;
font-size: 0.8em;
color: var(--jp-ui-font-color2, #888);
}
.jp-snapshot-diff-pre {
font-family: var(--jp-code-font-family, monospace);
font-size: 0.9em;
margin: 6px 0 0 0;
white-space: pre-wrap;
word-break: break-all;
}
.jp-snapshot-diff-line-added {
background: #ccffd8;
}
.jp-snapshot-diff-line-removed {
background: #ffd7d5;
}
.jp-snapshot-diff-line-context {
color: var(--jp-ui-font-color2, #555);
}
.jp-snapshot-diff-empty {
color: var(--jp-ui-font-color2, #888);
text-align: center;
padding: 16px;
}