Skip to content

fix(library): dim artifact-table writes while the gateway is offline - #10832

Closed
rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:fix/dim-artifact-table-writes-offline
Closed

rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:fix/dim-artifact-table-writes-offline

Conversation

@rnoack1

@rnoack1 rnoack1 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

In the artifacts library, the row's star toggle, the row's Delete, and the folder menu's
rename / delete items all wrote through the gateway with no connected check. With the
gateway down the click was accepted, the optimistic state flipped, and the write was
dropped — so an offline delete looked like it worked.

Every other write surface in the sidebar already refuses these clicks visibly through
offlineProps. This table did not, and the two row controls were the last ungated pair
in a file whose folder menu had already been gated.

Why it matters

A silent drop is worse than a refusal. A user who sees a row disappear believes the
artifact is gone; on reconnect it returns, and the only explanation available to them is
that the app is unreliable. The failure mode is invisible at exactly the moment the user
has least information — no error, no notice, no retry affordance.

What changed (motivation → approach → change)

ArtifactRow and the folder menu now read useConnected() and gate at the sink, which is
the rule the rest of the codebase already follows:

  • LibraryTable.tsx — the star toggle and Delete carry the opacity-40 dim, the
    offlineProps tooltip naming the verb, and a guard at the handler so a click that
    reaches it anyway cannot write.
  • OfflineMenuReason renders last inside the folder menu, because a natively disabled
    row carries pointer-events-none and so opens no tooltip — an explanation gated on
    activation cannot reach it.
  • Four utils.offline verbs (star_artifacts, delete_artifacts, delete_folders,
    rename_folders) plus the menu's offline_reason, across all 12 catalogues.

OfflineMenuReason.tsx is a new 17-line component. It is added identically by the sibling
PRs listed below, so whichever lands first carries it and the rest merge cleanly.

This PR is one unit of a split. A single larger change gated ~18 controls at once and
came to 4224 added lines, which is not reviewable. It is being cut into independent units;
this is the artifacts-table one, and it stands alone — it depends on no sibling.

Tests

  • LibraryTable.folderMenuOffline.test.tsx, ArtifactsPageCoverage.test.tsx,
    ArtifactsPage.test.tsx — 118 passed.
  • Fail-first: removing the two row guards fails the new cases; a connected control in each
    asserts the write still reaches the server when the gateway is up, so the tests
    discriminate rather than merely passing.
  • tsc -p tsconfig.app.json clean. i18n suites 683 passed; check-i18n-keys.mjs and
    check-i18n-strings.mjs both OK.

Manual verification

Toggled the gateway off with the artifacts library open: the star and Delete controls dim,
their tooltips name the verb, the folder menu shows the reason row, and no request is
issued. On reconnect the controls return to full weight and write normally.

Screenshots / video

None attached. Screenshot evidence for this change is under an unresolved repo-policy
question — the convention this repo's evidence gate rewards is committing frames under
temp-screenshots/, which .gitignore designates as never-committed. Rather than pick a
side inside a split PR, no frames are committed here and none are attached. Happy to
supply them in whichever form a maintainer prefers.

Related Issues

None.

Pattern harvest

useConnected() at the component that owns the write, rather than threading a connected
prop down: this file already did that at the folder level, so the row followed it instead
of introducing a second convention.

Checklist

  • One commit
  • Type-check, unit tests and i18n gates run locally
  • No new dependencies

Contribution License Agreement

I confirm this contribution is made under the terms of the project's contribution licence.

@dwu96

dwu96 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review.

When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Sep 14, 2026
@rnoack1
rnoack1 marked this pull request as ready for review September 15, 2026 00:49
@rnoack1
rnoack1 requested review from a team and patrigao September 15, 2026 00:49
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed b4454451ed104464777665758d42e92bb8b678ec via the fork AI-review pipeline; updated in place on each push.

Review details

FINDING -- website/src/components/library/LibraryTable.tsx:181 -- if (!connected) also changes offline folder creation and draft retention beyond the stated table/menu scope -> Fix: remove the shared FolderNameInput offline-hold changes from this PR.
[GPT-REVIEWED] b445445

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🔴 BLOCK (blocking)

Design-level review of b4454451ed104464777665758d42e92bb8b678ec via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: BLOCK

Cannot evaluate: missing screenshot or recording of the offline artifacts library — dimmed controls, menu reason row, sticky table footer, held-name note.

Blockers

