Skip to content

Commit ef156c9

Browse files
committed
style(term): remove icon from table header for alignment
1 parent 79b59ca commit ef156c9

File tree

4 files changed

+29
-37
lines changed

4 files changed

+29
-37
lines changed

crates/synd_term/src/ui/components/entries.rs

+10-14
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,17 @@ impl Entries {
177177
}
178178
};
179179
let header = Row::new([
180-
Cell::from(concat!(icon!(calendar), " Published")),
181-
Cell::from(format!("󰯂 Entry {n}/{m}")),
182-
Cell::from("󰑫 Feed"),
183-
Cell::from(concat!(icon!(requirement), " Req")),
180+
Cell::from("Published"),
181+
Cell::from(format!("Entry {n}/{m}")),
182+
Cell::from("Feed"),
183+
Cell::from("Req"),
184184
]);
185185

186186
let constraints = [
187-
Constraint::Length(11),
187+
Constraint::Length(10),
188188
Constraint::Fill(2),
189189
Constraint::Fill(1),
190-
Constraint::Length(5),
190+
Constraint::Length(4),
191191
];
192192

193193
let row = |entry: &'a types::Entry| {
@@ -214,11 +214,7 @@ impl Entries {
214214
Span::from(title),
215215
])),
216216
Cell::from(Span::from(feed_title)),
217-
Cell::from(Line::from(vec![
218-
Span::from(" "),
219-
requirement,
220-
Span::from(" "),
221-
])),
217+
Cell::from(Line::from(vec![requirement, Span::from(" ")])),
222218
])
223219
};
224220

@@ -257,21 +253,21 @@ impl Entries {
257253

258254
Line::from(vec![
259255
Span::from(concat!(icon!(entry), " Entry")).bold(),
260-
Span::from(" "),
256+
Span::from(" "),
261257
Span::from(entry.title.as_deref().unwrap_or(ui::UNKNOWN_SYMBOL)),
262258
])
263259
.render(title_area, buf);
264260

265261
Line::from(vec![
266262
Span::from(concat!(icon!(open), " URL")).bold(),
267-
Span::from(" "),
263+
Span::from(" "),
268264
Span::from(entry.website_url.as_deref().unwrap_or_default()),
269265
])
270266
.render(url_area, buf);
271267

272268
Line::from(vec![
273269
Span::from(concat!(icon!(calendar), " Published")).bold(),
274-
Span::from(" "),
270+
Span::from(" "),
275271
Span::from(
276272
entry
277273
.published

crates/synd_term/src/ui/components/filter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ impl Filter {
345345

346346
let spans = vec![
347347
Span::from(concat!(icon!(filter), " Filter")).dim(),
348-
Span::from(" "),
348+
Span::from(" "),
349349
{
350350
let r = self.requirement.label(&cx.theme.requirement);
351351
if r.content == "MAY" {

crates/synd_term/src/ui/components/subscription.rs

+14-18
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::{
2020
self,
2121
components::filter::{FeedFilter, FilterResult},
2222
extension::RectExt,
23-
icon, Context,
23+
Context,
2424
},
2525
};
2626

@@ -241,19 +241,19 @@ impl Subscription {
241241
}
242242
};
243243
let header = Row::new([
244-
Cell::from("Updated"),
245-
Cell::from(format!("󰑫 Feed {n}/{m}")),
246-
Cell::from(concat!(icon!(open), " URL")),
247-
Cell::from("󰎞 Description"),
248-
Cell::from("Req"),
244+
Cell::from("Updated"),
245+
Cell::from(format!("Feed {n}/{m}")),
246+
Cell::from("URL"),
247+
Cell::from("Description"),
248+
Cell::from("Req"),
249249
]);
250250

251251
let constraints = [
252-
Constraint::Length(11),
252+
Constraint::Length(10),
253253
Constraint::Fill(1),
254254
Constraint::Fill(1),
255255
Constraint::Fill(2),
256-
Constraint::Length(5),
256+
Constraint::Length(4),
257257
];
258258

259259
let row = |feed_meta: &'a Feed| {
@@ -292,11 +292,7 @@ impl Subscription {
292292
.trim_end_matches('/'),
293293
)),
294294
Cell::from(Span::from(desc)),
295-
Cell::from(Line::from(vec![
296-
Span::from(" "),
297-
requirement,
298-
Span::from(" "),
299-
])),
295+
Cell::from(Line::from(vec![requirement, Span::from(" ")])),
300296
])
301297
};
302298

@@ -388,7 +384,7 @@ impl Subscription {
388384
];
389385

390386
let table = Table::new(meta_rows, widths)
391-
.column_spacing(2)
387+
.column_spacing(1)
392388
.style(cx.theme.subscription.background);
393389
Widget::render(table, meta_area, buf);
394390

@@ -409,15 +405,15 @@ impl Subscription {
409405
};
410406

411407
let header = Row::new([
412-
Cell::new(Span::from(concat!(icon!(calendar), " Published"))),
413-
Cell::new(Span::from(concat!(icon!(entry), " Entry"))),
414-
Cell::new(Span::from(concat!(icon!(summary), " Summary"))),
408+
Cell::new(Span::from("Published")),
409+
Cell::new(Span::from("Entry")),
410+
Cell::new(Span::from("Summary")),
415411
]);
416412

417413
let rows = feed.entries.iter().map(entry);
418414
let table = Table::new(rows, widths)
419415
.header(header.style(cx.theme.subscription.header))
420-
.column_spacing(2)
416+
.column_spacing(1)
421417
.style(cx.theme.subscription.background);
422418

423419
Widget::render(table, entries_area, buf);

crates/synd_term/tests/snapshots/integration__test__landing_entries.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Buffer {
77
area: Rect { x: 0, y: 0, width: 120, height: 30 },
88
content: [
99
" Syndicationd 󱉯 Entries 󰑫 Feeds ",
10-
" 󰈶 Filter MAY ",
10+
" 󰈶 Filter MAY ",
1111
"  Search ",
1212
" ",
13-
" Published 󰯂 Entry -/- 󰑫 Feed Req",
13+
" Published Entry -/- Feed Req ",
1414
" ",
1515
" ",
1616
" ",
@@ -45,8 +45,8 @@ Buffer {
4545
x: 108, y: 0, fg: Rgb(254, 205, 178), bg: Rgb(43, 41, 45), underline: Reset, modifier: NONE,
4646
x: 2, y: 1, fg: Rgb(254, 205, 178), bg: Rgb(43, 41, 45), underline: Reset, modifier: DIM,
4747
x: 10, y: 1, fg: Rgb(254, 205, 178), bg: Rgb(43, 41, 45), underline: Reset, modifier: NONE,
48-
x: 15, y: 1, fg: Rgb(254, 205, 178), bg: Rgb(43, 41, 45), underline: Reset, modifier: DIM,
49-
x: 18, y: 1, fg: Rgb(254, 205, 178), bg: Rgb(43, 41, 45), underline: Reset, modifier: NONE,
48+
x: 14, y: 1, fg: Rgb(254, 205, 178), bg: Rgb(43, 41, 45), underline: Reset, modifier: DIM,
49+
x: 17, y: 1, fg: Rgb(254, 205, 178), bg: Rgb(43, 41, 45), underline: Reset, modifier: NONE,
5050
x: 2, y: 2, fg: Rgb(254, 205, 178), bg: Rgb(43, 41, 45), underline: Reset, modifier: DIM,
5151
x: 10, y: 2, fg: Rgb(254, 205, 178), bg: Rgb(43, 41, 45), underline: Reset, modifier: NONE,
5252
x: 0, y: 4, fg: Rgb(254, 205, 178), bg: Rgb(43, 41, 45), underline: Reset, modifier: BOLD | UNDERLINED,

0 commit comments

Comments
 (0)