Files
olivv-cs-ComfyUI-FunPack/app/composer/elements/gallery.css
T
digital-garbage f37f526268 app: Generate wired to a real run -- queued, progress, cancel, result
ComfyUI's own queue and its own socket, not a second one alongside them. A
FunPack queue would be a second thing tracking what is running, and the one the
user believes is whichever spoke last -- so this speaks to /prompt, /interrupt
and /ws as any ComfyUI client does and holds only a view of the server's state.
The graph is asked for, never assembled here, for the same reason.

The client id is remembered: ComfyUI addresses progress to the client that
queued the run, so a reload with a fresh id hears nothing about the generation
already in flight -- the run continues, the GPU time is spent, and the app says
Ready.

Faults found on the way, each in code that already had passing tests:

* `[hidden]` was inert across the whole kit. The UA rule is element-level, so
  `.cx-btn { display: inline-flex }` beats it -- Cancel was marked hidden, sat
  there, and nothing reported anything. jsdom cannot see it: the attribute was
  always correct. One reset rule, and a browser test over four element kinds.
* A panel passed no height to its body and a split pane passed none to its
  panes, so the viewer asked for 100% of `auto` and collapsed to a single line
  inside a panel that was the right size around it.
* subscribe() delivered the first state outside the guard every later delivery
  gets, so one bad listener took down whoever was wiring the UI up -- at
  startup, before anything existed to report it.
* A whole tests directory was never run: the test script globbed
  composer/tests only. `node --test` discovers them itself now, so there is no
  list to forget.
* `empty` was not in the content rule's key list, so three elements were never
  asked to prove their empty-state text comes back as text rather than markup.

The dev server now mounts the REAL routes -- register() already took a route
table -- instead of reimplementing them over http.server. It answered POST
/api/pipeline with 501, so the edit-and-queue path could not be looked at, which
is the one thing the dev server exists for.
2026-08-30 03:36:40 +03:00

77 lines
3.7 KiB
CSS

/* Sized from the CONTAINER, not the viewport: a 280px panel lays out like a
* 280px panel however wide the window is. */
.cx-gallery-wrap { container-type: inline-size; width: 100%; }
.cx-gallery {
display: grid; gap: clamp(6px, 2.5cqw, 12px);
grid-template-columns: repeat(auto-fill, minmax(var(--cell, var(--cell-thumb)), 1fr));
}
.cx-gallery[data-cols="1"] { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.cx-gallery[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx-gallery[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cx-gallery[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cx-cell {
display: flex; flex-direction: column; gap: var(--sp-2); padding: 0;
border: var(--bw) solid var(--line); border-radius: var(--r-3);
background: var(--elev-2); color: var(--text); cursor: pointer; overflow: hidden;
transition: border-color var(--dur-1) var(--ease-standard);
}
.cx-cell:hover { border-color: var(--line-hover); }
.cx-cell.cx-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cx-cell-thumb {
position: relative; aspect-ratio: 16 / 10; background: var(--void);
display: flex; align-items: center; justify-content: center;
}
.cx-cell-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cx-cell-glyph { font-size: clamp(18px, calc(var(--cell, 96px) * .3), 34px); color: var(--faint); }
.cx-cell-badge, .cx-cell-duration {
position: absolute; bottom: var(--sp-1); font-size: var(--fs-8);
padding: 1px var(--sp-2); border-radius: var(--r-1);
background: color-mix(in srgb, var(--void) 70%, transparent); color: var(--hi, #fff);
}
.cx-cell-badge { left: var(--sp-1); }
.cx-cell-duration { right: var(--sp-1); font-variant-numeric: tabular-nums; }
.cx-cell-name {
font-size: clamp(10px, calc(var(--cell, 96px) * .115), 13px);
line-height: var(--lh-snug); padding: 0 var(--sp-3) var(--sp-3);
text-align: left; display: -webkit-box; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; overflow: hidden;
}
.cx-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--cell-card), 1fr)); gap: var(--sp-5); }
.cx-card {
display: flex; flex-direction: column; gap: var(--sp-2); text-align: left;
padding: var(--sp-6); border: var(--bw) solid var(--line); border-radius: var(--r-5);
background: var(--elev-1); color: var(--text); cursor: pointer;
transition: border-color var(--dur-1) var(--ease-standard), background var(--dur-1) var(--ease-standard);
}
.cx-card:hover { border-color: var(--line-hover); }
.cx-card.cx-on { border-color: var(--accent); background: var(--accent-soft); }
.cx-card-icon { font-size: var(--fs-d3); line-height: 1; color: var(--accent); }
.cx-card-title { font-size: var(--fs-3); font-weight: var(--fw-semibold); }
.cx-strip { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-2); }
.cx-strip-cell {
flex: none; width: 72px; aspect-ratio: 16 / 10; padding: 0;
border: var(--bw) solid var(--line); border-radius: var(--r-2);
background: var(--void); overflow: hidden; cursor: pointer;
display: flex; align-items: center; justify-content: center;
}
.cx-strip-cell:hover { border-color: var(--accent); }
/* The result, shown whole. `contain` rather than `cover`: a generated frame
cropped to fit its box is a different picture from the one that was made. */
.cx-viewer { display: flex; min-block-size: 0; block-size: 100%; }
.cx-viewer-stage {
flex: 1 1 auto;
display: flex; align-items: center; justify-content: center;
min-block-size: 0; min-inline-size: 0;
background: var(--elev-0);
border-radius: var(--r-4);
}
.cx-viewer-media {
max-inline-size: 100%; max-block-size: 100%;
inline-size: auto; block-size: auto;
object-fit: contain;
}