Missing rendered evidence for a reshaped visible surface.
The diff adds new visible UI under website/src/ — a standing OfflineReasonRow inside the folder menu, a sticky bottom-0 … bg-bg reason strip that "while travelling it covers bg-card rows", opacity-40 dimmed control sets, and a visible held-draft note under FolderNameInput — and the evidence file records attachments downloaded and typed as images: 0, recordings 0, transport failures 0; the description itself says "Screenshots / video: None attached." Whether the dim reads as inert rather than absent, and whether the sticky strip sits correctly over striped rows, cannot be judged unseen; the description's temp-screenshots/ policy excuse doesn't apply — a github.com/user-attachments upload is the accepted form on a fork PR and needs no commit.
Fix: attach screenshots (offline table with sticky row, open folder menu with reason row, held-name note) and a short recording of the disconnect-while-menu-open transition.
Clears when: the description carries user-attachments images/recording of this revision that the evidence workflow downloads.

Watch

The description describes a different revision: it names OfflineMenuReason.tsx (17 lines) and an offline_reason key — the diff ships OfflineReasonRow.tsx (35 lines) and dimmed_actions_need_connection — and omits real behavior changes it contains: FolderNameInput blur offline now holds the draft instead of committing/cancelling, plus gating of SessionDocStar and the move submenu. The "sibling PRs add it identically" merge claim is unverifiable against the wrong name, and a reviewer approves against stale text.
Clears when: the description is rewritten to match this revision's components, keys, and the draft-hold semantics.

[DESIGN-REVIEWED] b445445

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5, fork) — 🔴 BLOCK

UX-level review of b4454451ed104464777665758d42e92bb8b678ec via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: BLOCK

cannot evaluate: missing screenshots of every offline state this PR adds — both attachment lists are empty ("Screenshots / video: None attached").

Evidence gaps

  • Dimmed row star and Delete (offline opacity-40 + tooltip, ArtifactRow) — screenshot of the table offline, plus one connected for contrast.
  • Folder menu offline: dimmed Rename/Delete, dimmed non-expanding "Move to folder" trigger, dimmed color swatches, and the "Gateway offline — the dimmed actions need a connection" reason row — screenshot of the open menu offline.
  • Sticky bottom reason row on LibraryTable/LibraryTree (sticky bottom-0 bg-bg) — screenshot of a long library mid-scroll offline, where the opaque row travels over bg-card rows.
  • FolderNameInput held-draft note ("Gateway offline — not saved yet. Keep this field open…") under the field — screenshot of the rename/create editor offline.
  • SessionDocStar offline dim — screenshot of the "From your chats" section offline.

The temp-screenshots policy question the description cites doesn't apply here: attaching the images to the PR description (github user-attachments) is the path this gate reads, and commits nothing.

[UX-REVIEWED] b445445

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🟡 CONCERNS

Premise-level review of b4454451ed104464777665758d42e92bb8b678ec via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

A declared two-control fix ships five undeclared surfaces — move-submenu gate, swatch gate, doc star, a draft-holding editor, sticky table rows — and misdescribes what shipped.

