Repository navigation
fix: give the question bank a door and show Add before a process is picked - #626
Open
phamtruonghung wants to merge 4 commits into
Open
phamtruonghung wants to merge 4 commits into
phamtruonghung wants to merge 4 commits into
Conversation
…icked The Assessments register header gains an unconditional Question bank button, since the bank is readable plant-wide (ADR-0009) and until now its Screen had no way in. In the bank, Add and Paste now show for any caller holding PPL_ASSESSMENT_CHANGE and stay disabled, with a "choose a process" tooltip, until a process is chosen, rather than being hidden entirely. Closes #625 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The register's header now carries four actions (Refresh, Question bank, Marking queue, New assessment), and at a 900px window they no longer fit beside the title: the header only fell back to its wrapped layout below the 560px breakpoint, so the one-row layout overflowed by 36px and the palette sweep caught a header action outside the surface. AppPageHeader now also takes its existing wrapped layout when the actions' natural width would leave the title less than 200px of the row. The breakpoint rule is unchanged, and a header whose actions fit lays out exactly as before, so no golden moves. The decision is made during layout by a small single-child render object, the way LayoutBuilder works, and the child it built last time is updated in place so the actions keep their State and focus across rebuilds. Refs #625 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ster at 1200/900/600 The header test uses a single 400px action. The box is exactly action + Spacing.md + AppPageHeader.minTitleWidth wide, so it is above the 560 breakpoint. At that width the action stays on the title row; one pixel narrower it wraps under the title. The lib compares with a strict `>`, and the test pins that boundary. The register test renders the full four-action header (a caller holding CHANGE and MARK) at window widths 1200, 900 and 600. At each width it asserts no overflow, that all four actions are present, and that Question bank is hit-testable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Question bank (
/assessments/questions) had no way in:Routes.assessmentQuestionshad no call site, and the bank hid Add and Paste until a process was chosen, so a first visit offered no "Thêm câu hỏi".assessments_screen.dart): a newQuestion bankoutlined button (questionBankKey,Icons.library_books_outlined) sits between Refresh and the Marking queue. It shows to every caller who can open the register, because the bank is readable plant-wide (ADR-0009) and renders read-only withoutPPL_ASSESSMENT_CHANGE.assessment_questions_screen.dart): Add and Paste now depend only onmayChange. They stay disabled, with the tooltip "Chọn một công đoạn" (assessmentChooseProcessTitle), until a process is chosen. A reader still sees neither button.There is no new Destination, ARB key or golden, and no backend change.
Tests:
assessment_register_test.darthas "Question bank opens the bank for a caller who may only read assessments". It covers a caller with display only, and asserts the router location isRoutes.assessmentQuestions.assessment_bank_test.darthas three tests: buttons present but disabled before a process is chosen, enabled after, and absent for a reader. The existing "register, not the bank" test now checks by Screen type, because the register header now carries the "Question bank" text.Closes #625