Repository navigation
Keep library empty states centred below timed allowances - #253
Conversation
There was a problem hiding this comment.
Review round 1: request changes (small; independent Opus review of 5c89d32, verified)
Renders and non-empty lists look right. Two P2s:
- A new timed allowance does not appear while the list is empty.
CredentialManagementView+List.swift~177 checks!libraryPresentation.allowances.isEmptyin the parent body.activeTimedAllowances()is a Broker read, not observable state, so when an agent's request is approved with a timed allowance while the user views an empty group or a search with no matches, nothing redraws the view and the Timed allowances card and its Revoke button stay hidden. Before this PR theTimelineViewwas always mounted and showed it within about 1 s. Always mounttimedAllowanceListin the empty branch (as the non-empty branch and the inspector do;FrozenTimedAllowanceListdraws nothing when empty), and move its bottom padding inside so an empty list adds no height and does not push the empty state off centre. - The test checks height, not centring or the card.
CredentialEmptyLayoutTests.swift~86-87 only asserts the document fills the viewport. Also assert that the empty state's title or icon is vertically centred in the space below the card (or the viewport when no allowance), thattimed-allowance-listis present when an allowance exists, and add the transition case: empty list with no allowance, then an allowance is granted without any other view change, and the card appears within the next refresh.
Re-render the two "allowance" variants in English and Chinese after the change and update the gist with git as before.
|
Review round 1 addressed in
|
Closes #251
Summary
Diff stat
git diff --stat origin/main: 2 files changed, 252 insertions, 11 deletions.CredentialManagementView+List.swift: 39 lines changed.CredentialEmptyLayoutTests.swift: 224 lines added.Tests
swift build: PASS.swift test --filter 'CredentialEmptyLayoutTests|CredentialLibraryPresentationTests|TimedAllowanceRevocationTests': 6 passed, 0 failed, 0 skipped on017cb48bc213603550cbc907fe3aa5e737ec7552.timed-allowance-listnever appears (1 failed test, 2 assertions). Forcing the content to the top while retaining the full viewport height makes all 12 centre assertions fail, proving the test checks placement independently of document height. Both intentional mutations were removed.SettingsView, production management-window factory, hidden windows, isolated preferences and read-only synthetic fixtures. The temporary render test was removed before the final 6-test run. All 12 PNGs were regenerated after review round 1 and retain the same SHA-256 values as the original static renders.Checks
python3 scripts/check_hygiene.py: PASS, all violation counts 0.python3 scripts/check_module_deps.py: PASS.git diff --check: PASS.origin/main(5cf9bc3038981cdc82baec3f6fcc3a64157f7119) before pushing; final head:017cb48bc213603550cbc907fe3aa5e737ec7552.017cb48bc213603550cbc907fe3aa5e737ec7552..build, temporary render test, PNGs, previews, gist clone and local build/test logs (about 1.1 GiB from the final verification). Final data-volume free space: 231.2 GiB. No build/test or simulator process remains from this task; the pre-existing idle systemtestmanagerdwas left untouched. The clean task branch/worktree is retained for review.Original PNG SHA-256 values in the secret render gist:
en-group-allowance.png29bb4dcb7581b9b90743998b7fa758491fda199c3635056499ba4a2f0db57764en-group-no-allowance.png347e835c8b91d5667bc35acce7488d0339ef379ab94b8de89310628e3070fdb9en-library-allowance.png97c36e8e207f4decb2a43b96ee49d207dc626b9afe6e11cb580530f21285a009en-library-no-allowance.png59a17d7ca645e9d6299af7d2ce5b55bdfcc6c77886df2735fd829c2c91e92610en-search-allowance.png2ae58ae63ae1c11bc1b9767abff7a0464ccf2b9d8468c09d8dadce6eeda5f0f6en-search-no-allowance.png836f162794e4a36c3a19aca808db9d3a91996401b66a9c1da05cf0a45eb22f64zh-Hans-group-allowance.pngf6125e4a6ceaf22a5ad2038059a0f313fac71d248f295d02f990f2d641d6d50ezh-Hans-group-no-allowance.png1f336d2067c97af0dcbbcbe1016de613a79a3be4d7649be5cb9201fa1c4533adzh-Hans-library-allowance.png78836f90f8336eb11544091fd5a621323e91e2f68f342be41e82a7a5a0fb9cc3zh-Hans-library-no-allowance.png3e48c638f4909e29ae6d873a47742851bceb8940d8594c09e04a7aa594e017a9zh-Hans-search-allowance.png80143cca1f1d7277e5705f5a6855ed4bf194b483a3bd3ecd994598147f4367e9zh-Hans-search-no-allowance.png881673001acc091c5e144e73e65424a43179e90c9906e5703bd2685667988c1aDeviations and questions
None. Gist's CLI rejected binary uploads, so the original PNG files were uploaded through the gist's git remote as directed through Orca.