Not justified as shipped

  • Item 5 — undeclared: the description gates "the folder menu's rename / delete items"; the diff also gates Move via a new offlineVerb prop on shared FolderMoveSubmenu, and 3 of its 4 mounts stay ungated (SessionActionsMenu.tsx:154, ChatSidebar.tsx:7324, :7887) — accepted-and-deferred only because the split is declared.
    Clears when: the sibling split units land, or the description names the move gate and the ungated mounts.
  • Item 8 — undeclared: FolderNameInput now refuses an offline commit and holds the draft with a visible note — new behavior in create and rename, two extra i18n keys, aria-describedby wiring — never mentioned in the description.
    Subtraction: defer the draft-hold (and OfflineReasonRow's single-consumer message/id props plus save_folder_names/name_not_saved_keep_field_open) to its own split unit.
    Clears when: the deferral is made or the description declares this behavior.
  • Item 9 — undeclared: a sticky bottom "gateway offline" row is appended to both LibraryTable and LibraryTree; the description mentions only the menu's reason row.
    Clears when: the description declares the table-level rows.
  • Item 10 — framing: the description says "OfflineMenuReason.tsx is a new 17-line component" and "Four utils.offline verbs … plus the menu's offline_reason"; the diff ships OfflineReasonRow.tsx (35 lines) and eight keys, and "sibling PRs listed below" lists none.
    Clears when: the description matches the shipped component name, key count, and sibling list.

What this change ships

Inventory (10 items) — 4 justified

Intent: stop offline artifact-library writes from silently dropping by dimming and refusing them, per the existing offlineProps convention — a FIX.

  1. Row star toggle dims, names the reason, and refuses offline — justified
  2. Row Delete dims, names the reason, and refuses offline — justified
  3. Folder menu Rename/Delete dim and refuse, menu stays open — justified
  4. Standing offline reason row renders last in the folder menu — justified
  5. Move-to-folder submenu cannot expand offline — undeclared; 3 of 4 shared mounts left ungated
  6. Folder color swatches dim and refuse offline — undeclared, rides along
  7. Session-document star dims and refuses offline — undeclared, rides along
  8. Folder-name editor holds the typed name offline with a visible "not saved" note — undeclared, non-trivial rider
  9. Sticky offline reason row pinned under the flat table and folder tree — undeclared
  10. Eight i18n keys ×13 catalogues, shared dimmed prop on DropdownMenuItem (2 consumers), ja/ru grammar guard tests — undeclared beyond the five named keys

[FIRST-PRINCIPLES-REVIEWED] b445445

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review (fork) — ✅ no blocking findings

Reviewed b4454451ed104464777665758d42e92bb8b678ec via the fork AI-review pipeline; updated in place on each push.

Review details

No blocking defect — two advisory gaps in the new offline gating.

FINDING — website/src/pages/ArtifactsPage.tsx:1299 — drag-to-file is the table/tree's only artifact-move path and stays ungated while the menu's Move is now refused (offlineVerb={connected ? undefined : …}): offline, handleDragEnd → armArtifactMove → useMoveArtifactToFolder's onMutate writes the artifact into the target folder in the query cache, the setArtifactFolder request fails, and the onError rollback-by-invalidateQueries cannot refetch offline — so the move stays on screen having never persisted → Fix: bail out of handleDragEnd (or drop the sensors) on the same connection flag the folder menu now reads; the remedy lives in ArtifactsPage.tsx, which this diff does not touch.

FINDING — website/src/components/library/LibraryTable.tsx:440 — the offline branch adds opacity-40 on top of the unpinned star's existing text-muted/40, and element opacity multiplies with colour alpha (0.4 × 0.4 ≈ 0.16), so on every unfiled/unstarred row the star the change means to render "inert but present" is effectively invisible — the exact stacking the same diff avoids for the swatch row, SessionDocStar and Delete → Fix: in the offline arm use text-muted (not text-muted/40) for the unpinned case, keeping one dim layer. (origin: validation)

[OPUS-REVIEWED] b445445

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 16, 2026
@rnoack1
rnoack1 force-pushed the fix/dim-artifact-table-writes-offline branch from 7af35f5 to 2ebdf95 Compare September 16, 2026 21:57
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Sep 16, 2026
@rnoack1
rnoack1 force-pushed the fix/dim-artifact-table-writes-offline branch from 2ebdf95 to 56f0db6 Compare September 16, 2026 23:11
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 16, 2026
@rnoack1
rnoack1 force-pushed the fix/dim-artifact-table-writes-offline branch from 56f0db6 to 3997323 Compare September 17, 2026 00:00
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Sep 17, 2026
@rnoack1
rnoack1 force-pushed the fix/dim-artifact-table-writes-offline branch from 3997323 to 53b569b Compare September 17, 2026 00:58
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 17, 2026
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Sep 17, 2026
@rnoack1
rnoack1 force-pushed the fix/dim-artifact-table-writes-offline branch from 5b4b6ca to 6703736 Compare September 17, 2026 07:55
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 17, 2026
@rnoack1
rnoack1 force-pushed the fix/dim-artifact-table-writes-offline branch from 6703736 to 6f960f6 Compare September 17, 2026 09:03
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 17, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 20, 2026
@rnoack1
rnoack1 force-pushed the fix/dim-artifact-table-writes-offline branch from 6f960f6 to b41e7fc Compare September 22, 2026 02:35
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 22, 2026
@rnoack1
rnoack1 force-pushed the fix/dim-artifact-table-writes-offline branch from b41e7fc to f2a6122 Compare September 24, 2026 01:32
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 24, 2026
Star, Delete and the folder menu wrote through the gateway with no connected
check, so an offline click looked like it worked. Split from a larger sweep.
@NicholasRBowers

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been idle since 2026-09-24 with two blocking lanes and a conflicting base. I've assessed the blockers and they appear resolvable — I'll push fixes directly to this branch as a co-author.

Assessment: Nothing blocking here is a code defect. Design and UX both block for the same reason — no rendered evidence for a reshaped visible surface — so the work is capturing the five listed offline states (row star and Delete, the folder menu with its reason row, the sticky row mid-scroll, FolderNameInput's held-draft note, SessionDocStar) with the gateway down and attaching them, plus a short recording of the disconnect-while-menu-open transition. PR Hygiene is mechanical: the Pattern harvest section needs a Rule candidate: or Not generalizable: line. The base conflict is a single file, FolderMoveSubmenu.tsx, three additive hunks where main's sortMode and this PR's offlineVerb simply both survive; the other 21 files and all 13 locale catalogues merge clean. GPT and Opus both passed with advisories only, and the one Opus advisory about stacked star opacity is already fixed on the current head.

Worth flagging: no AI lane has judged the current head at all — GPT, Opus, Internal Content Scan, Security Scope, Design, First Principles and UX all failed closed in the 2026-09-24 rate-limit storm, so the verdicts above are from b4454451 and the lanes must re-run. The description also needs to match what shipped: it names OfflineMenuReason.tsx where the diff ships OfflineReasonRow.tsx, understates the i18n keys, and does not declare the draft-hold, the move-submenu gate, the swatches, SessionDocStar or the sticky rows. First Principles clears once those surfaces are declared, so keeping the FolderNameInput hold and declaring it is a valid path and I will take it unless you say otherwise — neither reviewer marked it blocking.

If you'd prefer I don't touch this PR, add the pr-no-autofix label.

Copy link
Copy Markdown
Contributor

PR triage (automated, against origin/main @ ef61a9aaf6c6): OVERLAPPING, recommend MERGE-DISCUSSION + REBASE. Not a duplicate, and nothing on main covers it.

Not on main yet. origin/main has no useConnected/offlineProps in LibraryTable.tsx, no OfflineReasonRow.tsx, no dimmed on DropdownMenuItem, and no offlineVerb on FolderMoveSubmenu. The branch is 2004 commits behind main. git merge-tree reports a conflict in website/src/components/FolderMoveSubmenu.tsx, where main's sortMode was added by #13380.

The overlap is with the sibling split PRs, open PRs #9485 and #10911 (both checked as PRs, not issues). The three PRs build incompatible versions of the same shared primitives:

Primitive this PR #9485 #10911
FolderMoveSubmenu offline gate offlineVerb prop. If it is set, the trigger is disabled and <Sub open={false}>, so the submenu cannot open offline + offlineTitle props. The trigger is only dimmed and aria-disabled, and the submenu still opens on purpose: the doc comment says disabled would drop the tooltip and focus Reads useConnected() inside the component. offlineVerb only supplies tooltip text. The submenu opens and each pick is refused
DropdownMenuItem dim new dimmed prop, placed before className new offline prop, placed after className on purpose, so text-danger rows still get dimmed —
Offline reason component OfflineReasonRow.tsx (new) — OfflineMenuReason.tsx (new)
i18n utils.offline.* move_folders, rename_folders, delete_folders, plus dimmed_actions_need_connection the same three verbs, plus menu_reason (same English text as dimmed_actions_need_connection) move_folders

Two consequences:

Suggested path: pick one owner for the shared FolderMoveSubmenu / DropdownMenuItem / reason-component API (probably #9485, which is the oldest). Land it, then rebase this PR onto it so this PR only keeps the LibraryTable.tsx row, star and swatch gating and its tests. Rebase onto main either way to resolve the FolderMoveSubmenu.tsx conflict.

No breaking change and no P0 found. The Opus advisory about the ungated drag-to-file path in ArtifactsPage.tsx is still open. It is out of scope here, but it is the remaining silent-drop path on this surface.

@iamwhatever

Copy link
Copy Markdown
Contributor

Thank you @rnoack1 for this fix. This branch was about 3,700 commits behind main, and #20749 (your #9485) has since landed the shared offline primitive, so I carried the change forward in a same-repo PR: #20989.

Your commit keeps your authorship. The port uses the API main now has (offlineMenuRow, the offline dim on DropdownMenuItem, FolderMoveSubmenu's offline / offlineTitle, OfflineMenuReason), so the dimmed prop, OfflineReasonRow.tsx and the offlineVerb submenu are folded into those. Everything is green there, with before/after screenshots in the description. Tracking issue: #20988.

Closing this one in favour of #20989; the branch is left in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants