refactor(ext/shared): rename REQUIRED_PILL → REQUIRED_PILL_HTML
Code-review feedback on Task 1: the _HTML suffix makes the 'this is raw HTML, do not escape' contract obvious at every call site. Cheap to do now (zero consumers); would be 8 diffs once Tasks 4-6 wire the constant into the type forms. Plan updated in lockstep so Task 4 references the new name. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,7 @@ describe('glyphs', () => {
|
||||
expect(glyphs.GLYPH_LOCK).toBe('⏻');
|
||||
});
|
||||
|
||||
it('exports REQUIRED_PILL as an HTML snippet', () => {
|
||||
expect(glyphs.REQUIRED_PILL).toBe('<span class="req-pill">required</span>');
|
||||
it('exports REQUIRED_PILL_HTML as an HTML snippet', () => {
|
||||
expect(glyphs.REQUIRED_PILL_HTML).toBe('<span class="req-pill">required</span>');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,5 +18,8 @@ export const GLYPH_SETTINGS = '⚙'; // sidebar settings nav
|
||||
export const GLYPH_LOCK = '⏻'; // sidebar lock nav
|
||||
|
||||
/// Inline HTML snippet for the required-field pill. Use after a label's text:
|
||||
/// `<label class="label" for="f-title">title ${REQUIRED_PILL}</label>`
|
||||
export const REQUIRED_PILL = '<span class="req-pill">required</span>';
|
||||
/// `<label class="label" for="f-title">title ${REQUIRED_PILL_HTML}</label>`
|
||||
///
|
||||
/// Requires the `.req-pill` CSS rule (added in Tasks 2 and 3 to popup/styles.css
|
||||
/// and vault/vault.css respectively).
|
||||
export const REQUIRED_PILL_HTML = '<span class="req-pill">required</span>';
|
||||
|
||||
Reference in New Issue
Block a user